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
5ea75f8b3388bc929fb980637b458ee629eaed39
include/seec/Transforms/BreakConstantGEPs/BreakConstantGEPs.h
include/seec/Transforms/BreakConstantGEPs/BreakConstantGEPs.h
//===- BreakConstantGEPs.h - Change constant GEPs into GEP instructions --- --// // // The SAFECode Compiler // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This pass changes all GEP constant expressions into GEP instructions. This // permits the rest of SAFECode to put run-time checks on them if necessary. // //===----------------------------------------------------------------------===// #ifndef BREAKCONSTANTGEPS_H #define BREAKCONSTANTGEPS_H #include "llvm/ADT/StringRef.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/Module.h" #include "llvm/Pass.h" namespace llvm { // // Pass: BreakConstantGEPs // // Description: // This pass modifies a function so that it uses GEP instructions instead of // GEP constant expressions. // struct BreakConstantGEPs : public FunctionPass { private: // Private methods // Private variables public: static char ID; BreakConstantGEPs() : FunctionPass(ID) {} StringRef getPassName() const override { return "Remove Constant GEP Expressions"; } virtual bool runOnFunction (Function & F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { // This pass does not modify the control-flow graph of the function AU.setPreservesCFG(); } }; } // namespace llvm #endif
//===- BreakConstantGEPs.h - Change constant GEPs into GEP instructions --- --// // // The SAFECode Compiler // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This pass changes all GEP constant expressions into GEP instructions. This // permits the rest of SAFECode to put run-time checks on them if necessary. // //===----------------------------------------------------------------------===// #ifndef BREAKCONSTANTGEPS_H #define BREAKCONSTANTGEPS_H #include "llvm/ADT/StringRef.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/Module.h" #include "llvm/Pass.h" namespace llvm { // // Pass: BreakConstantGEPs // // Description: // This pass modifies a function so that it uses GEP instructions instead of // GEP constant expressions. // struct BreakConstantGEPs : public FunctionPass { private: // Private methods // Private variables public: static char ID; BreakConstantGEPs() : FunctionPass(ID) {} StringRef getPassName() const override { return "Remove Constant GEP Expressions"; } virtual bool runOnFunction (Function & F) override; virtual void getAnalysisUsage(AnalysisUsage &AU) const override { // This pass does not modify the control-flow graph of the function AU.setPreservesCFG(); } }; } // namespace llvm #endif
Correct inconsistent use of override.
Correct inconsistent use of override.
C
mit
seec-team/seec,seec-team/seec,seec-team/seec,mheinsen/seec,mheinsen/seec,mheinsen/seec,mheinsen/seec,seec-team/seec,seec-team/seec,mheinsen/seec
76da6746559ec2b160a1443a5bffaaeca2f0c7c2
src/common/phys_mem_addr.h
src/common/phys_mem_addr.h
#ifndef GST_IMX_COMMON_PHYS_MEM_ADDR_H #define GST_IMX_COMMON_PHYS_MEM_ADDR_H #define GST_IMX_PHYS_ADDR_FORMAT "lx" typedef unsigned long gst_imx_phys_addr_t; #endif
#ifndef GST_IMX_COMMON_PHYS_MEM_ADDR_H #define GST_IMX_COMMON_PHYS_MEM_ADDR_H #define GST_IMX_PHYS_ADDR_FORMAT "#lx" typedef unsigned long gst_imx_phys_addr_t; #endif
Add 0x prefix to phys mem addr printf conversion specifier
common: Add 0x prefix to phys mem addr printf conversion specifier Signed-off-by: Carlos Rafael Giani <[email protected]>
C
lgpl-2.1
Josuercuevas/gstreamer-imx,commshare/gstreamer-imx,Josuercuevas/gstreamer-imx,commshare/gstreamer-imx
d4f93813a98363ec5519ae1ebeeba7d9e55154ac
main.c
main.c
// This is the actual main program int main(int argc, const char *argv[]) { }
// This is the actual main program #include "lorito.h" #include "microcode.h" #include "interp.h" #include "loader.h" int main(int argc, const char *argv[]) { int i; Lorito_Interp *interp; if (argc < 2) { fprintf(stderr, "Usage: lorito <bytecodefiles>\n"); return 255; } interp = lorito_init(); for (i = 1; i < argc; i++) { loadbc(interp, argv[i]); } return lorito_run(interp); }
Add all the glue together to have an interpreter actually run.
Add all the glue together to have an interpreter actually run.
C
artistic-2.0
atrodo/lorito,atrodo/lorito
e9b5d3e4c0d690b50cc9a04b2aaec37381e22854
alura/c/forca.c
alura/c/forca.c
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); printf("%s\n", palavrasecreta); /* palavrasecreta[0] = 'M'; palavrasecreta[1] = 'E'; palavrasecreta[2] = 'L'; palavrasecreta[3] = 'A'; palavrasecreta[4] = 'N'; palavrasecreta[5] = 'C'; palavrasecreta[6] = 'I'; palavrasecreta[7] = 'A'; palavrasecreta[8] = '\0'; printf("%c%c%c%c%c%c%c%c\n", palavrasecreta[0], palavrasecreta[1], palavrasecreta[2], palavrasecreta[3], palavrasecreta[4], palavrasecreta[5], palavrasecreta[6], palavrasecreta[7]); */ }
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; do { // comecar o nosso jogo!! } while(!acertou && !enforcou); }
Update files, Alura, Introdução a C - Parte 2, Aula 2.3
Update files, Alura, Introdução a C - Parte 2, Aula 2.3
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
ec647d24eb10e22e3f54acc0e22c9a9b91a2b6f7
cc1/tests/test008.c
cc1/tests/test008.c
/* name: TEST008 description: Basic do while loop output: F1 G1 F1 main { - A2 I x A2 #I0 :I d L3 A2 A2 #I1 +I :I j L3 A2 #IA <I b L4 d L5 A2 A2 #I1 +I :I j L5 A2 #I14 <I b L6 yI A2 #I14 -I } */ int main() { int x; x = 0; do x = x + 1; while(x < 10); do { x = x + 1; } while(x < 20); return x - 20; }
Add basic test for do while statements
Add basic test for do while statements
C
mit
k0gaMSX/kcc,k0gaMSX/scc,8l/scc,k0gaMSX/scc,8l/scc,k0gaMSX/scc,8l/scc,k0gaMSX/kcc
a714c4de411c309937f64b47cc6cddca00bd8cf2
example/log_example.c
example/log_example.c
// cc log_example.c log.c -rdynamic #include "log.h" char make_segmentfault() { char *s = NULL; char ch = s[1]; // segment fault return ch; } int main(int argc, const char *argv[]) { /* open global logger to stderr (by setting filename to NULL) */ log_open("example", NULL, 0); /* set log level to info, also the default level */ log_setlevel(LOG_INFO); /* debug mesage won't be seen */ log_debug("debug message"); /* but info and warn, error message can be seen */ log_info("info message"); log_warn("warn message"); log_error("error message"); /* will log trace back on segmentfault automatically */ make_segmentfault(); return 0; }
// cc log_example.c log.c -rdynamic #include "log.h" char make_segmentfault() { char *s = NULL; char ch = s[1]; // segment fault return ch; } int main(int argc, const char *argv[]) { /* open global logger to stderr (by setting filename to NULL) */ log_open("example", NULL, 0); /* set log level to info, also the default level */ log_setlevel(LOG_INFO); /* debug mesage won't be seen */ log_debug("debug message"); /* but info and warn, error message can be seen */ log_info("info message"); log_warn("warn message"); log_error("error message: %s", "someting wrong"); /* will log trace back on segmentfault automatically */ make_segmentfault(); return 0; }
Add example for log with formatting args
Add example for log with formatting args
C
bsd-2-clause
hit9/C-Snip,hit9/C-Snip
abe29dda2ea228193d992dd4bb14aa475f717a41
thingc/execution/Opcode.h
thingc/execution/Opcode.h
#pragma once enum class Opcode { INVALID = 0, NOP = 1, PUSH = 2, PUSH_STATIC = 3, POP = 4, SET = 5, CALL = 6, CALL_METHOD = 7, CALL_INTERNAL = 8, RETURN = 9, PRINT = 10, METHOD_END = 11 };
#pragma once enum class Opcode { INVALID = 0, NOP = 1, PUSH = 2, // pushes a reference into the stack PUSH_STATIC = 3, // pushes static data into the stack POP = 4, // pop anything to void SET = 5, // pop a reference from the stack and assign it SET_STATIC = 6, // set a reference to static data CALL = 7, CALL_METHOD = 8, CALL_INTERNAL = 9, RETURN = 10, PRINT = 11, METHOD_END = 12 };
Add SET_STATIC opcode to enum
Add SET_STATIC opcode to enum
C
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
a63caaab3d00381da13c06c6efcc6c740acd0023
tests/bigfile2.c
tests/bigfile2.c
/* * 06/21/2016: bigfile2.c */ #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <stdlib.h> #include <unistd.h> main(int argc, char *argv[]) { long val; char *buf, *filename; int error = 0, readonly = 0; size_t i, j, c, fd, seed, size, bsize, nblocks; bsize = 5678; nblocks = 12345; seed = getpid(); while ((c = getopt(argc, argv, "b:s:n:r")) != -1) { switch (c) { case 'b': bsize = atoi(optarg); break; case 's': seed = atoi(optarg); break; case 'n': nblocks = atoi(optarg); break; case 'r': readonly = 1; break; } } if (optind > argc - 1) { printf("Usage: a.out [-s seed] [-b bsize] [-n nblocks ] filename\n"); exit(0); } filename = argv[optind]; if (readonly) fd = open(filename, O_RDONLY); else fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd < 0) { printf("Fail to open file, errno = %d\n", errno); exit(0); } buf = malloc(bsize); if (buf == NULL) { printf("Fail to allocate memory, errno = %d\n", errno); exit(0); } srandom(seed); printf("Seed = %d, file size = %ld\n", seed, nblocks * bsize); for (i = 0; i < nblocks; i++) { if (readonly) size = read(fd, buf, bsize); else { for (j = 0; j < bsize; j++) { val = random(); //printf("%lx\n", val); buf[j] = val & 0xff; } size = write(fd, buf, bsize); } if (size != bsize) { printf("Fail to %s file, errno = %d\n", readonly ? "read" : "write", errno); break; } if (!readonly) continue; for (j = 0; j < bsize; j++) { if (buf[j] != random() & 0xff) { printf("Unexpected data at offset = %ld\n", i * nblocks * j); error++; break; } } if (error > 20) break; } close(fd); }
Add a big file test
Add a big file test
C
isc
pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable
5344e1aff866658297912428255b7609d65d2cc0
src/main.c
src/main.c
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; for(F = 1; F < argc; F++) { // Load the file. FILE * fh = fopen(argv[F], "r"); // Instance the parser. verilog_parser parser = verilog_file_parse(fh); // Parse the file and store the result. int result = verilog_parse_buffer(parser); verilog_free_parser(parser); fclose(fh); if(result == 0) { printf("Parse successful for %s\n",argv[F]); } else { printf("Parse failed for %s\n",argv[F]); } } } return 0; }
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; for(F = 1; F < argc; F++) { printf("%s", argv[F]); fflush(stdout); // Load the file. FILE * fh = fopen(argv[F], "r"); // Instance the parser. verilog_parser parser = verilog_file_parse(fh); // Parse the file and store the result. int result = verilog_parse_buffer(parser); verilog_free_parser(parser); fclose(fh); if(result == 0) { printf(" - Parse successful\n"); } else { printf(" - Parse failed for\n"); } } } return 0; }
Print name of test before parsing it - easier to identify segfaulting tests. On branch master Your branch is up-to-date with 'github/master'.
Print name of test before parsing it - easier to identify segfaulting tests. On branch master Your branch is up-to-date with 'github/master'. Changes to be committed: modified: src/main.c Changes not staged for commit: modified: src/verilog_ast.c modified: src/verilog_ast.h modified: src/verilog_parser.y
C
mit
ben-marshall/verilog-parser,ben-marshall/verilog-parser,ben-marshall/verilog-parser
7170e354b9999cd3d19459f3b902287b6b329e6f
test/CodeGen/branch-on-bool.c
test/CodeGen/branch-on-bool.c
// RUN: %clang %s -O0 -emit-llvm -S -o - | FileCheck %s void foo(); void bar(); void fold_if(int a, int b) { // CHECK: define {{.*}} @fold_if( // CHECK-NOT: = phi // CHECK: } if (a && b) foo(); else bar(); } void fold_for(int a, int b) { // CHECK: define {{.*}} @fold_for( // CHECK-NOT: = phi // CHECK: } for (int i = 0; a && i < b; ++i) foo(); for (int i = 0; a || i < b; ++i) bar(); }
Test that simple expressions are simplified at -O0
CodeGen: Test that simple expressions are simplified at -O0 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@193995 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
78a7a88da94ee3e6972485ceca00be8519212025
mt.h
mt.h
#ifndef _MATH_MT_H_ #define _MATH_MT_H_ #if defined(_MSC_VER) && (_MSC_VER <= 1300) typedef unsigned __int32 uint32_t; #elif defined(__linux__) || defined(__GLIBC__) || defined(__WIN32__) #include <stdint.h> #elif defined(__osf__) #include <inttypes.h> #else #include <sys/types.h> #endif enum { N = 624, M = 397 }; struct mt { uint32_t mt[N]; int mti; }; struct mt *mt_setup(uint32_t seed); struct mt *mt_setup_array(uint32_t *array, int n); void mt_free(struct mt *self); double mt_genrand(struct mt *self); #endif
#ifndef _MATH_MT_H_ #define _MATH_MT_H_ #if defined(_MSC_VER) && (_MSC_VER <= 1300) typedef unsigned __int32 uint32_t; #elif defined(__linux__) || defined(__GLIBC__) || defined(__WIN32__) || defined(__APPLE__) #include <stdint.h> #elif defined(__osf__) #include <inttypes.h> #else #include <sys/types.h> #endif enum { N = 624, M = 397 }; struct mt { uint32_t mt[N]; int mti; }; struct mt *mt_setup(uint32_t seed); struct mt *mt_setup_array(uint32_t *array, int n); void mt_free(struct mt *self); double mt_genrand(struct mt *self); #endif
Fix OS X build failure
Fix OS X build failure
C
bsd-3-clause
amenonsen/Math-Random-MT,amenonsen/Math-Random-MT
36a0988c4468386c7d52d9c1ff4cc09b615f4bf9
bst.c
bst.c
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode)); n->left = NULL; n->right = NULL; n->p = NULL; n->k = k; } void BST_Inorder_Tree_Walk(BSTNode* n, void (f)(void*)) { if (n != NULL) { BST_Inorder_Tree_Walk(n->left, f); f(n->k); BST_Inorder_Tree_Walk(n->right, f); } }
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode)); n->left = NULL; n->right = NULL; n->p = NULL; n->k = k; } void BST_Inorder_Tree_Walk(BSTNode* n, void (f)(void*)) { if (n != NULL) { BST_Inorder_Tree_Walk(n->left, f); f(n->k); BST_Inorder_Tree_Walk(n->right, f); } } void BST_Preorder_Tree_Walk(BSTNode* n, void (f)(void*)) { if (n != NULL) { f(n->k); BST_Preorder_Tree_Walk(n->left, f); BST_Preorder_Tree_Walk(n->right, f); } }
Add BST preorder traversal function implementation
Add BST preorder traversal function implementation
C
mit
MaxLikelihood/CADT
287e9adfce378bf1beba3406d09fed0a8b72c433
lib/msun/src/w_cabs.c
lib/msun/src/w_cabs.c
/* * cabs() wrapper for hypot(). * * Written by J.T. Conklin, <[email protected]> * Placed into the Public Domain, 1994. */ #include <math.h> struct complex { double x; double y; }; double cabs(z) struct complex z; { return hypot(z.x, z.y); }
/* * cabs() wrapper for hypot(). * * Written by J.T. Conklin, <[email protected]> * Placed into the Public Domain, 1994. */ #include <math.h> struct complex { double x; double y; }; double cabs(z) struct complex z; { return hypot(z.x, z.y); } double z_abs(z) struct complex *z; { return hypot(z->x, z->y); }
Add missing z_abs. In BSD tradition this is in libm.a.
Add missing z_abs. In BSD tradition this is in libm.a.
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
2ceb17a890c54dd67c0078879b2aba9e726ec2c3
lambda/ol-init.c
lambda/ol-init.c
#include <unistd.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> char **params; // double fork to avoid zombies and exec the python server void signal_handler() { if (fork() == 0) { execv(params[0], params); } return; } int main(int argc, char *argv[]) { int k; params = (char**)malloc((3+argc-1)*sizeof(char*)); params[0] = "/usr/bin/python"; params[1] = "/server.py"; for (k = 1; k < argc; k++) { params[k+1] = argv[k]; } params[argc+1] = NULL; signal(SIGURG, signal_handler); while (1) { pause(); // sleep forever, we're init for the ns } return 0; }
#include <unistd.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> char **params; /* * Launch the lambda server. */ void signal_handler() { if (fork() == 0) { execv(params[0], params); } return; } /* * Install the handler and block all other signals while handling * the signal. Reset the signal handler after caught to default. */ void install_handler() { struct sigaction setup_action; sigset_t block_mask; sigfillset(&block_mask); setup_action.sa_handler = signal_handler; setup_action.sa_mask = block_mask; setup_action.sa_flags = SA_RESETHAND; sigaction(SIGURG, &setup_action, NULL); } int main(int argc, char *argv[]) { int k; params = (char**)malloc((3+argc-1)*sizeof(char*)); params[0] = "/usr/bin/python"; params[1] = "/server.py"; for (k = 1; k < argc; k++) { params[k+1] = argv[k]; } params[argc+1] = NULL; install_handler(); while (1) { pause(); // sleep forever, we're init for the ns } return 0; }
Use sigaction instead of signal
Use sigaction instead of signal Signal is not portable. It is better to use sigaction so we can also prevent other signals from interrupting us just in case.
C
apache-2.0
open-lambda/open-lambda,open-lambda/open-lambda,open-lambda/open-lambda,open-lambda/open-lambda,open-lambda/open-lambda
47ad5dcd384900b68596fa0cd93e8193d1af16fb
blocks/mdaqled.h
blocks/mdaqled.h
#ifndef __MDAQLED_H #define __MDAQLED_H #ifndef MATLAB_MEX_FILE #include "gpio.h" #endif void mdaqled_init(void); void mdaqled_set(unsigned char led, unsigned char state); #endif
#ifndef __MDAQLED_H #define __MDAQLED_H #if (!defined MATLAB_MEX_FILE) && (!defined MDL_REF_SIM_TGT) #include "gpio.h" #endif void mdaqled_init(void); void mdaqled_set(unsigned char led, unsigned char state); #endif
Make LED block compatible with PIL in model reference
Make LED block compatible with PIL in model reference
C
bsd-2-clause
kyak/microdaq_ert,kyak/microdaq_ert,kyak/microdaq_ert
a43d894adb388b3da6c3dc2ab467b022e4d52d05
cxl.c
cxl.c
#include <stdio.h> #include <string.h> #include <X11/Xlib.h> #include <X11/XKBlib.h> #include <X11/extensions/XKBrules.h> int main(int argc, char *argv[]) { Display *display = XOpenDisplay(NULL); XkbEvent event; XkbRF_VarDefsRec varDefs; XkbStateRec state; char *tmp = NULL; char *groups[XkbNumKbdGroups]; int num_groups = 0; XkbSelectEventDetails(display, XkbUseCoreKbd, XkbStateNotify, XkbGroupLockMask, XkbGroupLockMask); XkbRF_GetNamesProp(display, &tmp, &varDefs); groups[num_groups] = strtok(varDefs.layout, ","); printf("%s\r\n", groups[num_groups]); while(groups[num_groups]) { num_groups++; groups[num_groups] = strtok(NULL, ","); } XkbGetState(display, XkbUseCoreKbd, &state); while (1) { XNextEvent(display, &event.core); printf("%s\r\n", groups[event.state.locked_group]); } return XCloseDisplay(display); }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <X11/Xlib.h> #include <X11/XKBlib.h> #include <X11/extensions/XKBrules.h> #define DELIMETER "," #define LAYOUT_FORMAT "%s\r\n" int main(int argc, char *argv[]) { int rc = EXIT_FAILURE; XkbEvent event; XkbRF_VarDefsRec vd; XkbStateRec state; char *groups[XkbNumKbdGroups]; unsigned char num_groups = 0; char *display_name = NULL; Display *display = NULL; if (!(display = XOpenDisplay(display_name))) goto out; if (XkbSelectEventDetails(display, XkbUseCoreKbd, XkbStateNotify, XkbGroupLockMask, XkbGroupLockMask) != True) goto out_close_display; if (XkbRF_GetNamesProp(display, NULL, &vd) != True) goto out_close_display; while ((groups[num_groups] = strsep(&vd.layout, DELIMETER))) num_groups++; if (XkbGetState(display, XkbUseCoreKbd, &state) == Success) printf(LAYOUT_FORMAT, groups[state.locked_group]); while (1) if (XNextEvent(display, &event.core) == Success) printf(LAYOUT_FORMAT, groups[event.state.locked_group]); XFree(vd.model); XFree(vd.layout); XFree(vd.variant); XFree(vd.options); out_close_display: rc = XCloseDisplay(display); out: return rc; }
Return codes of XLib functions are handled
Return codes of XLib functions are handled Code formated to the K&R style. Added program exit code. All significant return codes for XLib functions are handled. Free resources allocated by XLib. However sigterm should be handled to get this actually working.
C
mit
panurg/cxl
7f3ce6f442512362e934b8b80b86b08fe7a3b319
ch05/ex5.c
ch05/ex5.c
/* Program that verifies that duplicated file descriptors share a file offset and open file status flags. */ #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <assert.h> void exitErr(const char* msg); int main(__attribute__((unused)) int _argc, __attribute__((unused)) char **argv) { int fd1, fd2, flagsBefore, flagsAfter; off_t offsetBefore, offsetAfter, offsetFd2; fd1 = open("example.txt", O_RDONLY); fd2 = dup(fd1); flagsBefore = fcntl(fd1, F_GETFL); if (flagsBefore == -1) exitErr("fcntl"); if (fcntl(fd2, F_SETFL, flagsBefore | O_APPEND) == -1) exitErr("fcntl"); flagsAfter = fcntl(fd1, F_GETFL); if (flagsAfter == -1) exitErr("fcntl"); assert(flagsBefore != flagsAfter); assert(flagsAfter & O_APPEND); offsetBefore = lseek(fd1, 0, SEEK_CUR); if (offsetBefore == -1) exitErr("lseek"); offsetFd2 = lseek(fd2, 10, SEEK_END); if (offsetFd2 == -1) exitErr("lseek"); offsetAfter = lseek(fd1, 0, SEEK_CUR); if (offsetAfter == -1) exitErr("lseek"); assert(offsetAfter != offsetBefore); assert(offsetAfter == offsetFd2); exit(EXIT_SUCCESS); } void exitErr(const char *msg) { perror(msg); exit(EXIT_FAILURE); }
Add fifth exercise from chapter 5.
Add fifth exercise from chapter 5.
C
mit
carlosgaldino/lpi
30d230d81df0a41cff6841dafa96b10bf00b3251
obexd/plugins/ebook.c
obexd/plugins/ebook.c
/* * * OBEX Server * * Copyright (C) 2007-2008 Marcel Holtmann <[email protected]> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <plugin.h> #include <logging.h> #include <libebook/e-book.h> static int ebook_init(void) { DBG(""); return 0; } static void ebook_exit(void) { DBG(""); } OBEX_PLUGIN_DEFINE("ebook", ebook_init, ebook_exit)
Add skeleton for EBook plugin
obexd: Add skeleton for EBook plugin
C
lgpl-2.1
mapfau/bluez,pkarasev3/bluez,pkarasev3/bluez,mapfau/bluez,ComputeCycles/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,mapfau/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,silent-snowman/bluez,mapfau/bluez,silent-snowman/bluez,pkarasev3/bluez,pkarasev3/bluez,ComputeCycles/bluez,ComputeCycles/bluez
29078e0cee0384fd8f8863257491ef3cfdea8dfb
src/iterator.h
src/iterator.h
#ifndef ITERATOR_H #define ITERATOR_H struct iterator { size_t index; void *iterable; void *current; void *(*next)(struct iterator *this); void (*destroy)(struct iterator *this); }; struct iterator *iterator_create(void *iterable, void *(*next)(struct iterator *)); void iterator_destroy(struct iterator *this); #endif
#ifndef ITERATOR_H #define ITERATOR_H #include <stdlib.h> struct iterator { size_t index; void *iterable; void *current; void *(*next)(struct iterator *this); void (*destroy)(struct iterator *this); }; struct iterator *iterator_create(void *iterable, void *(*next)(struct iterator *)); void iterator_destroy(struct iterator *this); #endif
Include stdlib to get size_t.
Include stdlib to get size_t.
C
mit
dgraham/libds,dgraham/libds
956c6edde28a3b60981059caf7a8bad137f76336
src/condor_includes/carmipro.h
src/condor_includes/carmipro.h
#if !defined(_CARMIPRO_H) #define _CARMIPRO_H #include "pvmsdpro.h" #define CARMI_FIRST (SM_LAST+1) #define CARMI_RESPAWN (CARMI_FIRST+1) #define CARMI_CHKPT (CARMI_FIRST+2) #define CARMI_ADDHOST (CARMI_FIRST+3) #endif
#if !defined(_CARMIPRO_H) #define _CARMIPRO_H #include "pvmsdpro.h" #define CARMI_FIRST (SM_LAST+1) #define CARMI_RESPAWN (CARMI_FIRST+1) #define CARMI_CHKPT (CARMI_FIRST+2) #define CARMI_ADDHOST (CARMI_FIRST+3) #define CARMI_SPAWN (CARMI_FIRST+4) #define CARMI_CKPT_ON_VACATE (CARMI_FIRST + 5) #define CARMI_LAST (CARMI_CKPT_ON_VACATE) #define CO_CHECK_FIRST (CARMI_LAST+1) #define CO_CHECK_SIMPLE_CKPT_TASK_TO_FILE (CO_CHECK_FIRST + 1) #define CO_CHECK_RESTART_TASK_FROM_FILE (CO_CHECK_FIRST + 2) #define CO_CHECK_SIMPLE_CKPT_TASK (CO_CHECK_FIRST + 3) #define CO_CHECK_RESTART_TASK (CO_CHECK_FIRST + 4) #define CO_CHECK_SIMPLE_MIGRATE_TASK_TO_HOST (CO_CHECK_FIRST + 5) #define CO_CHECK_SIMPLE_MIGRATE_TASK (CO_CHECK_FIRST + 6) #endif
Define a whole bunch of new message tags for checkpoint and migration functions.
Define a whole bunch of new message tags for checkpoint and migration functions.
C
apache-2.0
zhangzhehust/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,htcondor/htcondor,djw8605/condor,djw8605/condor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,djw8605/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/condor,zhangzhehust/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,htcondor/htcondor
c831a822bf7a6a3b08ab8584a6db8d6cad567987
main.c
main.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <mkdio.h> float main(int argc, char **argv) { int opt; int debug = 0; char *ofile = 0; extern char version[]; opterr = 1; while ( (opt=getopt(argc, argv, "do:V")) != EOF ) { switch (opt) { case 'd': debug = 1; break; case 'V': printf("markdown %s\n", version); exit(0); case 'o': if ( ofile ) { fprintf(stderr, "Too many -o options\n"); exit(1); } if ( !freopen(ofile = optarg, "w", stdout) ) { perror(ofile); exit(1); } break; default: fprintf(stderr, "usage: markdown [-V] [-o file] [file]\n"); exit(1); } } argc -= optind; argv += optind; if ( argc && !freopen(argv[0], "r", stdin) ) { perror(argv[0]); exit(1); } if ( debug ) mkd_dump(mkd_in(stdin), stdout, 0); else markdown(mkd_in(stdin), stdout, 0); exit(0); }
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <mkdio.h> float main(int argc, char **argv) { int opt; int debug = 0; char *ofile = 0; extern char version[]; opterr = 1; while ( (opt=getopt(argc, argv, "do:V")) != EOF ) { switch (opt) { case 'd': debug = 1; break; case 'V': printf("markdown %s\n", version); exit(0); case 'o': if ( ofile ) { fprintf(stderr, "Too many -o options\n"); exit(1); } if ( !freopen(ofile = optarg, "w", stdout) ) { perror(ofile); exit(1); } break; default: fprintf(stderr, "usage: markdown [-dV] [-o file] [file]\n"); exit(1); } } argc -= optind; argv += optind; if ( argc && !freopen(argv[0], "r", stdin) ) { perror(argv[0]); exit(1); } if ( debug ) mkd_dump(mkd_in(stdin), stdout, 0); else markdown(mkd_in(stdin), stdout, 0); exit(0); }
Put the -d option into the usage: message
Put the -d option into the usage: message
C
bsd-3-clause
binki/discount,binki/discount,binki/discount,OliverLetterer/discount,davidfstr/discount,binki/discount,OliverLetterer/discount,gm2bv/discount,davidfstr/discount,gm2bv/discount,davidfstr/discount,davidfstr/discount,binki/discount,gm2bv/discount,OliverLetterer/discount,gm2bv/discount
178691e163ee60902dc23f3de2b8be73b86a2473
src/modules/cameraautoswitch.h
src/modules/cameraautoswitch.h
/* * cameraautoswitch.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #include "igameevents.h" #include "../modules.h" class CCommand; class ConCommand; class ConVar; class IConVar; class CameraAutoSwitch : public Module, IGameEventListener2 { public: CameraAutoSwitch(); static bool CheckDependencies(); virtual void FireGameEvent(IGameEvent *event); private: class Panel; Panel *panel; ConVar *enabled; ConVar *killer; ConVar *killer_delay; void ToggleEnabled(IConVar *var, const char *pOldValue, float flOldValue); void ToggleKillerEnabled(IConVar *var, const char *pOldValue, float flOldValue); };
/* * cameraautoswitch.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #pragma once #include "igameevents.h" #include "../modules.h" class CCommand; class ConCommand; class ConVar; class IConVar; class CameraAutoSwitch : public Module, IGameEventListener2 { public: CameraAutoSwitch(); static bool CheckDependencies(); virtual void FireGameEvent(IGameEvent *event); private: class Panel; Panel *panel; ConVar *enabled; ConVar *killer; ConVar *killer_delay; void ToggleEnabled(IConVar *var, const char *pOldValue, float flOldValue); void ToggleKillerEnabled(IConVar *var, const char *pOldValue, float flOldValue); };
Add pragma once to camera auto switch header.
Add pragma once to camera auto switch header.
C
bsd-2-clause
fwdcp/StatusSpec,fwdcp/StatusSpec
f4fca963a2ef0914bd4142a772cefc76f9e75956
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); if(chute == numerosecreto) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { 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; printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); if(chute == numerosecreto) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { if(chute > numerosecreto) { printf("Seu chute foi maior que o número secreto\n"); } if(chute < numerosecreto) { printf("Seu chute foi menor que o número secreto\n"); } printf("Você errou!\n"); printf("Mas não desanime, tente de novo!\n"); } }
Update files, Alura, Introdução a C, Aula 2.2
Update files, Alura, Introdução a C, Aula 2.2
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
cca85848f87ed67700301736f1bbd03e6298f65d
Wikipedia/Code/WikiGlyph_Chars.h
Wikipedia/Code/WikiGlyph_Chars.h
#define WIKIGLYPH_FORWARD @"\ue954" #define WIKIGLYPH_BACKWARD @"\ue955" #define WIKIGLYPH_DOWN @"\ue956" #define WIKIGLYPH_X @"\ue95e" #define WIKIGLYPH_FLAG @"\ue963" #define WIKIGLYPH_USER_SMILE @"\ue964" #define WIKIGLYPH_USER_SLEEP @"\ue965" #define WIKIGLYPH_CC @"\ue969" #define WIKIGLYPH_CITE @"\ue96b" #define WIKIGLYPH_PUBLIC_DOMAIN @"\ue96c"
#define WIKIGLYPH_X @"\ue95e" #define WIKIGLYPH_FLAG @"\ue963" #define WIKIGLYPH_USER_SMILE @"\ue964" #define WIKIGLYPH_USER_SLEEP @"\ue965" #define WIKIGLYPH_CC @"\ue969" #define WIKIGLYPH_PUBLIC_DOMAIN @"\ue96c"
Remove unused glyph font defines.
Remove unused glyph font defines.
C
mit
wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios
b1529393f0a4660def88e2e3df1d34446ebc48ff
Operator.h
Operator.h
/*===- Operator.h - libSimulation -============================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef OPERATOR_H #define OPERATOR_H #include "Cloud.h" class Operator { public: Cloud * const cloud; Operator(Cloud * const myCloud) : cloud(myCloud) {} virtual ~Operator() {} virtual void operation1(const double currentTime)=0; virtual void operation2(const double currentTime)=0; virtual void operation3(const double currentTime)=0; virtual void operation4(const double currentTime)=0; }; #endif // OPERATOR_H
/*===- Operator.h - libSimulation -============================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef OPERATOR_H #define OPERATOR_H #include "Cloud.h" typedef unsigned int operator_index; class Operator { public: Cloud * const cloud; Operator(Cloud * const myCloud) : cloud(myCloud) {} virtual ~Operator() {} virtual void operation1(const double currentTime)=0; virtual void operation2(const double currentTime)=0; virtual void operation3(const double currentTime)=0; virtual void operation4(const double currentTime)=0; }; #endif // OPERATOR_H
Add typedef to number of operators. This will help inside code to distinguish from counting particles, forces or operators.
Add typedef to number of operators. This will help inside code to distinguish from counting particles, forces or operators.
C
bsd-3-clause
leios/demonsimulationcode,leios/demonsimulationcode
98d00bb62b0eeee60e204babad8c3a090521d4d9
cmd/smyrna/filter.h
cmd/smyrna/filter.h
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifndef FILTER_H #define FILTER_H #include "btree.h" typedef struct _tv_filters { tv_filter** filters; int filter_count; }tv_filters; int clear_filter(tv_filter* f); int init_filters(tv_filters* filters); int add_filter_to_filters(tv_filters* filters,tv_filter* filter); int clear_filters(tv_filters* filters); int union_filter(tv_filter* f1,tv_filter* f2); int intersect_filter(tv_filter* f1,tv_filter* f2); #endif
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifndef FILTER_H #define FILTER_H #include "btree.h" typedef struct _tv_filters { tv_filter **filters; int filter_count; } tv_filters; int clear_filter(tv_filter * f); int init_filters(tv_filters * filters); int add_filter_to_filters(tv_filters * filters, tv_filter * filter); int clear_filters(tv_filters * filters); int union_filter(tv_filter * f1, tv_filter * f2); int intersect_filter(tv_filter * f1, tv_filter * f2); #endif
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings
C
epl-1.0
kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,ellson/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,kbrock/graphviz,jho1965us/graphviz,jho1965us/graphviz,tkelman/graphviz,pixelglow/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,kbrock/graphviz,ellson/graphviz,MjAbuz/graphviz,kbrock/graphviz,BMJHayward/graphviz,pixelglow/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,MjAbuz/graphviz,pixelglow/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,jho1965us/graphviz,ellson/graphviz,jho1965us/graphviz,kbrock/graphviz,MjAbuz/graphviz,jho1965us/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,pixelglow/graphviz,BMJHayward/graphviz,pixelglow/graphviz,jho1965us/graphviz,tkelman/graphviz,tkelman/graphviz,kbrock/graphviz,ellson/graphviz,jho1965us/graphviz,pixelglow/graphviz,jho1965us/graphviz,tkelman/graphviz,jho1965us/graphviz,ellson/graphviz,kbrock/graphviz,ellson/graphviz,MjAbuz/graphviz,kbrock/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,ellson/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,pixelglow/graphviz,kbrock/graphviz,pixelglow/graphviz,tkelman/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,MjAbuz/graphviz,tkelman/graphviz,tkelman/graphviz,MjAbuz/graphviz,ellson/graphviz,jho1965us/graphviz,BMJHayward/graphviz
9fcb875470185cd1e5635c9001cc36b5aad8ca7a
testing/test_rocks.c
testing/test_rocks.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <glib.h> #include "cem/rocks.h" static void test_set_rock_blocks(void) { const int shape[2] = {10, 20}; double **z = (double**)malloc(sizeof(double*) * shape[0]); char **rock_type = (char**)malloc(sizeof(char*) * shape[0]); int i; char expected[20] = { 'f', 'f', 's', 's', 's', 'f', 'f', 's', 's', 's', 'f', 'f', 's', 's', 's', 'f', 'f', 's', 's', 's' }; z[0] = (double*)malloc(sizeof(double) * shape[0] * shape[1]); rock_type[0] = (char*)malloc(sizeof(char) * shape[0] * shape[1]); for (i=1; i < shape[0]; i++) { z[i] = z[i-1] + shape[1]; rock_type[i] = rock_type[i-1] + shape[1]; } set_rock_blocks(rock_type, z, shape[0], shape[1], 2); for (i=0; i < shape[0]; i++) g_assert_cmpmem(rock_type[i], shape[1], expected, shape[1]); free(rock_type[0]); free(rock_type); free(z[0]); free(z); } int main(int argc, char* argv[]) { g_test_init(&argc, &argv, NULL); g_test_add_func("/cem/rocks/set_blocks", &test_set_rock_blocks); return g_test_run(); }
Add unit tests for rocks.c.
Add unit tests for rocks.c.
C
mit
csdms-contrib/cem
a643c5fe60f459802f071e48fb5eeaca4cf7ac4b
src/tests/marquise_hash_test.c
src/tests/marquise_hash_test.c
#include <glib.h> #include <stdlib.h> #include <string.h> #include "../marquise.h" void test_hash_identifier() { const char *id = "hostname:fe1.example.com,metric:BytesUsed,service:memory,"; size_t id_len = strlen(id); uint64_t address = marquise_hash_identifier(id, id_len); g_assert_cmpint(address, ==, 7602883380529707052); } int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); g_test_add_func("/marquise_hash_identifier/hash", test_hash_identifier); return g_test_run(); }
#include <glib.h> #include <stdlib.h> #include <string.h> #include "../marquise.h" void test_hash_identifier() { const char *id = "hostname:fe1.example.com,metric:BytesUsed,service:memory,"; size_t id_len = strlen(id); uint64_t address = marquise_hash_identifier((const unsigned char*) id, id_len); g_assert_cmpint(address, ==, 7602883380529707052); } int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); g_test_add_func("/marquise_hash_identifier/hash", test_hash_identifier); return g_test_run(); }
Make a pointer-signedness warning in testing magically disappear~
Make a pointer-signedness warning in testing magically disappear~
C
bsd-3-clause
anchor/libmarquise,anchor/libmarquise
0ff744dd3c9c3853e35cb7c7e2fe46be8a6e0eaf
include-cpp/RSImg.h
include-cpp/RSImg.h
#ifndef __RSImg_h__ #define __RSImg_h__ #include <stdint.h> #include <stdio.h> extern "C" int RSImgFreadPPMP6Header(FILE *file, uint32_t *width, uint32_t *height, uint32_t *headerSize); #endif
Add a header for use from C++
Add a header for use from C++
C
mit
ReclaimSoftware/RSImg,ReclaimSoftware/RSImg
c33f2beda7b6ff05e87d3fd828d0370e21b9debc
http.h
http.h
#ifndef http_h #define http_h typedef struct http_context_s http_context; typedef struct http_session_s http_session; typedef struct http_request_s http_request; /* * A Context is bound to a collection of sessions and * ongoing requests. Each thread in a process should have its * own Context to avoid deadlocks and conflicts. */ http_context* http_context_create(); void http_context_release(http_context* ctx); /* * A session represents an active communication line to a server. * One or more network sockets may be open to the server to * fulfill requests. Pipelining will be used if supported by server. */ http_session* http_session_open(http_context* ctx, const char* host, int port); void http_session_close(http_session* session); http_request* http_request_create(http_session* session, const char* path, http_method method); http_request* http_request_get(http_session* session, const char* path); http_request* http_request_post(http_session* session, const char* path); #endif
Add primary header with initial API draft.
Add primary header with initial API draft.
C
mit
joshthecoder/libhttp
10b5311070496ada127c5f4a4119a6ab9d1baaec
main.c
main.c
//codigo para hecer pruebas de como funciona github. //programa simple que suma, resta, multiplica y divide numeros ingresador por pantalla. #include <stdio.h> #include <stdlib.h> void sumar(int a, int b); void restar(int a,int b); int main() { int a,b; printf("Bienvenido... Ingrese 2 numeros"); printf ("Primer numero: "); scanf ("%d",&a); printf ("Segundo numero: "); scanf ("%d",&b); sumar(a,b); restar(a,b); //implementar resta, multiplicacion, division return (EXIT_SUCCESS); } void restar(int a,int b){ printf("La resta es: %d",a-b); } void sumar(int a, int b){ printf ("La suma es: %d",a+b); }
//codigo para hecer pruebas de como funciona github. //programa simple que suma, resta, multiplica y divide numeros ingresador por pantalla. #include <stdio.h> #include <stdlib.h> void sumar(int a, int b); void restar(int a,int b); int main() { int a,b; printf ("Primer numero: "); scanf ("%d",&a); printf ("Segundo numero: "); scanf ("%d",&b); sumar(a,b); restar(a,b); //implementar resta, multiplicacion, division return (EXIT_SUCCESS); } void restar(int a,int b){ print("La resta es: %d",a-b); } void sumar(int a, int b){ printf ("La suma es: %d",a+b); }
Revert "Corregido Error en Funcion restar"
Revert "Corregido Error en Funcion restar" This reverts commit d8e984f0ea7d12526e1069292ed85025178d8d67.
C
unlicense
jcruz1/ProyectoSIIGrupo2
4f36797fb368cc30a648ed0a313b6f4ad6cb3927
src/config.h
src/config.h
#ifndef SRC_CONFIG_H_S6A1C09K #define SRC_CONFIG_H_S6A1C09K /* package name */ #define PACKAGE "pianobar" #define VERSION "2014.06.08-dev" /* ffmpeg/libav quirks detection * ffmpeg’s micro versions always start at 100, that’s how we can distinguish * ffmpeg and libav */ #include <libavfilter/version.h> /* is "timeout" option present (all versions of ffmpeg, not libav) */ #if LIBAVFILTER_VERSION_MICRO >= 100 #define HAVE_AV_TIMEOUT #endif /* does graph_send_command exist (ffmpeg >=2.2) */ #if LIBAVFILTER_VERSION_MAJOR == 4 && \ LIBAVFILTER_VERSION_MICRO >= 100 #define HAVE_AVFILTER_GRAPH_SEND_COMMAND #endif /* need avcodec.h (ffmpeg 1.2) */ #if LIBAVFILTER_VERSION_MAJOR == 3 && \ LIBAVFILTER_VERSION_MINOR <= 42 && \ LIBAVFILTER_VERSION_MINOR > 32 && \ LIBAVFILTER_VERSION_MICRO >= 100 #define HAVE_AV_BUFFERSINK_GET_BUFFER_REF #define HAVE_LIBAVFILTER_AVCODEC_H #endif #endif /* SRC_CONFIG_H_S6A1C09K */
#ifndef SRC_CONFIG_H_S6A1C09K #define SRC_CONFIG_H_S6A1C09K /* package name */ #define PACKAGE "pianobar" #define VERSION "2014.06.08-dev" /* ffmpeg/libav quirks detection * ffmpeg’s micro versions always start at 100, that’s how we can distinguish * ffmpeg and libav */ #include <libavfilter/version.h> /* is "timeout" option present (all versions of ffmpeg, not libav) */ #if LIBAVFILTER_VERSION_MICRO >= 100 #define HAVE_AV_TIMEOUT #endif /* does graph_send_command exist (ffmpeg >=2.2) */ #if LIBAVFILTER_VERSION_MAJOR >= 4 && \ LIBAVFILTER_VERSION_MICRO >= 100 #define HAVE_AVFILTER_GRAPH_SEND_COMMAND #endif /* need avcodec.h (ffmpeg 1.2) */ #if LIBAVFILTER_VERSION_MAJOR == 3 && \ LIBAVFILTER_VERSION_MINOR <= 42 && \ LIBAVFILTER_VERSION_MINOR > 32 && \ LIBAVFILTER_VERSION_MICRO >= 100 #define HAVE_AV_BUFFERSINK_GET_BUFFER_REF #define HAVE_LIBAVFILTER_AVCODEC_H #endif #endif /* SRC_CONFIG_H_S6A1C09K */
Fix volume control with ffmpeg 2.3
Fix volume control with ffmpeg 2.3
C
mit
DavidZemon/pianobar,gnowxilef/pianobar,DavidZemon/pianobar,tchajed/pianobar,gnowxilef/pianobar,twahlfeld/pianobar,tchajed/pianobar,johnso51/pianobar,johnso51/pianobar,gnowxilef/pianobar,tchajed/pianobar,twahlfeld/pianobar,johnso51/pianobar,tchajed/pianobar,DavidZemon/pianobar,DavidZemon/pianobar,gnowxilef/pianobar,johnso51/pianobar,gnowxilef/pianobar,johndeeney/pianobar,DavidZemon/pianobar,bmbove/pianobar-save,johndeeney/pianobar,johndeeney/pianobar,tchajed/pianobar,johnso51/pianobar,twahlfeld/pianobar,bmbove/pianobar-save,twahlfeld/pianobar,twahlfeld/pianobar,johnso51/pianobar,twahlfeld/pianobar,bmbove/pianobar-save,johndeeney/pianobar,gnowxilef/pianobar,tchajed/pianobar,bmbove/pianobar-save,DavidZemon/pianobar,johndeeney/pianobar,johndeeney/pianobar,bmbove/pianobar-save
d3b529bb914c70773c1218fe5b85e9738e66ad4b
Pod/Classes/BFTaskCenter.h
Pod/Classes/BFTaskCenter.h
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import "Bolts.h" @interface BFTaskCenter : NSObject /*! A block that can act as a continuation for a task. */ typedef void (^BFTaskCenterBlock)(BFTask * _Nonnull task); + (nonnull instancetype)defaultCenter; - (instancetype)initWithExecutor:(BFExecutor *)executor; - (nullable id)addTaskBlockToCallbacks:(nonnull BFTaskCenterBlock)taskBlock forKey:(nonnull NSString *)key; - (void)removeTaskBlock:(nonnull id)taskBlock forKey:(nonnull NSString *)key; - (void)clearAllCallbacksForKey:(nonnull NSString *)key; - (void)sendToCallbacksWithKey:(nonnull NSString *)key result:(nullable id)result; - (void)sendToCallbacksWithKey:(nonnull NSString *)key error:(nonnull NSError *)error; - (nullable BFTaskCompletionSource *)sourceOfSendToCallbacksForKey:(nonnull NSString *)key executor:(nonnull BFExecutor *)executor cancellationToken:(nullable BFCancellationToken *)cancellationToken; @end
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import "Bolts.h" NS_ASSUME_NONNULL_BEGIN @interface BFTaskCenter : NSObject /*! A block that can act as a continuation for a task. */ typedef void (^BFTaskCenterBlock)(BFTask * _Nonnull task); + (instancetype)defaultCenter; - (instancetype)initWithExecutor:(nonnull BFExecutor *)executor; - (nullable id)addTaskBlockToCallbacks:(nonnull BFTaskCenterBlock)taskBlock forKey:(nonnull NSString *)key; - (void)removeTaskBlock:(nonnull id)taskBlock forKey:(nonnull NSString *)key; - (void)clearAllCallbacksForKey:(nonnull NSString *)key; - (void)sendToCallbacksWithKey:(nonnull NSString *)key result:(nullable id)result; - (void)sendToCallbacksWithKey:(nonnull NSString *)key error:(nonnull NSError *)error; - (nullable BFTaskCompletionSource *)sourceOfSendToCallbacksForKey:(nonnull NSString *)key executor:(nonnull BFExecutor *)executor cancellationToken:(nullable BFCancellationToken *)cancellationToken; @end NS_ASSUME_NONNULL_END
Fix compiler warning for nullable check
Fix compiler warning for nullable check
C
mit
Superbil/BFTaskCenter,Superbil/BFTaskCenter
e7139c902072bcfb4a404c0fcfb91f34dd1e129f
src/cal3d/color.h
src/cal3d/color.h
#pragma once #include "cal3d/global.h" #include "cal3d/vector.h" typedef unsigned long CalColor32; // 32-bit integer, compatible with NSPR inline CalColor32 CalMakeColor(CalVector cv) { return ( ( unsigned int ) ( cv.z * 0xff ) << 0) + ( ( ( unsigned int ) ( cv.y * 0xff ) ) << 8 ) + ( ( ( unsigned int ) ( cv.x * 0xff ) ) << 16 ) + 0xff000000; } inline CalVector CalVectorFromColor(CalColor32 color) { return CalVector( ((color >> 16) & 0xff) / float(0xff), ((color >> 8) & 0xff) / float(0xff), ((color >> 0) & 0xff) / float(0xff)); }
#pragma once #include "cal3d/global.h" #include "cal3d/vector.h" typedef unsigned int CalColor32; // 32-bit integer, compatible with NSPR inline CalColor32 CalMakeColor(CalVector cv) { return ( ( unsigned int ) ( cv.z * 0xff ) << 0) + ( ( ( unsigned int ) ( cv.y * 0xff ) ) << 8 ) + ( ( ( unsigned int ) ( cv.x * 0xff ) ) << 16 ) + 0xff000000; } inline CalVector CalVectorFromColor(CalColor32 color) { return CalVector( ((color >> 16) & 0xff) / float(0xff), ((color >> 8) & 0xff) / float(0xff), ((color >> 0) & 0xff) / float(0xff)); }
Unify and simplify a lot of pixomatic code
Unify and simplify a lot of pixomatic code git-svn-id: febc42a3fd39fb08e5ae2b2182bc5ab0a583559c@51002 07c76cb3-cb09-0410-85de-c24d39f1912e
C
lgpl-2.1
imvu/cal3d,imvu/cal3d,imvu/cal3d,imvu/cal3d
8409e82310159111f2a01d65af58514adda6fe8a
IntelFrameworkPkg/Include/Common/FrameworkFirmwareVolumeImageFormat.h
IntelFrameworkPkg/Include/Common/FrameworkFirmwareVolumeImageFormat.h
/** @file This file defines the data structures that are architecturally defined for file images loaded via the FirmwareVolume protocol. The Firmware Volume specification is the basis for these definitions. Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: FrameworkFimrwareVolumeImageFormat.h @par Revision Reference: These definitions are from Firmware Volume Spec 0.9. **/ #ifndef __FRAMEWORK_FIRMWARE_VOLUME_IMAGE_FORMAT_H__ #define __FRAMEWORK_FIRMWARE_VOLUME_IMAGE_FORMAT_H__ // // Bit values for AuthenticationStatus // #define EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE 0x000001 #define EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED 0x000002 #define EFI_AGGREGATE_AUTH_STATUS_NOT_TESTED 0x000004 #define EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED 0x000008 #define EFI_AGGREGATE_AUTH_STATUS_ALL 0x00000f #define EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE 0x010000 #define EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED 0x020000 #define EFI_LOCAL_AUTH_STATUS_NOT_TESTED 0x040000 #define EFI_LOCAL_AUTH_STATUS_TEST_FAILED 0x080000 #define EFI_LOCAL_AUTH_STATUS_ALL 0x0f0000 #endif
Add some definitions in Framework FV 0.9 spec but not in PI 1.0.
Add some definitions in Framework FV 0.9 spec but not in PI 1.0. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@2901 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
fbff55718ba32fc5f63c71f4251a679093ec2a44
include/YAnimated.h
include/YAnimated.h
#ifndef __YANIMATED__ #define __YANIMATED__ typedef struct YFrame { int current; int first; int last; int width; int height; int fps; YFrame(){}; YFrame(int a_current, int a_first, int a_last, int a_width, int a_height, int a_fps): current(a_current), first(a_first), last(a_last), width(a_width), height(a_height), fps(a_fps){}; } YFrame; #endif /** __YANIMATED__ **/
#ifndef __YANIMATED__ #define __YANIMATED__ /*! Store animation frame indexes */ typedef struct YFrame { //! Default Constructor YFrame(): current(0), first(0), last(0){}; //! Constructor with parameters /*! \param Current animation frame index \param First animation frame index \param Last animation frame index */ YFrame(int a_current, int a_first, int a_last): current(a_current), first(a_first), last(a_last){}; int current; //! Current frame index int first; //! First frame index int last; //! Last frame index } YFrame; #endif /** __YANIMATED__ **/
Remove width, height and fps variable from YFrame struct
Remove width, height and fps variable from YFrame struct
C
mit
sergiosvieira/yda,sergiosvieira/yda,sergiosvieira/yda
8750ff3b93535fbc009ad535d3b9234b566c4d35
include/data_type.h
include/data_type.h
/* * Use and distribution licensed under the Apache license version 2. * * See the COPYING file in the root project directory for full text. */ #ifndef SQLTOAST_DATA_TYPE_H #define SQLTOAST_DATA_TYPE_H namespace sqltoast { typedef enum data_type { DATA_TYPE_CHAR, DATA_TYPE_VARCHAR, DATA_TYPE_NCHAR, DATA_TYPE_VARNCHAR, DATA_TYPE_BIT, DATA_TYPE_VARBIT, DATA_TYPE_NUMERIC, DATA_TYPE_DECIMAL, DATA_TYPE_INT, DATA_TYPE_SMALLINT, DATA_TYPE_FLOAT, DATA_TYPE_DOUBLE, DATA_TYPE_DATE, DATA_TYPE_TIME, DATA_TYPE_TIMESTAMP, DATA_TYPE_INTERVAL } data_type_t; } // namespace sqltoast #endif /* SQLTOAST_DATA_TYPE_H */
Add standard ANSI-92 data types
Add standard ANSI-92 data types
C
apache-2.0
jaypipes/sqltoast,jaypipes/sqltoast
d0172776eac403c0f4df9da1bc99f00321449266
src/timestamps.h
src/timestamps.h
#ifndef BITCOIN_TIMESTAMPS_H #define BITCOIN_TIMESTAMPS_H static const unsigned int ENTROPY_SWITCH_TIME = 1362791041; // Sat, 09 Mar 2013 01:04:01 GMT static const unsigned int STAKE_SWITCH_TIME = 1371686400; // Thu, 20 Jun 2013 00:00:00 GMT static const unsigned int TARGETS_SWITCH_TIME = 1374278400; // Sat, 20 Jul 2013 00:00:00 GMT static const unsigned int CHAINCHECKS_SWITCH_TIME = 1379635200; // Fri, 20 Sep 2013 00:00:00 GMT static const unsigned int STAKECURVE_SWITCH_TIME = 1382227200; // Sun, 20 Oct 2013 00:00:00 GMT static const unsigned int FEE_SWITCH_TIME = 1405814400; // Sun, 20 Jul 2014 00:00:00 GMT static const unsigned int VALIDATION_SWITCH_TIME = 1408492800; // Wed, 20 Aug 2014 00:00:00 GMT #endif
#ifndef BITCOIN_TIMESTAMPS_H #define BITCOIN_TIMESTAMPS_H static const unsigned int ENTROPY_SWITCH_TIME = 1362791041; // Sat, 09 Mar 2013 01:04:01 GMT static const unsigned int STAKE_SWITCH_TIME = 1371686400; // Thu, 20 Jun 2013 00:00:00 GMT static const unsigned int TARGETS_SWITCH_TIME = 1374278400; // Sat, 20 Jul 2013 00:00:00 GMT static const unsigned int CHAINCHECKS_SWITCH_TIME = 1379635200; // Fri, 20 Sep 2013 00:00:00 GMT static const unsigned int STAKECURVE_SWITCH_TIME = 1382227200; // Sun, 20 Oct 2013 00:00:00 GMT static const unsigned int FEE_SWITCH_TIME = 1405814400; // Sun, 20 Jul 2014 00:00:00 GMT static const unsigned int VALIDATION_SWITCH_TIME = 1408492800; // Wed, 20 Aug 2014 00:00:00 GMT static const unsigned int SIG_SWITCH_TIME = 1411171200; // Sat, 20 Sep 2014 00:00:00 GMT #endif
Add SIG_SWITCH_TIME at Sat, 20 Sep 2014
Add SIG_SWITCH_TIME at Sat, 20 Sep 2014
C
mit
novacoin-project/novacoin,stamhe/novacoin,stamhe/novacoin,stamhe/novacoin,penek/novacoin,gades/novacoin,novacoin-project/novacoin,elambert2014/novacoin,fsb4000/novacoin,penek/novacoin,fsb4000/novacoin,fsb4000/novacoin,stamhe/novacoin,byncoin-project/byncoin,byncoin-project/byncoin,elambert2014/novacoin,byncoin-project/byncoin,elambert2014/novacoin,elambert2014/novacoin,byncoin-project/byncoin,fsb4000/novacoin,penek/novacoin,gades/novacoin,elambert2014/novacoin,fsb4000/novacoin,gades/novacoin,gades/novacoin,penek/novacoin,novacoin-project/novacoin,byncoin-project/byncoin,novacoin-project/novacoin,stamhe/novacoin,penek/novacoin,gades/novacoin,gades/novacoin,novacoin-project/novacoin,novacoin-project/novacoin,fsb4000/novacoin,elambert2014/novacoin,byncoin-project/byncoin,penek/novacoin
d69e026a523445233153f3ab5218c8c652d5fe69
src/validation.h
src/validation.h
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H #define BITCOIN_VALIDATION_H #include <stdint.h> #include <string> static const int64_t DEFAULT_MAX_TIP_AGE = 1 * 60 * 60; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin extern int64_t nMaxTipAge; class CBlockIndex; FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb"); FILE* AppendBlockFile(unsigned int& nFileRet); bool IsInitialBlockDownload(); /** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */ double GuessVerificationProgress(CBlockIndex* pindex); #endif // BITCOIN_VALIDATION_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H #define BITCOIN_VALIDATION_H #include <stdint.h> #include <string> static const int64_t DEFAULT_MAX_TIP_AGE = 120; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin extern int64_t nMaxTipAge; class CBlockIndex; FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb"); FILE* AppendBlockFile(unsigned int& nFileRet); bool IsInitialBlockDownload(); /** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */ double GuessVerificationProgress(CBlockIndex* pindex); #endif // BITCOIN_VALIDATION_H
Update default max tip age
Update default max tip age
C
mit
neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron
769c2c7be646091ca003605c6dde6747c92f73e8
lib/xray/xray_emulate_tsc.h
lib/xray/xray_emulate_tsc.h
//===-- xray_emulate_tsc.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // //===----------------------------------------------------------------------===// #ifndef XRAY_EMULATE_TSC_H #define XRAY_EMULATE_TSC_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "xray_defs.h" #include <cstdint> #include <time.h> namespace __xray { static constexpr uint64_t NanosecondsPerSecond = 1000ULL * 1000 * 1000; ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT { timespec TS; int result = clock_gettime(CLOCK_REALTIME, &TS); if (result != 0) { Report("clock_gettime(2) returned %d, errno=%d.", result, int(errno)); TS.tv_sec = 0; TS.tv_nsec = 0; } CPU = 0; return TS.tv_sec * NanosecondsPerSecond + TS.tv_nsec; } } #endif // XRAY_EMULATE_TSC_H
//===-- xray_emulate_tsc.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // //===----------------------------------------------------------------------===// #ifndef XRAY_EMULATE_TSC_H #define XRAY_EMULATE_TSC_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "xray_defs.h" #include <cerrno> #include <cstdint> #include <time.h> namespace __xray { static constexpr uint64_t NanosecondsPerSecond = 1000ULL * 1000 * 1000; ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT { timespec TS; int result = clock_gettime(CLOCK_REALTIME, &TS); if (result != 0) { Report("clock_gettime(2) returned %d, errno=%d.", result, int(errno)); TS.tv_sec = 0; TS.tv_nsec = 0; } CPU = 0; return TS.tv_sec * NanosecondsPerSecond + TS.tv_nsec; } } #endif // XRAY_EMULATE_TSC_H
Fix missing include of <cerrno>
[XRay][compiler-rt] Fix missing include of <cerrno> Futher attempt to un-break ARM and AArch64 build. Follow-up on D25360. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@290083 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
643168599fc9fe58ae1779ac93e435b3fa934eee
bin/tests/gxbn_test.c
bin/tests/gxbn_test.c
/* * Copyright (C) 2000 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 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. */ #include <stdio.h> #include <sys/socket.h> #include <lwres/netdb.h> static void print_he(struct hostent *he, int error, const char *fun, const char *name) { char **c; int i; if (he != NULL) { printf("%s(%s):\n", fun, name); printf("\tname = %s\n", he->h_name); printf("\taddrtype = %d\n", he->h_addrtype); printf("\tlength = %d\n", he->h_length); c = he->h_aliases; i = 1; while (*c != NULL) { printf("\talias[%d] = %s\n", i, *c); i++; c++; } c = he->h_addr_list; i = 1; while (*c != NULL) { char buf[128]; inet_ntop(he->h_addrtype, c, buf, sizeof (buf)); printf("\taddress[%d] = %s\n", i, buf); c++; i++; } } else { printf("%s(%s): error = %d\n", fun, name, error); } } int main(int argc, char **argv) { struct hostent *he; char **c; int error; while (argv[1] != NULL) { he = gethostbyname(argv[1]); print_he(he, 0 /* XXX h_errno */, "gethostbyname", argv[1]); he = getipnodebyname(argv[1], AF_INET, AI_DEFAULT|AI_ALL, &error); print_he(he, error, "getipnodebyname", argv[1]); if (he != NULL) freehostent(he); argv++; } exit(0); }
Test getipnodebyname() & gethostbyname() implementations.
Test getipnodebyname() & gethostbyname() implementations.
C
mpl-2.0
each/bind9-collab,each/bind9-collab,each/bind9-collab,pecharmin/bind9,pecharmin/bind9,each/bind9-collab,pecharmin/bind9,pecharmin/bind9,each/bind9-collab,pecharmin/bind9,each/bind9-collab,pecharmin/bind9
810e3b75bab2565a68d43b7fb7b709c10b19f711
tutorial/putc_example.c
tutorial/putc_example.c
// Compile with: // $ gcc -Wall -Werror -o putc_example putc_example.c // // 1. Warm up: Make the program print out the string backwards // 2. $ rm -f putc_example (remove the compiled program) // Comment out all of the #include headers in this file and re-run the // compile command. You should see warnings, and no ouput file is generated. // Try to get the program to compile/generate an output file without // adding the include files back in. (There are two different ways that // I can think of to do this). // 3. In C, arrays and pointers are the same thing. Rewrite the "loop" // section below using pointers instead of arrays (ie, dont use the [ ] // syntax). // See: http://www.google.com/search?q=c+pointers+arrays #include <stdio.h> #include <string.h> int main(int argc, char* argv[]) { if (argc != 2) { printf("Usage: %s <string>\n", argv[0]); return 0; } // This code is equivalent to printf("%s\n", argv[1]); const char* string_argument = argv[1]; int length = strlen(string_argument); int i; for (i = 0; i < length; i++) { char c = string_argument[i]; putchar(c); } putchar('\n'); return 0; }
// Compile with: // $ gcc -Wall -Werror -o putc_example putc_example.c // // 1. Warm up: Make the program print out the string backwards // 2. $ rm -f putc_example (remove the compiled program) // Comment out all of the #include headers in this file and re-run the // compile command. You should see warnings, and no ouput file is generated. // Try to get the program to compile/generate an output file without // adding the include files back in. (There are two different ways that // I can think of to do this). // 3. In C, arrays and pointers are the same thing. Rewrite the "loop" // section below using pointers instead of arrays (ie, dont use the [ ] // syntax). // See: http://www.google.com/search?q=c+pointers+arrays #include <stdio.h> #include <string.h> int main(int argc, char* argv[]) { if (argc != 2) { printf("Usage: %s <string>\n", argv[0]); return 0; } // This code is equivalent to printf("%s\n", argv[1]); const char* string_argument = argv[1]; size_t length = strlen(string_argument); int i; for (i = 0; i < length; i++) { char c = string_argument[i]; putchar(c); } putchar('\n'); return 0; }
Use size_t for strlen result, so it matches the man page.
Use size_t for strlen result, so it matches the man page.
C
apache-2.0
allenporter/thebends,allenporter/thebends,allenporter/thebends,allenporter/thebends,allenporter/thebends,allenporter/thebends,allenporter/thebends,allenporter/thebends,allenporter/thebends
961492e653d8268044fa7af755531121cf3fc7d1
src/util/file_utils.h
src/util/file_utils.h
#ifndef FILE_UTILS_H #define FILE_UTILS_H #include <stdint.h> #include <string.h> #include <dirent.h> #define PATHLEN 32 #define MAXPATH 1024 #define PROC "/proc/" #define MEMINFO "/proc/meminfo" #define STATUS "/proc/%s/status" #define IO_STAT "/proc/%s/io" #define STAT "/proc/%s/stat" #define STAT_BUFFER 4096 #define COMM "/proc/%s/comm" #define COMM_LEN strlen(COMM) #define FD "/proc/%s/fd" #define UID "Uid:\t" char *parse_stat(char *pid, int field); char *parse_proc(char *path, char *field); int is_pid(const struct dirent *directory); char *strip(char *stat); char *calculate_size(char *field_total, int byte_idx); uint64_t value_from_string(char *ps_field_value); #endif
#ifndef FILE_UTILS_H #define FILE_UTILS_H #include <stdint.h> #include <string.h> #include <dirent.h> #define PATHLEN 32 #define MAXPATH 1024 #define PROC_SIZE 1024 #define PROC "/proc/" #define MEMINFO "/proc/meminfo" #define STATUS "/proc/%s/status" #define IO_STAT "/proc/%s/io" #define STAT "/proc/%s/stat" #define STAT_BUFFER 4096 #define COMM "/proc/%s/comm" #define COMM_LEN strlen(COMM) #define FD "/proc/%s/fd" #define UID "Uid:\t" char *parse_stat(char *pid, int field); char *parse_proc(char *path, char *field); int is_pid(const struct dirent *directory); char *strip(char *stat); char *calculate_size(char *field_total, int byte_idx); uint64_t value_from_string(char *ps_field_value); #endif
Define macro for size of proc parser
Define macro for size of proc parser
C
mit
tijko/dashboard
98c97486a56452a655471f0be6aa8ecfecc359fe
ReactiveCocoaFramework/ReactiveCocoa/UIAlertView+RACCommandSupport.h
ReactiveCocoaFramework/ReactiveCocoa/UIAlertView+RACCommandSupport.h
// // UIAlertView+RACCommandSupport.h // ReactiveCocoa // // Created by Henrik Hodne on 6/16/13. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <UIKit/UIKit.h> @class RACCommand; @interface UIAlertView (RACCommandSupport) // Sets the alert view's command. When a button on the alert view is pressed, // the command is executed with the index of the button that was pressed. @property (nonatomic, strong) RACCommand *rac_command; @end
// // UIAlertView+RACCommandSupport.h // ReactiveCocoa // // Created by Henrik Hodne on 6/16/13. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <UIKit/UIKit.h> @class RACCommand; @interface UIAlertView (RACCommandSupport) // Sets the alert view's command. When a button on the alert view is pressed, // the command is executed with the index of the button that was pressed. // // This will override the alert view's delegate, so you can't use this together // with a custom delegate. @property (nonatomic, strong) RACCommand *rac_command; @end
Document that UIAlertView.rac_command overrides the delegate
Document that UIAlertView.rac_command overrides the delegate
C
mit
DongDongDongDong/ReactiveCocoa,JohnJin007/ReactiveCocoa,AllanChen/ReactiveCocoa,walkingsmarts/ReactiveCocoa,Pingco/ReactiveCocoa,dz1111/ReactiveCocoa,zhenlove/ReactiveCocoa,brightcove/ReactiveCocoa,jsslai/ReactiveCocoa,Pikdays/ReactiveCocoa,paulyoung/ReactiveCocoa,on99/ReactiveCocoa,xumaolin/ReactiveCocoa,mxxiv/ReactiveCocoa,calebd/ReactiveCocoa,tzongw/ReactiveCocoa,BlessNeo/ReactiveCocoa,valleyman86/ReactiveCocoa,JohnJin007/ReactiveCocoa,on99/ReactiveCocoa,richeterre/ReactiveCocoa,natestedman/ReactiveCocoa,zhaoguohui/ReactiveCocoa,nikita-leonov/ReactiveCocoa,tipbit/ReactiveCocoa,WEIBP/ReactiveCocoa,alvinvarghese/ReactiveCocoa,llb1119/test,xulibao/ReactiveCocoa,nickcheng/ReactiveCocoa,valleyman86/ReactiveCocoa,SuPair/ReactiveCocoa,liufeigit/ReactiveCocoa,zhaoguohui/ReactiveCocoa,libiao88/ReactiveCocoa,monkeydbobo/ReactiveCocoa,howandhao/ReactiveCocoa,Farteen/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,stevielu/ReactiveCocoa,tiger8888/ReactiveCocoa,leichunfeng/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,jrmiddle/ReactiveCocoa,ddc391565320/ReactiveCocoa,mtxs007/ReactiveCocoa,beni55/ReactiveCocoa,zzzworm/ReactiveCocoa,wangqi211/ReactiveCocoa,Ray0218/ReactiveCocoa,qq644531343/ReactiveCocoa,cogddo/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,stupidfive/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,wpstarnice/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,CQXfly/ReactiveCocoa,200895045/ReactiveCocoa,zhiwen1024/ReactiveCocoa,almassapargali/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,taylormoonxu/ReactiveCocoa,wpstarnice/ReactiveCocoa,jaylib/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,natan/ReactiveCocoa,WEIBP/ReactiveCocoa,335g/ReactiveCocoa,natan/ReactiveCocoa,hbucius/ReactiveCocoa,kevin-zqw/ReactiveCocoa,paulyoung/ReactiveCocoa,JohnJin007/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,yytong/ReactiveCocoa,itschaitanya/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,Eveian/ReactiveCocoa,jackywpy/ReactiveCocoa,bensonday/ReactiveCocoa,isghe/ReactiveCocoa,LHDsimon/ReactiveCocoa,almassapargali/ReactiveCocoa,monkeydbobo/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,mxxiv/ReactiveCocoa,Khan/ReactiveCocoa,koamac/ReactiveCocoa,goodheart/ReactiveCocoa,hoanganh6491/ReactiveCocoa,calebd/ReactiveCocoa,imkerberos/ReactiveCocoa,335g/ReactiveCocoa,koamac/ReactiveCocoa,jsslai/ReactiveCocoa,SanChain/ReactiveCocoa,kiurentu/ReactiveCocoa,ohwutup/ReactiveCocoa,KuPai32G/ReactiveCocoa,zxq3220122/ReactiveCocoa,Ray0218/ReactiveCocoa,ShawnLeee/ReactiveCocoa,SmartEncounter/ReactiveCocoa,eliperkins/ReactiveCocoa,towik/ReactiveCocoa,KJin99/ReactiveCocoa,taylormoonxu/ReactiveCocoa,Pingco/ReactiveCocoa,SuPair/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,Remitly/ReactiveCocoa,Juraldinio/ReactiveCocoa,nikita-leonov/ReactiveCocoa,andersio/ReactiveCocoa,AlanJN/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,Juraldinio/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,Khan/ReactiveCocoa,AlanJN/ReactiveCocoa,yoichitgy/ReactiveCocoa,icepy/ReactiveCocoa,victorlin/ReactiveCocoa,kaylio/ReactiveCocoa,ceekayel/ReactiveCocoa,jianwoo/ReactiveCocoa,dz1111/ReactiveCocoa,walkingsmarts/ReactiveCocoa,ailyanlu/ReactiveCocoa,Carthage/ReactiveCocoa,yytong/ReactiveCocoa,sdhzwm/ReactiveCocoa,huiping192/ReactiveCocoa,Farteen/ReactiveCocoa,smilypeda/ReactiveCocoa,CQXfly/ReactiveCocoa,brasbug/ReactiveCocoa,longv2go/ReactiveCocoa,hilllinux/ReactiveCocoa,qq644531343/ReactiveCocoa,windgo/ReactiveCocoa,cstars135/ReactiveCocoa,dachaoisme/ReactiveCocoa,Khan/ReactiveCocoa,chao95957/ReactiveCocoa,Pikdays/ReactiveCocoa,richeterre/ReactiveCocoa,pzw224/ReactiveCocoa,dskatz22/ReactiveCocoa,jrmiddle/ReactiveCocoa,ailyanlu/ReactiveCocoa,xiaoliyang/ReactiveCocoa,JackLian/ReactiveCocoa,victorlin/ReactiveCocoa,ztchena/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,takeshineshiro/ReactiveCocoa,jrmiddle/ReactiveCocoa,pzw224/ReactiveCocoa,Ricowere/ReactiveCocoa,eyu1988/ReactiveCocoa,zhenlove/ReactiveCocoa,lixar/ReactiveCocoa,nickcheng/ReactiveCocoa,zzqiltw/ReactiveCocoa,valleyman86/ReactiveCocoa,clg0118/ReactiveCocoa,nickcheng/ReactiveCocoa,windgo/ReactiveCocoa,natan/ReactiveCocoa,dskatz22/ReactiveCocoa,cstars135/ReactiveCocoa,buildo/ReactiveCocoa,cnbin/ReactiveCocoa,nickcheng/ReactiveCocoa,OneSmallTree/ReactiveCocoa,zhenlove/ReactiveCocoa,SanChain/ReactiveCocoa,zhigang1992/ReactiveCocoa,ioshger0125/ReactiveCocoa,swizzlr/ReactiveCocoa,chao95957/ReactiveCocoa,jeelun/ReactiveCocoa,ohwutup/ReactiveCocoa,xumaolin/ReactiveCocoa,hj3938/ReactiveCocoa,Ray0218/ReactiveCocoa,clg0118/ReactiveCocoa,BrooksWon/ReactiveCocoa,natestedman/ReactiveCocoa,jianwoo/ReactiveCocoa,bensonday/ReactiveCocoa,bencochran/ReactiveCocoa,almassapargali/ReactiveCocoa,taylormoonxu/ReactiveCocoa,isghe/ReactiveCocoa,buildo/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,mtxs007/ReactiveCocoa,dachaoisme/ReactiveCocoa,yizzuide/ReactiveCocoa,sandyway/ReactiveCocoa,jaylib/ReactiveCocoa,KJin99/ReactiveCocoa,wpstarnice/ReactiveCocoa,libiao88/ReactiveCocoa,AlanJN/ReactiveCocoa,eliperkins/ReactiveCocoa,esttorhe/ReactiveCocoa,Liquidsoul/ReactiveCocoa,terry408911/ReactiveCocoa,shaohung001/ReactiveCocoa,jaylib/ReactiveCocoa,bencochran/ReactiveCocoa,andersio/ReactiveCocoa,bscarano/ReactiveCocoa,imkerberos/ReactiveCocoa,bencochran/ReactiveCocoa,walkingsmarts/ReactiveCocoa,cogddo/ReactiveCocoa,ericzhou2008/ReactiveCocoa,hilllinux/ReactiveCocoa,takeshineshiro/ReactiveCocoa,hbucius/ReactiveCocoa,add715/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,Rupert-RR/ReactiveCocoa,loupman/ReactiveCocoa,yoichitgy/ReactiveCocoa,Ricowere/ReactiveCocoa,hoanganh6491/ReactiveCocoa,yonekawa/ReactiveCocoa,zhiwen1024/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,Ethan89/ReactiveCocoa,vincentiss/ReactiveCocoa,jeelun/ReactiveCocoa,kiurentu/ReactiveCocoa,BlessNeo/ReactiveCocoa,Liquidsoul/ReactiveCocoa,tonyarnold/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,fanghao085/ReactiveCocoa,cogddo/ReactiveCocoa,fanghao085/ReactiveCocoa,hilllinux/ReactiveCocoa,tiger8888/ReactiveCocoa,rpowelll/ReactiveCocoa,takeshineshiro/ReactiveCocoa,zhigang1992/ReactiveCocoa,mtxs007/ReactiveCocoa,CQXfly/ReactiveCocoa,Rupert-RR/ReactiveCocoa,tzongw/ReactiveCocoa,jaylib/ReactiveCocoa,brightcove/ReactiveCocoa,gabemdev/ReactiveCocoa,on99/ReactiveCocoa,xiaoliyang/ReactiveCocoa,longv2go/ReactiveCocoa,emodeqidao/ReactiveCocoa,qq644531343/ReactiveCocoa,pzw224/ReactiveCocoa,ikesyo/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,dachaoisme/ReactiveCocoa,xiaobing2007/ReactiveCocoa,chao95957/ReactiveCocoa,tonyli508/ReactiveCocoa,ddc391565320/ReactiveCocoa,liufeigit/ReactiveCocoa,Eveian/ReactiveCocoa,hbucius/ReactiveCocoa,xumaolin/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,Carthage/ReactiveCocoa,Remitly/ReactiveCocoa,kaylio/ReactiveCocoa,Ethan89/ReactiveCocoa,tornade0913/ReactiveCocoa,hoanganh6491/ReactiveCocoa,towik/ReactiveCocoa,smilypeda/ReactiveCocoa,tornade0913/ReactiveCocoa,leelili/ReactiveCocoa,sandyway/ReactiveCocoa,Liquidsoul/ReactiveCocoa,loupman/ReactiveCocoa,FelixYin66/ReactiveCocoa,terry408911/ReactiveCocoa,OneSmallTree/ReactiveCocoa,dskatz22/ReactiveCocoa,FelixYin66/ReactiveCocoa,terry408911/ReactiveCocoa,esttorhe/ReactiveCocoa,mattpetters/ReactiveCocoa,tipbit/ReactiveCocoa,ddc391565320/ReactiveCocoa,sdhzwm/ReactiveCocoa,tonyarnold/ReactiveCocoa,add715/ReactiveCocoa,smilypeda/ReactiveCocoa,zxq3220122/ReactiveCocoa,tzongw/ReactiveCocoa,yizzuide/ReactiveCocoa,LHDsimon/ReactiveCocoa,Carthage/ReactiveCocoa,Farteen/ReactiveCocoa,vincentiss/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,huiping192/ReactiveCocoa,ShawnLeee/ReactiveCocoa,fhchina/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,jackywpy/ReactiveCocoa,bscarano/ReactiveCocoa,KuPai32G/ReactiveCocoa,bscarano/ReactiveCocoa,gabemdev/ReactiveCocoa,loupman/ReactiveCocoa,xulibao/ReactiveCocoa,Rupert-RR/ReactiveCocoa,alvinvarghese/ReactiveCocoa,eliperkins/ReactiveCocoa,howandhao/ReactiveCocoa,200895045/ReactiveCocoa,tornade0913/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,Pikdays/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,BrooksWon/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,stevielu/ReactiveCocoa,sdhzwm/ReactiveCocoa,cnbin/ReactiveCocoa,ceekayel/ReactiveCocoa,ztchena/ReactiveCocoa,sujeking/ReactiveCocoa,kevin-zqw/ReactiveCocoa,victorlin/ReactiveCocoa,dullgrass/ReactiveCocoa,jeelun/ReactiveCocoa,ioshger0125/ReactiveCocoa,hj3938/ReactiveCocoa,koamac/ReactiveCocoa,alvinvarghese/ReactiveCocoa,fhchina/ReactiveCocoa,zhiwen1024/ReactiveCocoa,yonekawa/ReactiveCocoa,goodheart/ReactiveCocoa,eyu1988/ReactiveCocoa,ericzhou2008/ReactiveCocoa,cstars135/ReactiveCocoa,DreamHill/ReactiveCocoa,stevielu/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,yonekawa/ReactiveCocoa,isghe/ReactiveCocoa,KuPai32G/ReactiveCocoa,brasbug/ReactiveCocoa,longv2go/ReactiveCocoa,BrooksWon/ReactiveCocoa,335g/ReactiveCocoa,ioshger0125/ReactiveCocoa,zhukaixy/ReactiveCocoa,howandhao/ReactiveCocoa,lixar/ReactiveCocoa,rpowelll/ReactiveCocoa,icepy/ReactiveCocoa,vincentiss/ReactiveCocoa,zhaoguohui/ReactiveCocoa,brasbug/ReactiveCocoa,goodheart/ReactiveCocoa,paulyoung/ReactiveCocoa,200895045/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,clg0118/ReactiveCocoa,jackywpy/ReactiveCocoa,esttorhe/ReactiveCocoa,towik/ReactiveCocoa,fhchina/ReactiveCocoa,zhukaixy/ReactiveCocoa,KJin99/ReactiveCocoa,bensonday/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,jam891/ReactiveCocoa,tiger8888/ReactiveCocoa,tonyli508/ReactiveCocoa,zzzworm/ReactiveCocoa,JackLian/ReactiveCocoa,fanghao085/ReactiveCocoa,rpowelll/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,zxq3220122/ReactiveCocoa,WEIBP/ReactiveCocoa,llb1119/test,itschaitanya/ReactiveCocoa,shaohung001/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,emodeqidao/ReactiveCocoa,jianwoo/ReactiveCocoa,ShawnLeee/ReactiveCocoa,libiao88/ReactiveCocoa,buildo/ReactiveCocoa,zzzworm/ReactiveCocoa,shaohung001/ReactiveCocoa,gengjf/ReactiveCocoa,mattpetters/ReactiveCocoa,icepy/ReactiveCocoa,leichunfeng/ReactiveCocoa,jam891/ReactiveCocoa,Pingco/ReactiveCocoa,ericzhou2008/ReactiveCocoa,nikita-leonov/ReactiveCocoa,dullgrass/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,lixar/ReactiveCocoa,yoichitgy/ReactiveCocoa,Eveian/ReactiveCocoa,xiaoliyang/ReactiveCocoa,windgo/ReactiveCocoa,cnbin/ReactiveCocoa,sugar2010/ReactiveCocoa,kaylio/ReactiveCocoa,LHDsimon/ReactiveCocoa,Ricowere/ReactiveCocoa,j364960953/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,gengjf/ReactiveCocoa,luerhouhou/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,Ethan89/ReactiveCocoa,ailyanlu/ReactiveCocoa,leelili/ReactiveCocoa,j364960953/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,wangqi211/ReactiveCocoa,OneSmallTree/ReactiveCocoa,chieryw/ReactiveCocoa,yizzuide/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,brightcove/ReactiveCocoa,sujeking/ReactiveCocoa,xiaobing2007/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,tonyli508/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,swizzlr/ReactiveCocoa,gengjf/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,BlessNeo/ReactiveCocoa,SuPair/ReactiveCocoa,zzqiltw/ReactiveCocoa,natestedman/ReactiveCocoa,DreamHill/ReactiveCocoa,mxxiv/ReactiveCocoa,mattpetters/ReactiveCocoa,ohwutup/ReactiveCocoa,FelixYin66/ReactiveCocoa,huiping192/ReactiveCocoa,j364960953/ReactiveCocoa,monkeydbobo/ReactiveCocoa,sandyway/ReactiveCocoa,luerhouhou/ReactiveCocoa,hj3938/ReactiveCocoa,stupidfive/ReactiveCocoa,richeterre/ReactiveCocoa,zzqiltw/ReactiveCocoa,luerhouhou/ReactiveCocoa,itschaitanya/ReactiveCocoa,JackLian/ReactiveCocoa,leichunfeng/ReactiveCocoa,llb1119/test,sugar2010/ReactiveCocoa,chieryw/ReactiveCocoa,liufeigit/ReactiveCocoa,beni55/ReactiveCocoa,zhukaixy/ReactiveCocoa,huiping192/ReactiveCocoa,Remitly/ReactiveCocoa,dz1111/ReactiveCocoa,Ricowere/ReactiveCocoa,kiurentu/ReactiveCocoa,ceekayel/ReactiveCocoa,esttorhe/ReactiveCocoa,dullgrass/ReactiveCocoa,ztchena/ReactiveCocoa,Juraldinio/ReactiveCocoa,beni55/ReactiveCocoa,wangqi211/ReactiveCocoa,add715/ReactiveCocoa,sugar2010/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,DreamHill/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,chieryw/ReactiveCocoa,calebd/ReactiveCocoa,AllanChen/ReactiveCocoa,tonyarnold/ReactiveCocoa,stupidfive/ReactiveCocoa,emodeqidao/ReactiveCocoa,xiaobing2007/ReactiveCocoa,sujeking/ReactiveCocoa,xulibao/ReactiveCocoa,jam891/ReactiveCocoa,eyu1988/ReactiveCocoa,jsslai/ReactiveCocoa,SanChain/ReactiveCocoa,leelili/ReactiveCocoa,kevin-zqw/ReactiveCocoa,yytong/ReactiveCocoa,andersio/ReactiveCocoa,imkerberos/ReactiveCocoa,zhigang1992/ReactiveCocoa,SmartEncounter/ReactiveCocoa,ikesyo/ReactiveCocoa
6254e8a578752fb18c085c7519390b881b619745
HTMLKit/HTMLKit.h
HTMLKit/HTMLKit.h
// // HTMLKit.h // HTMLKit // // Created by Iska on 15/09/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for HTMLKit. extern double HTMLKitVersionNumber; //! Project version string for HTMLKit. extern const unsigned char HTMLKitVersionString[]; #import "HTMLDOM.h" #import "HTMLParser.h" #import "HTMLKitErrorDomain.h" #import "HTMLOrderedDictionary.h" #import "CSSSelectors.h" #import "CSSSelectorParser.h" #import "CSSNthExpressionParser.h"
// // HTMLKit.h // HTMLKit // // Created by Iska on 15/09/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for HTMLKit. extern double HTMLKitVersionNumber; //! Project version string for HTMLKit. extern const unsigned char HTMLKitVersionString[]; #import "HTMLDOM.h" #import "HTMLParser.h" #import "HTMLKitErrorDomain.h" #import "HTMLOrderedDictionary.h" #import "CSSSelectors.h" #import "CSSSelectorParser.h" #import "CSSNthExpressionParser.h" #import "NSString+HTMLKit.h" #import "NSCharacterSet+HTMLKit.h"
Add imports for the public categories in the umbrella header
Add imports for the public categories in the umbrella header
C
mit
iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit
d6d05c53626ccdc2495ef6b98cafef4c3c1f3729
server/types/JoinableImpl.h
server/types/JoinableImpl.h
#ifndef JOINABLE_IMPL #define JOINABLE_IMPL #include "joinable_types.h" #include "types/MediaObjectImpl.h" using ::com::kurento::kms::api::Joinable; using ::com::kurento::kms::api::Direction; using ::com::kurento::kms::api::StreamType; namespace com { namespace kurento { namespace kms { class JoinableImpl : public virtual Joinable, public virtual MediaObjectImpl { public: JoinableImpl(); ~JoinableImpl() throw() {}; std::vector<StreamType::type> getStreams(const Joinable& joinable); void join(const JoinableImpl& to, const Direction::type direction); void unjoin(const JoinableImpl& to); void join(const JoinableImpl& to, const StreamType::type stream, const Direction::type direction); void unjoin(const JoinableImpl& to, const StreamType::type stream); std::vector<Joinable> &getJoinees(); std::vector<Joinable> &getDirectionJoiness(const Direction::type direction); std::vector<Joinable> &getJoinees(const StreamType::type stream); std::vector<Joinable> &getDirectionJoiness(const StreamType::type stream, const Direction::type direction); }; }}} // com::kurento::kms #endif /* JOINABLE_IMPL */
#ifndef JOINABLE_IMPL #define JOINABLE_IMPL #include "joinable_types.h" #include "types/MediaObjectImpl.h" using ::com::kurento::kms::api::Joinable; using ::com::kurento::kms::api::Direction; using ::com::kurento::kms::api::StreamType; namespace com { namespace kurento { namespace kms { class JoinableImpl : public virtual Joinable, public virtual MediaObjectImpl { public: JoinableImpl(); ~JoinableImpl() throw() {}; std::vector<StreamType::type> getStreams(const Joinable& joinable); void join(const JoinableImpl& to, const Direction::type direction); void unjoin(const JoinableImpl& to); void join(const JoinableImpl& to, const StreamType::type stream, const Direction::type direction); void unjoin(const JoinableImpl& to, const StreamType::type stream); std::vector<Joinable> &getJoinees(); std::vector<Joinable> &getDirectionJoiness(const Direction::type direction); std::vector<Joinable> &getJoinees(const StreamType::type stream); std::vector<Joinable> &getDirectionJoiness(const StreamType::type stream, const Direction::type direction); }; }}} // com::kurento::kms #endif /* JOINABLE_IMPL */
Add new line at end of file
Add new line at end of file
C
lgpl-2.1
lulufei/kurento-media-server,TribeMedia/kurento-media-server,shelsonjava/kurento-media-server,shelsonjava/kurento-media-server,todotobe1/kurento-media-server,Kurento/kurento-media-server,mparis/kurento-media-server,lulufei/kurento-media-server,Kurento/kurento-media-server,mparis/kurento-media-server,TribeMedia/kurento-media-server,todotobe1/kurento-media-server
cecd7696fcdc00dbdcc7de1a3747c9f2801b305e
tests/regression/36-apron/96-branched-thread-creation-apron-priv.c
tests/regression/36-apron/96-branched-thread-creation-apron-priv.c
// SKIP PARAM: --set ana.activated[+] apron extern int __VERIFIER_nondet_int(); #include <pthread.h> #include <assert.h> int g = 5; int h = 5; pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { return NULL; } int main() { int r = __VERIFIER_nondet_int(); pthread_t id; if (r) { pthread_create(&id, NULL, t_fun, NULL); } else { h = 10; } // sync join needs to publish globals also to protected/mutex_inits like enter_multithreaded // might need join strengthening to reveal unsoundness instead of going to top directly pthread_mutex_lock(&m); assert(g == h); // UNKNOWN! pthread_mutex_unlock(&m); return 0; }
Add Apron branched thread creation privatization test, where protected is unsound
Add Apron branched thread creation privatization test, where protected is unsound
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
0ecce5926dd432110b4ae0ea3b6c7702af71d8be
OpenMRS-iOS/OpenMRS-iOS-Bridging-Header.h
OpenMRS-iOS/OpenMRS-iOS-Bridging-Header.h
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "OpenMRSAPIManager.h" #import "LocationListTableViewController.h" #import "UIAlertView+Blocks.h"
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "OpenMRSAPIManager.h" #import "LocationListTableViewController.h" #import "UIAlertView+Blocks.h" #import "MRSHelperFunctions.h"
Add MRSHelper functions to Bridging Header
Add MRSHelper functions to Bridging Header
C
mpl-2.0
Undo1/openmrs-contrib-ios-client,yousefhamza/openmrs-contrib-ios-client,Undo1/openmrs-contrib-ios-client,yousefhamza/openmrs-contrib-ios-client
79e60f8ed47146544da1d005776a3d1b9e672a3f
src/CommandLineParser.h
src/CommandLineParser.h
//! \file CommandLineParser.h #ifndef _COMMANDLINEPARSER_H #define _COMMANDLINEPARSER_H #include <string> //! Abstract base class for parsing command line arguments class CommandLineParser { public: /*! Parses command line args and stores results internally. * May throw an exception in case of error * \param argc number of arguments * \param argv arguments as passed to main */ virtual void parse(int argc, char** argv) = 0; /*! Query whether a specific flag was set on command line. * \param flag Command line switch without leading dash * \return whether specified flag was set on command line */ virtual bool hasSet(std::string flag) = 0; /*! get argument of switch (if available) * \param option command line switch without leading dash * \returns value as string */ virtual std::string getValue(std::string option) = 0; /*! Print usage help */ virtual void printHelp() = 0; }; #endif // _COMMANDLINEPARSER_H
//! \file CommandLineParser.h #ifndef _COMMANDLINEPARSER_H #define _COMMANDLINEPARSER_H #include <string> //! Abstract base class for parsing command line arguments class CommandLineParser { public: virtual ~CommandLineParser() {}; /*! Parses command line args and stores results internally. * May throw an exception in case of error * \param argc number of arguments * \param argv arguments as passed to main */ virtual void parse(int argc, char** argv) = 0; /*! Query whether a specific flag was set on command line. * \param flag Command line switch without leading dash * \return whether specified flag was set on command line */ virtual bool hasSet(std::string flag) = 0; /*! get argument of switch (if available) * \param option command line switch without leading dash * \returns value as string */ virtual std::string getValue(std::string option) = 0; /*! Print usage help */ virtual void printHelp() = 0; }; #endif // _COMMANDLINEPARSER_H
Make Command line parser d'tor virtual
Make Command line parser d'tor virtual
C
mit
dueringa/WikiWalker
faa0634236d953e4947503a1ae2546b005106544
src/PubSubClient_JSON.h
src/PubSubClient_JSON.h
/* PubSubClient_JSON.h - ArduinoJson support for PubSubClient Copyright (C) 2016 Ian Tester This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include <ArduinoJson.h> namespace MQTT { class PublishJSON : public Publish { public: //! Publish a JSON object from the ArduinoJson library /*! \param topic Topic of the message \param payload Object of the message */ PublishJSON(String topic, ArduinoJson::JsonObject& object) : Publish(topic, NULL, object.measureLength() + 1) { _payload = new uint8_t[_payload_len]; if (_payload != NULL) object.printTo((char*)_payload, _payload_len); } //! Publish a JSON array from the ArduinoJson library /*! \param topic Topic of the message \param payload Array of the message */ PublishJSON(String topic, ArduinoJson::JsonArray& array) : Publish(topic, NULL, array.measureLength() + 1) { _payload = new uint8_t[_payload_len]; if (_payload != NULL) array.printTo((char*)_payload, _payload_len); } }; };
Add header file for publishing ArduinoJson objects and arrays
Add header file for publishing ArduinoJson objects and arrays
C
mit
Imroy/pubsubclient,Imroy/pubsubclient,Imroy/pubsubclient
a29ba1e4518d9dc9650448d67abae39341d6364b
test/read_file.h
test/read_file.h
inline string get_file_contents(char *filename) { ifstream file(filename, ios::in | ios::ate); if (!file.is_open()) return string(); streampos sz = file.tellg(); file.seekg(0, ios::beg); vector<char> v(sz); file.read(&v[0], sz); file.close(); string data(v.empty() ? string() : string (v.begin(), v.end()).c_str()); return data; }
inline string get_file_contents(const char *filename) { ifstream file(filename, ios::in | ios::ate); if (!file.is_open()) return string(); streampos sz = file.tellg(); file.seekg(0, ios::beg); vector<char> v(sz); file.read(&v[0], sz); file.close(); string data(v.empty() ? string() : string (v.begin(), v.end()).c_str()); return data; }
Fix compiler warnings in the test suite
Fix compiler warnings in the test suite
C
lgpl-2.1
matthewruhland/libmusicbrainz,sebastinas/libmusicbrainz,matthewruhland/libmusicbrainz,metabrainz/libmusicbrainz,sebastinas/libmusicbrainz,sebastinas/libmusicbrainz,ianmcorvidae/libmusicbrainz,metabrainz/libmusicbrainz,matthewruhland/libmusicbrainz,metabrainz/libmusicbrainz,ianmcorvidae/libmusicbrainz
7f5130a7ac41e93066f60d80203a0b8ea675c0c9
numpy/core/src/multiarray/nditer_pywrap.h
numpy/core/src/multiarray/nditer_pywrap.h
#ifndef __NEW_ITERATOR_PYWRAP_H #define __NEW_ITERATOR_PYWRAP_H NPY_NO_EXPORT PyObject * NpyIter_NestedIters(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds); #endif
#ifndef __NDITER_PYWRAP_H #define __NDITER_PYWRAP_H NPY_NO_EXPORT PyObject * NpyIter_NestedIters(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds); #endif
Make include flag name match file name.
STY: Make include flag name match file name.
C
bsd-3-clause
ahaldane/numpy,stefanv/numpy,brandon-rhodes/numpy,dimasad/numpy,kiwifb/numpy,skymanaditya1/numpy,rherault-insa/numpy,ChristopherHogan/numpy,MSeifert04/numpy,rudimeier/numpy,chiffa/numpy,drasmuss/numpy,Eric89GXL/numpy,ekalosak/numpy,endolith/numpy,mingwpy/numpy,rgommers/numpy,dch312/numpy,madphysicist/numpy,jorisvandenbossche/numpy,cowlicks/numpy,nguyentu1602/numpy,shoyer/numpy,drasmuss/numpy,kirillzhuravlev/numpy,madphysicist/numpy,seberg/numpy,ChanderG/numpy,argriffing/numpy,joferkington/numpy,mathdd/numpy,numpy/numpy,ahaldane/numpy,grlee77/numpy,mattip/numpy,astrofrog/numpy,endolith/numpy,BabeNovelty/numpy,Linkid/numpy,rajathkumarmp/numpy,anntzer/numpy,grlee77/numpy,jonathanunderwood/numpy,ddasilva/numpy,shoyer/numpy,njase/numpy,WarrenWeckesser/numpy,mingwpy/numpy,empeeu/numpy,empeeu/numpy,NextThought/pypy-numpy,Yusa95/numpy,ahaldane/numpy,KaelChen/numpy,larsmans/numpy,ViralLeadership/numpy,mhvk/numpy,stuarteberg/numpy,charris/numpy,ssanderson/numpy,solarjoe/numpy,solarjoe/numpy,bmorris3/numpy,sigma-random/numpy,NextThought/pypy-numpy,sinhrks/numpy,dwillmer/numpy,pizzathief/numpy,matthew-brett/numpy,CMartelLML/numpy,madphysicist/numpy,jankoslavic/numpy,rherault-insa/numpy,simongibbons/numpy,ddasilva/numpy,MSeifert04/numpy,ewmoore/numpy,skwbc/numpy,GaZ3ll3/numpy,githubmlai/numpy,yiakwy/numpy,moreati/numpy,bertrand-l/numpy,NextThought/pypy-numpy,skymanaditya1/numpy,has2k1/numpy,ogrisel/numpy,SiccarPoint/numpy,BMJHayward/numpy,MichaelAquilina/numpy,sigma-random/numpy,Eric89GXL/numpy,shoyer/numpy,rmcgibbo/numpy,yiakwy/numpy,mathdd/numpy,astrofrog/numpy,sigma-random/numpy,ajdawson/numpy,sonnyhu/numpy,Eric89GXL/numpy,pdebuyl/numpy,ahaldane/numpy,Anwesh43/numpy,rmcgibbo/numpy,pbrod/numpy,madphysicist/numpy,brandon-rhodes/numpy,ewmoore/numpy,kirillzhuravlev/numpy,immerrr/numpy,BabeNovelty/numpy,mingwpy/numpy,felipebetancur/numpy,bringingheavendown/numpy,pdebuyl/numpy,nguyentu1602/numpy,anntzer/numpy,dwillmer/numpy,MaPePeR/numpy,cowlicks/numpy,bringingheavendown/numpy,jankoslavic/numpy,moreati/numpy,WillieMaddox/numpy,ogrisel/numpy,ChanderG/numpy,mwiebe/numpy,groutr/numpy,MaPePeR/numpy,kirillzhuravlev/numpy,pizzathief/numpy,leifdenby/numpy,jakirkham/numpy,dwillmer/numpy,SiccarPoint/numpy,jschueller/numpy,anntzer/numpy,gmcastil/numpy,endolith/numpy,mwiebe/numpy,andsor/numpy,mortada/numpy,AustereCuriosity/numpy,mortada/numpy,ChanderG/numpy,pelson/numpy,KaelChen/numpy,dwf/numpy,stuarteberg/numpy,numpy/numpy,bertrand-l/numpy,dato-code/numpy,hainm/numpy,cjermain/numpy,jorisvandenbossche/numpy,SunghanKim/numpy,solarjoe/numpy,rhythmsosad/numpy,naritta/numpy,maniteja123/numpy,argriffing/numpy,simongibbons/numpy,Linkid/numpy,rhythmsosad/numpy,brandon-rhodes/numpy,dwf/numpy,immerrr/numpy,ekalosak/numpy,ViralLeadership/numpy,jankoslavic/numpy,ahaldane/numpy,jonathanunderwood/numpy,mortada/numpy,chiffa/numpy,ContinuumIO/numpy,sinhrks/numpy,skymanaditya1/numpy,groutr/numpy,larsmans/numpy,CMartelLML/numpy,pbrod/numpy,rajathkumarmp/numpy,stuarteberg/numpy,drasmuss/numpy,jschueller/numpy,dwf/numpy,tacaswell/numpy,KaelChen/numpy,astrofrog/numpy,ChanderG/numpy,MaPePeR/numpy,dimasad/numpy,embray/numpy,mhvk/numpy,mattip/numpy,kirillzhuravlev/numpy,abalkin/numpy,utke1/numpy,bertrand-l/numpy,jankoslavic/numpy,ekalosak/numpy,WarrenWeckesser/numpy,tdsmith/numpy,ajdawson/numpy,chatcannon/numpy,naritta/numpy,dch312/numpy,behzadnouri/numpy,Anwesh43/numpy,seberg/numpy,mattip/numpy,ogrisel/numpy,BMJHayward/numpy,kiwifb/numpy,ekalosak/numpy,skymanaditya1/numpy,andsor/numpy,trankmichael/numpy,pizzathief/numpy,BabeNovelty/numpy,ChristopherHogan/numpy,ogrisel/numpy,nbeaver/numpy,simongibbons/numpy,gfyoung/numpy,has2k1/numpy,nbeaver/numpy,jorisvandenbossche/numpy,pdebuyl/numpy,jakirkham/numpy,GrimDerp/numpy,abalkin/numpy,SunghanKim/numpy,jonathanunderwood/numpy,grlee77/numpy,MaPePeR/numpy,brandon-rhodes/numpy,cjermain/numpy,bmorris3/numpy,githubmlai/numpy,sigma-random/numpy,bmorris3/numpy,pyparallel/numpy,seberg/numpy,endolith/numpy,mwiebe/numpy,ViralLeadership/numpy,mindw/numpy,GaZ3ll3/numpy,chatcannon/numpy,ssanderson/numpy,rudimeier/numpy,charris/numpy,naritta/numpy,NextThought/pypy-numpy,njase/numpy,stefanv/numpy,CMartelLML/numpy,felipebetancur/numpy,mortada/numpy,ddasilva/numpy,charris/numpy,utke1/numpy,shoyer/numpy,tacaswell/numpy,rgommers/numpy,pelson/numpy,hainm/numpy,utke1/numpy,musically-ut/numpy,mathdd/numpy,pbrod/numpy,KaelChen/numpy,mattip/numpy,felipebetancur/numpy,ESSS/numpy,ajdawson/numpy,sonnyhu/numpy,matthew-brett/numpy,mathdd/numpy,b-carter/numpy,trankmichael/numpy,Eric89GXL/numpy,rudimeier/numpy,grlee77/numpy,dwf/numpy,ChristopherHogan/numpy,immerrr/numpy,Linkid/numpy,rhythmsosad/numpy,hainm/numpy,b-carter/numpy,tynn/numpy,ogrisel/numpy,mhvk/numpy,pbrod/numpy,joferkington/numpy,naritta/numpy,matthew-brett/numpy,MichaelAquilina/numpy,GaZ3ll3/numpy,pyparallel/numpy,nguyentu1602/numpy,MichaelAquilina/numpy,tacaswell/numpy,madphysicist/numpy,tdsmith/numpy,nbeaver/numpy,skwbc/numpy,GrimDerp/numpy,GrimDerp/numpy,yiakwy/numpy,Dapid/numpy,cowlicks/numpy,empeeu/numpy,charris/numpy,dch312/numpy,joferkington/numpy,tynn/numpy,groutr/numpy,andsor/numpy,BabeNovelty/numpy,hainm/numpy,larsmans/numpy,ewmoore/numpy,SunghanKim/numpy,tdsmith/numpy,numpy/numpy,rmcgibbo/numpy,musically-ut/numpy,sonnyhu/numpy,felipebetancur/numpy,jschueller/numpy,pizzathief/numpy,matthew-brett/numpy,grlee77/numpy,jakirkham/numpy,chatcannon/numpy,astrofrog/numpy,ewmoore/numpy,pelson/numpy,bmorris3/numpy,SiccarPoint/numpy,MichaelAquilina/numpy,b-carter/numpy,WarrenWeckesser/numpy,WarrenWeckesser/numpy,rmcgibbo/numpy,maniteja123/numpy,dato-code/numpy,rgommers/numpy,rherault-insa/numpy,behzadnouri/numpy,rudimeier/numpy,tynn/numpy,behzadnouri/numpy,andsor/numpy,jakirkham/numpy,AustereCuriosity/numpy,pelson/numpy,mindw/numpy,MSeifert04/numpy,dato-code/numpy,shoyer/numpy,Yusa95/numpy,GaZ3ll3/numpy,MSeifert04/numpy,musically-ut/numpy,rajathkumarmp/numpy,gfyoung/numpy,jorisvandenbossche/numpy,jakirkham/numpy,pizzathief/numpy,Srisai85/numpy,cjermain/numpy,mindw/numpy,Anwesh43/numpy,kiwifb/numpy,anntzer/numpy,matthew-brett/numpy,gmcastil/numpy,SunghanKim/numpy,dato-code/numpy,cjermain/numpy,Srisai85/numpy,dimasad/numpy,pdebuyl/numpy,sonnyhu/numpy,sinhrks/numpy,ESSS/numpy,CMartelLML/numpy,BMJHayward/numpy,joferkington/numpy,ContinuumIO/numpy,jorisvandenbossche/numpy,sinhrks/numpy,BMJHayward/numpy,Anwesh43/numpy,Yusa95/numpy,gfyoung/numpy,trankmichael/numpy,numpy/numpy,AustereCuriosity/numpy,pelson/numpy,embray/numpy,maniteja123/numpy,ewmoore/numpy,stefanv/numpy,dch312/numpy,trankmichael/numpy,ajdawson/numpy,leifdenby/numpy,ChristopherHogan/numpy,tdsmith/numpy,SiccarPoint/numpy,Srisai85/numpy,has2k1/numpy,cowlicks/numpy,simongibbons/numpy,rgommers/numpy,mhvk/numpy,moreati/numpy,Yusa95/numpy,bringingheavendown/numpy,WarrenWeckesser/numpy,mindw/numpy,njase/numpy,rajathkumarmp/numpy,dwillmer/numpy,Linkid/numpy,larsmans/numpy,gmcastil/numpy,pyparallel/numpy,ssanderson/numpy,ContinuumIO/numpy,leifdenby/numpy,embray/numpy,chiffa/numpy,Srisai85/numpy,pbrod/numpy,GrimDerp/numpy,githubmlai/numpy,githubmlai/numpy,musically-ut/numpy,empeeu/numpy,mingwpy/numpy,jschueller/numpy,simongibbons/numpy,rhythmsosad/numpy,immerrr/numpy,stuarteberg/numpy,dimasad/numpy,Dapid/numpy,mhvk/numpy,yiakwy/numpy,ESSS/numpy,skwbc/numpy,stefanv/numpy,astrofrog/numpy,argriffing/numpy,MSeifert04/numpy,Dapid/numpy,WillieMaddox/numpy,has2k1/numpy,embray/numpy,abalkin/numpy,dwf/numpy,embray/numpy,nguyentu1602/numpy,stefanv/numpy,WillieMaddox/numpy,seberg/numpy
9fd15678a5f149c5ddc5793541c4f3262802e2dd
chapter3/Player.h
chapter3/Player.h
#ifndef __PLAYER_H__ #define __PLAYER_H__ #include<iostream> #include"GameObject.h" class PLayer: public GameObject { public: void update(); void clean() { GameObject::clean(); std::cout << "clean PLayer"; } }; #endif
#ifndef __PLAYER_H__ #define __PLAYER_H__ #include<iostream> #include"GameObject.h" class Player: public GameObject { public: void update(); void clean() { std::cout << "clean PLayer"; } }; #endif
Fix class name and remove GameObject::clean call.
Fix class name and remove GameObject::clean call.
C
bsd-2-clause
caiotava/SDLBook
edca044ab872ca71085167b0e82ac29a4f335b6f
include/llvm/DebugInfo/DIContext.h
include/llvm/DebugInfo/DIContext.h
//===-- DIContext.h ---------------------------------------------*- 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 DIContext, and abstract data structure that holds // debug information data. // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_DICONTEXT_H #define LLVM_DEBUGINFO_DICONTEXT_H #include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/DILineInfo.h" namespace llvm { class raw_ostream; class DIContext { public: virtual ~DIContext(); /// getDWARFContext - get a context for binary DWARF data. static DIContext *getDWARFContext(bool isLittleEndian, StringRef infoSection, StringRef abbrevSection, StringRef aRangeSection = StringRef(), StringRef lineSection = StringRef(), StringRef stringSection = StringRef()); virtual void dump(raw_ostream &OS) = 0; }; } #endif
//===-- DIContext.h ---------------------------------------------*- 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 DIContext, and abstract data structure that holds // debug information data. // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_DICONTEXT_H #define LLVM_DEBUGINFO_DICONTEXT_H #include "llvm/ADT/StringRef.h" namespace llvm { class raw_ostream; class DIContext { public: virtual ~DIContext(); /// getDWARFContext - get a context for binary DWARF data. static DIContext *getDWARFContext(bool isLittleEndian, StringRef infoSection, StringRef abbrevSection, StringRef aRangeSection = StringRef(), StringRef lineSection = StringRef(), StringRef stringSection = StringRef()); virtual void dump(raw_ostream &OS) = 0; }; } #endif
Remove include of header that doesn't exist (yet).
Remove include of header that doesn't exist (yet). git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@139629 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap
25211cc6081e2075ecaf0565733075285a135411
h/mhcachesbr.h
h/mhcachesbr.h
/* * mhcachesbr.h -- definitions for manipulating MIME content cache */ /* * various cache policies */ static struct swit caches[] = { #define CACHE_NEVER 0 { "never", 0, 0 }, #define CACHE_PRIVATE 1 { "private", 0, 0 }, #define CACHE_PUBLIC 2 { "public", 0, 0 }, #define CACHE_ASK 3 { "ask", 0, 0 }, { NULL, 0, 0 } };
/* * mhcachesbr.h -- definitions for manipulating MIME content cache */ /* * various cache policies */ #define CACHE_SWITCHES \ X("never", 0, CACHE_NEVER) \ X("private", 0, CACHE_PRIVATE) \ X("public", 0, CACHE_PUBLIC) \ X("ask", 0, CACHE_ASK) \ #define X(sw, minchars, id) id, DEFINE_SWITCH_ENUM(CACHE); #undef X #define X(sw, minchars, id) { sw, minchars, id }, DEFINE_SWITCH_ARRAY(CACHE, caches); #undef X
Convert the MIME content cache switches over to the smatch() New World Order.
Convert the MIME content cache switches over to the smatch() New World Order.
C
bsd-3-clause
dscho/nmh,dscho/nmh,mcr/nmh,dscho/nmh,dscho/nmh,mcr/nmh
4823e866835c3e9cf8aadbc1d1621554fcbfffde
src/plugins/InstructionCounter.h
src/plugins/InstructionCounter.h
// InstructionCounter.h (Oclgrind) // Copyright (c) 2013-2016, James Price and Simon McIntosh-Smith, // University of Bristol. All rights reserved. // // This program is provided under a three-clause BSD license. For full // license terms please see the LICENSE file distributed with this // source code. #include "core/Plugin.h" namespace llvm { class Function; } namespace oclgrind { class InstructionCounter : public Plugin { public: InstructionCounter(const Context *context) : Plugin(context){}; virtual void instructionExecuted(const WorkItem *workItem, const llvm::Instruction *instruction, const TypedValue& result) override; virtual void kernelBegin(const KernelInvocation *kernelInvocation) override; virtual void kernelEnd(const KernelInvocation *kernelInvocation) override; virtual void workGroupBegin(const WorkGroup *workGroup) override; virtual void workGroupComplete(const WorkGroup *workGroup) override; private: std::vector<size_t> m_instructionCounts; std::vector<size_t> m_memopBytes; std::vector<const llvm::Function*> m_functions; struct WorkerState { std::vector<size_t> *instCounts; std::vector<size_t> *memopBytes; std::vector<const llvm::Function*> *functions; }; static THREAD_LOCAL WorkerState m_state; std::mutex m_mtx; std::string getOpcodeName(unsigned opcode) const; }; }
// InstructionCounter.h (Oclgrind) // Copyright (c) 2013-2016, James Price and Simon McIntosh-Smith, // University of Bristol. All rights reserved. // // This program is provided under a three-clause BSD license. For full // license terms please see the LICENSE file distributed with this // source code. #include "core/Plugin.h" #include <mutex> namespace llvm { class Function; } namespace oclgrind { class InstructionCounter : public Plugin { public: InstructionCounter(const Context *context) : Plugin(context){}; virtual void instructionExecuted(const WorkItem *workItem, const llvm::Instruction *instruction, const TypedValue& result) override; virtual void kernelBegin(const KernelInvocation *kernelInvocation) override; virtual void kernelEnd(const KernelInvocation *kernelInvocation) override; virtual void workGroupBegin(const WorkGroup *workGroup) override; virtual void workGroupComplete(const WorkGroup *workGroup) override; private: std::vector<size_t> m_instructionCounts; std::vector<size_t> m_memopBytes; std::vector<const llvm::Function*> m_functions; struct WorkerState { std::vector<size_t> *instCounts; std::vector<size_t> *memopBytes; std::vector<const llvm::Function*> *functions; }; static THREAD_LOCAL WorkerState m_state; std::mutex m_mtx; std::string getOpcodeName(unsigned opcode) const; }; }
Add missing mutex header include
Add missing mutex header include
C
bsd-3-clause
mpflanzer/Oclgrind,mpflanzer/Oclgrind,mpflanzer/Oclgrind,mpflanzer/Oclgrind
8f26097bd78e456b9cb090803263f3f50b513076
data-structures/trees/binary/node.h
data-structures/trees/binary/node.h
#ifndef _NODE_H_ #define _NODE_H_ template <class T> struct Node { T data; Node<T> *left; Node<T> *right; Node(const T& data, Node<T> *left = nullptr, Node<T> *right = nullptr) : data(data), left(left), right(right) {} }; #endif // _NODE_H_
#ifndef _NODE_H_ #define _NODE_H_ template <class T> struct Node { T data; Node<T> *left; Node<T> *right; Node<T> *parent; Node(const T& data, Node<T> *left = nullptr, Node<T> *right = nullptr, Node<T> *parent = nullptr) : data(data), left(left), right(right), parent(parent) {} }; #endif // _NODE_H_
Update Trees/Node structure to have parent
Update Trees/Node structure to have parent
C
mit
stoimenoff/uni-cpp-samples,stoimenoff/uni-cpp-samples
fe7a5706e33207876ccd8cb9c7b365362f55c3ba
common/MCP23008.h
common/MCP23008.h
// Derived from blog post at http://www.ermicro.com/blog/?p=1239 #ifndef __MCP23008_H__ #define __MCP23008_H__ #include <compat/twi.h> #include "i2c_utils.h" #define MCP23008_ID 0x40 // MCP23008 I2C Device Identifier (0100, fixed) #define MCP23008_ADDR 0x00 // MCP23008 I2C Address (000-111 in bits 3..1) #define MCP23008_IODIR 0x00 // MCP23008 I/O Direction Register #define MCP23008_GPIO 0x09 // MCP23008 General Purpose I/O Register #define MCP23008_OLAT 0x0A // MCP23008 Output Latch Register void write_mcp23008(unsigned char reg_addr,unsigned char data); unsigned char read_mcp23008(unsigned char reg_addr); #endif /*__MCP23008_H__*/
// I/O functions for MCP23008 port expander using I2C/TWI protocol // Derived from blog post at http://www.ermicro.com/blog/?p=1239 #ifndef __MCP23008_H__ #define __MCP23008_H__ #include <compat/twi.h> #include "i2c_utils.h" // About the 7-bit I2C slave address MCP23008: // - The high bits 7..4 are fixed at 0100. // - Bits 3..1 are for further addressing (e.g. eeprom page, jumpered pads) // - Bit 0 is disregarded (the R/W direction is handled separately). // See http://www.avrbeginners.net/architecture/twi/twi.html#addressing #define MCP23008 0x40 // MCP23008 I2C device address #define MCP23008_IODIR 0x00 // MCP23008 I/O Direction Register #define MCP23008_GPIO 0x09 // MCP23008 General Purpose I/O Register #define MCP23008_OLAT 0x0A // MCP23008 Output Latch Register void write_mcp23008(uint8_t reg_addr, uint8_t data); uint8_t read_mcp23008(uint8_t reg_addr); #endif /*__MCP23008_H__*/
Add info on I2C address
Add info on I2C address
C
mit
andrewadare/avr-breadboarding,andrewadare/avr-breadboarding
a2e999b2cae9f2ff7dab4362c052a88b3d7440d3
src/hex_helper.h
src/hex_helper.h
#pragma once #include <string> #include <ostream> #include <iomanip> #include <iostream> struct Hex { Hex(char *buffer, size_t size) : m_buffer(buffer) , m_size(size) { } friend std::ostream& operator <<(std::ostream &os, const Hex &obj) { unsigned char* aschar = (unsigned char*)obj.m_buffer; for (size_t i = 0; i < obj.m_size; ++i) { if (isprint(aschar[i])) { os << aschar[i]; } else { os << std::hex << std::setw(2) << std::setfill('0') << static_cast<unsigned int> (aschar[i]); } } return os; } private: char *m_buffer; size_t m_size; };
#pragma once #include <string> #include <ostream> #include <iomanip> #include <iostream> struct Hex { Hex(char *buffer, size_t size) : m_buffer(buffer) , m_size(size) { } friend std::ostream& operator <<(std::ostream &os, const Hex &obj) { unsigned char* aschar = (unsigned char*)obj.m_buffer; for (size_t i = 0; i < obj.m_size; ++i) { if (isprint(aschar[i])) { os << aschar[i]; } else { os << "\\x" << std::hex << std::setw(2) << std::setfill('0') << static_cast<unsigned int> (aschar[i]); } } return os; } private: char *m_buffer; size_t m_size; };
Add "\x" for hex part.
Add "\x" for hex part.
C
mit
azat/hadoop-io-sequence-reader
e769a3bc613c7c9d7fd650de18a45a65ad8c53c0
src/kmain.c
src/kmain.c
#include "gdt.h" #include "idt.h" #include "vga.h" #include "term_printf.h" void kernel_main() { init_term(); term_puts(NAME " booting..."); term_puts("Initializing GDT..."); init_gdt(); term_puts("Initializing IDT..."); init_idt(); term_printf("term_printf is %d%% p%cre %s\n", 100, 'u', "awesome"); __asm__ volatile ("int $2"); }
#include "gdt.h" #include "idt.h" #include "vga.h" #include "term_printf.h" void notify(void (*func)(), char *str) { term_putsn(str); func(); term_puts(" done"); } void kernel_main() { init_term(); term_puts(NAME " booting..."); notify(init_gdt, "Initializing GDT..."); notify(init_idt, "Initializing IDT..."); term_printf("term_printf is %d%% p%cre %s\n", 100, 'u', "awesome"); __asm__ volatile ("int $2"); }
Add notify() function to print message around function call
Add notify() function to print message around function call
C
mit
orodley/studix,orodley/studix
e7b995835e1b852b8046c9b1dcd25e9dbee99b05
test/Misc/pr32207.c
test/Misc/pr32207.c
// test for r305179 // RUN: %clang_cc1 -emit-llvm -O -mllvm -print-after-all %s -o %t 2>&1 | grep '*** IR Dump After Function Integration/Inlining ***' void foo() {}
// test for r305179 // RUN: %clang_cc1 -emit-llvm -O -mllvm -print-after-all %s -o %t 2>&1 | FileCheck %s // CHECK: *** IR Dump After Function Integration/Inlining *** void foo() {}
Address David Blaikie comment by replacing grep with FileCheck.
Address David Blaikie comment by replacing grep with FileCheck. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@305215 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
f6025874064eec95deb06a7b0d3c76ec03568d12
cpp/module_impl.h
cpp/module_impl.h
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PPAPI_CPP_MODULE_IMPL_H_ #define PPAPI_CPP_MODULE_IMPL_H_ #include "ppapi/cpp/module.h" namespace { template <typename T> class DeviceFuncs { public: explicit DeviceFuncs(const char* ifname) : ifname_(ifname) {} operator T const*() { if (!funcs_) { funcs_ = reinterpret_cast<T const*>( pp::Module::Get()->GetBrowserInterface(ifname_)); } return funcs_; } // This version doesn't check for existence of the function object. It is // used so that, for DeviceFuncs f, the expression: // if (f) f->doSomething(); // checks the existence only once. T const* operator->() const { return funcs_; } private: DeviceFuncs(const DeviceFuncs&other); DeviceFuncs &operator=(const DeviceFuncs &other); const char* ifname_; T const* funcs_; }; } // namespace #endif // PPAPI_CPP_MODULE_IMPL_H_
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PPAPI_CPP_MODULE_IMPL_H_ #define PPAPI_CPP_MODULE_IMPL_H_ #include "ppapi/cpp/module.h" namespace { template <typename T> class DeviceFuncs { public: explicit DeviceFuncs(const char* ifname) : ifname_(ifname), funcs_(NULL) {} operator T const*() { if (!funcs_) { funcs_ = reinterpret_cast<T const*>( pp::Module::Get()->GetBrowserInterface(ifname_)); } return funcs_; } // This version doesn't check for existence of the function object. It is // used so that, for DeviceFuncs f, the expression: // if (f) f->doSomething(); // checks the existence only once. T const* operator->() const { return funcs_; } private: DeviceFuncs(const DeviceFuncs&other); DeviceFuncs &operator=(const DeviceFuncs &other); const char* ifname_; T const* funcs_; }; } // namespace #endif // PPAPI_CPP_MODULE_IMPL_H_
Initialize DeviceFuncs::ifuncs_ to zero in constructor
Initialize DeviceFuncs::ifuncs_ to zero in constructor
C
bsd-3-clause
huqingyu/ppapi,whitewolfm/ppapi,c1soju96/ppapi,dralves/ppapi,huochetou999/ppapi,lag945/ppapi,lag945/ppapi,Xelemsta/ppapi,c1soju96/ppapi,tonyjoule/ppapi,HAfsari/ppapi,xinghaizhou/ppapi,xuesongzhu/ppapi,JustRight/ppapi,fubaydullaev/ppapi,CharlesHuimin/ppapi,huqingyu/ppapi,phisixersai/ppapi,stefanie924/ppapi,lag945/ppapi,dingdayong/ppapi,dingdayong/ppapi,xiaozihui/ppapi,chenfeng8742/ppapi,tonyjoule/ppapi,tiaolong/ppapi,nanox/ppapi,xuesongzhu/ppapi,whitewolfm/ppapi,chenfeng8742/ppapi,cacpssl/ppapi,siweilvxing/ppapi,YachaoLiu/ppapi,dingdayong/ppapi,cacpssl/ppapi,JustRight/ppapi,nanox/ppapi,gwobay/ppapi,rise-worlds/ppapi,dralves/ppapi,c1soju96/ppapi,thdtjsdn/ppapi,whitewolfm/ppapi,qwop/ppapi,xuesongzhu/ppapi,Xelemsta/ppapi,ruder/ppapi,CharlesHuimin/ppapi,whitewolfm/ppapi,dralves/ppapi,YachaoLiu/ppapi,YachaoLiu/ppapi,qwop/ppapi,ruder/ppapi,fubaydullaev/ppapi,huqingyu/ppapi,Xelemsta/ppapi,dralves/ppapi,HAfsari/ppapi,CharlesHuimin/ppapi,xinghaizhou/ppapi,xuesongzhu/ppapi,fubaydullaev/ppapi,lag945/ppapi,tonyjoule/ppapi,phisixersai/ppapi,cacpssl/ppapi,HAfsari/ppapi,phisixersai/ppapi,chenfeng8742/ppapi,xiaozihui/ppapi,gwobay/ppapi,thdtjsdn/ppapi,stefanie924/ppapi,dingdayong/ppapi,qwop/ppapi,huochetou999/ppapi,dralves/ppapi,siweilvxing/ppapi,HAfsari/ppapi,xuesongzhu/ppapi,thdtjsdn/ppapi,xinghaizhou/ppapi,tonyjoule/ppapi,fubaydullaev/ppapi,stefanie924/ppapi,CharlesHuimin/ppapi,rise-worlds/ppapi,CharlesHuimin/ppapi,fubaydullaev/ppapi,nanox/ppapi,gwobay/ppapi,tonyjoule/ppapi,YachaoLiu/ppapi,stefanie924/ppapi,chenfeng8742/ppapi,ruder/ppapi,xiaozihui/ppapi,huqingyu/ppapi,stefanie924/ppapi,gwobay/ppapi,thdtjsdn/ppapi,dingdayong/ppapi,ruder/ppapi,siweilvxing/ppapi,JustRight/ppapi,qwop/ppapi,ruder/ppapi,rise-worlds/ppapi,siweilvxing/ppapi,c1soju96/ppapi,qwop/ppapi,nanox/ppapi,tiaolong/ppapi,JustRight/ppapi,phisixersai/ppapi,tiaolong/ppapi,YachaoLiu/ppapi,huqingyu/ppapi,huochetou999/ppapi,xinghaizhou/ppapi,rise-worlds/ppapi,xinghaizhou/ppapi,huochetou999/ppapi,chenfeng8742/ppapi,thdtjsdn/ppapi,siweilvxing/ppapi,nanox/ppapi,cacpssl/ppapi,rise-worlds/ppapi,tiaolong/ppapi,Xelemsta/ppapi,HAfsari/ppapi,huochetou999/ppapi,xiaozihui/ppapi,gwobay/ppapi,c1soju96/ppapi,xiaozihui/ppapi,lag945/ppapi,tiaolong/ppapi,whitewolfm/ppapi,cacpssl/ppapi,phisixersai/ppapi,JustRight/ppapi,Xelemsta/ppapi
d8c827d14f834891b674054bc2bae8c8fa91d86c
base/418/getCursorPosition.c
base/418/getCursorPosition.c
int getCursorPosition(int *rows, int *cols) { }
// // Use the ESC [6n escape sequence to query the horizontal cursor position // and return it. On error -1 is returned, on success the position of the // cursor is stored at *rows and *cols and 0 is returned. // int getCursorPosition(int ifd, int ofd, int *rows, int *cols) { char buf[32]; unsigned int i = 0; /* Report cursor location */ if (write(ofd, "\x1b[6n", 4) != 4) return -1; /* Read the response: ESC [ rows ; cols R */ while (i < sizeof(buf)-1) { if (read(ifd,buf+i,1) != 1) break; if (buf[i] == 'R') break; i++; } buf[i] = '\0'; /* Parse it. */ if (buf[0] != ESC || buf[1] != '[') return -1; if (sscanf(buf+2,"%d;%d",rows,cols) != 2) return -1; return 0; }
Add changes to correct changes
Add changes to correct changes
C
bsd-2-clause
eingaeph/pip.imbue.hood,eingaeph/pip.imbue.hood
6eabd231276a1206adcca059a9efe9a95c61172b
src/lib/gcc/udivdi3.c
src/lib/gcc/udivdi3.c
/** * @file * @brief * * @date 16.05.12 * @author Anton Bondarev * @author Ilia Vaprol */ #include <limits.h> #include <stdint.h> #define MASK_DWORD (uint64_t)1 << ((WORD_BIT * 2) - 1) uint64_t __udivdi3(uint64_t num, uint64_t den) { uint64_t result = 0; int steps; if (den == 0) { return 0; } steps = 0; result = 0; while (!(den & MASK_DWORD)) { den <<= 1; ++steps; } do { result <<= 1; if (num >= den) { result |= 1; num -= den; } den >>= 1; } while (steps--); return result; }
/** * @file * @brief * * @date 16.05.12 * @author Anton Bondarev * @author Ilia Vaprol */ #include <stdint.h> uint64_t __udivdi3(uint64_t num, uint64_t den) { uint64_t result = 0; int steps; if (den == 0) { return 0; } steps = 0; result = 0; while (!(den & 0x8000000000000000)) { den <<= 1; ++steps; } do { result <<= 1; if (num >= den) { result |= 1; num -= den; } den >>= 1; } while (steps--); return result; }
Revert __udivi3 (word in compiler always 32 bit)
Revert __udivi3 (word in compiler always 32 bit)
C
bsd-2-clause
abusalimov/embox,gzoom13/embox,abusalimov/embox,Kefir0192/embox,Kakadu/embox,embox/embox,vrxfile/embox-trik,abusalimov/embox,gzoom13/embox,vrxfile/embox-trik,Kefir0192/embox,embox/embox,gzoom13/embox,Kefir0192/embox,Kakadu/embox,Kefir0192/embox,vrxfile/embox-trik,vrxfile/embox-trik,Kakadu/embox,Kefir0192/embox,mike2390/embox,embox/embox,Kakadu/embox,Kakadu/embox,embox/embox,Kakadu/embox,abusalimov/embox,Kakadu/embox,abusalimov/embox,vrxfile/embox-trik,Kefir0192/embox,gzoom13/embox,vrxfile/embox-trik,mike2390/embox,embox/embox,gzoom13/embox,mike2390/embox,vrxfile/embox-trik,gzoom13/embox,mike2390/embox,gzoom13/embox,mike2390/embox,abusalimov/embox,mike2390/embox,embox/embox,Kefir0192/embox,mike2390/embox
b04346e8ee67e96ed73c351bd8542a00f9c97aee
algorithms/automorphic.c
algorithms/automorphic.c
/* * Author: hx1997 * Desc: жһȻǷΪƽԸβ */ #include <stdio.h> int is_automorphic(long int num) { long int sqrd = num * num; int lsig_digit, lsig_digit_sqrd; if(num > 44720) return -1; for(; num > 0; num /= 10, sqrd /= 10) { lsig_digit = num % 10; lsig_digit_sqrd = sqrd % 10; if(lsig_digit != lsig_digit_sqrd) return 0; } return 1; } int main(void) { int num_to_check; printf("Input a non-negative integer less than 44720: "); scanf(" %d", &num_to_check); if(num_to_check > 44720) printf("Invalid input.\n"); else printf("%d is%s an automorphic number.\n", num_to_check, (is_automorphic(num_to_check) ? "" : " not")); return 0; }
/* * Author: hx1997 * Desc: жһȻǷΪƽԸβ */ #include <stdio.h> int is_automorphic(int num) { int sqrd = num * num; int lsig_digit; int lsig_digit_sqrd; if(num > 44720) return -1; for(; num > 0; num /= 10, sqrd /= 10) { lsig_digit = num % 10; lsig_digit_sqrd = sqrd % 10; if(lsig_digit != lsig_digit_sqrd) return 0; } return 1; } int main(void) { int num_to_check; printf("Input a non-negative integer less than 44720: "); scanf(" %d", &num_to_check); if(num_to_check > 44720) printf("Invalid input.\n"); else printf("%d is%s an automorphic number.\n", num_to_check, (is_automorphic(num_to_check) ? "" : " not")); return 0; }
Change long int to int
Automorphic: Change long int to int
C
mit
hx1997/random-dump
6e65e1047f861d4db87ad0154c171ac66d53b649
test/Analysis/diagnostics/shortest-path-suppression.c
test/Analysis/diagnostics/shortest-path-suppression.c
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=true -analyzer-output=text -verify %s // expected-no-diagnostics int *returnNull() { return 0; } int coin(); // Use a float parameter to ensure that the value is unknown. This will create // a cycle in the generated ExplodedGraph. void testCycle(float i) { int *x = returnNull(); int y; while (i > 0) { x = returnNull(); y = 2; i -= 1; } *x = 1; // no-warning y += 1; }
Add a test case for diagnostic suppression on a graph with cycles.
[analyzer] Add a test case for diagnostic suppression on a graph with cycles. (see previous commit) git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@177449 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
0cb4362412abfc45e019fc8e4bd3b1c551662bf7
iOS/PlayPlan/PublicViews/SideMenu.h
iOS/PlayPlan/PublicViews/SideMenu.h
// // SideMenu.h // PlayPlan // // Created by Zeacone on 15/11/19. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @interface SideMenu : UIView @end
// // SideMenu.h // PlayPlan // // Created by Zeacone on 15/11/19. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @protocol SideMenuDelegate <NSObject> - (void)sideMenu:(UIButton *)menu title:(NSString *)title; @end @interface SideMenu : UIView @property (nonatomic, assign) id<SideMenuDelegate> delegate; @end
Add delegate for side menu.
Add delegate for side menu.
C
mit
Zeacone/PlayPlan,Zeacone/PlayPlan
a29854ca7310d02cf452582cebe80c1de21294cf
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 101 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 102 #endif
Update Skia milestone to 102
Update Skia milestone to 102 Change-Id: Ie332216b5338b1538de9ef07a34a28854c7c805a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522137 Reviewed-by: Kevin Lubick <[email protected]>
C
bsd-3-clause
google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia
2cd50fa07e9364b98c99643a006fdea5e079ff31
hittop/parser/parser.h
hittop/parser/parser.h
// Defines the generic Parser interface for the Casper parser generator library. // #ifndef HITTOP_PARSER_PARSER_H #define HITTOP_PARSER_PARSER_H #include "hittop/parser/parse_error.h" #include "hittop/util/fallible.h" namespace hittop { namespace parser { using util::Fallible; /// The form of a Parser class. There is no generic implementation of Parser, /// only partial and full specializations that define how to parse specific /// grammars. template <typename Grammar> class Parser; /// Convenience wrapper around defining a new Parser object and invoking it on /// the given input range. Allows the invocation operator defined on /// Parser<Grammer> to be non-const, as the parser instance created within this /// function is itself non-const. template <typename Grammar, typename Range> auto Parse(const Range &input) -> decltype(std::declval<Parser<Grammar>>()(input)) { Parser<Grammar> parser; return parser(input); } } // namespace parser } // namespace hittop #endif // HITTOP_PARSER_PARSER_H
// Defines the generic Parser interface for the Casper parser generator library. // #ifndef HITTOP_PARSER_PARSER_H #define HITTOP_PARSER_PARSER_H #include "boost/range/as_literal.hpp" #include "hittop/parser/parse_error.h" #include "hittop/util/fallible.h" namespace hittop { namespace parser { using util::Fallible; /// The form of a Parser class. There is no generic implementation of Parser, /// only partial and full specializations that define how to parse specific /// grammars. template <typename Grammar> class Parser; /// Convenience wrapper around defining a new Parser object and invoking it on /// the given input range. Allows the invocation operator defined on /// Parser<Grammer> to be non-const, as the parser instance created within this /// function is itself non-const. template <typename Grammar, typename Range> auto Parse(const Range &input) -> decltype(std::declval<Parser<Grammar>>()(input)) { Parser<Grammar> parser; return parser(input); } /// Convenience function that parsers a C string as a literal character range. template <typename Grammar> auto Parse(const char *input) -> decltype(Parse<Grammar>(boost::as_literal(input))) { return Parse<Grammar>(boost::as_literal(input)); } } // namespace parser } // namespace hittop #endif // HITTOP_PARSER_PARSER_H
Add convenience overload of Parse that accepts c-string literals
Add convenience overload of Parse that accepts c-string literals
C
apache-2.0
hittop/hittop,hittop/hittop
76f394247acc79e003beeb06fa286f246ea7685a
test2/code_gen/dead_code_elim.c
test2/code_gen/dead_code_elim.c
// RUN: %ocheck 3 %s g() { return 3; } main() { if(0){ f(); // shouldn't hit a linker error here - dead code a: return g(); } goto a; }
// RUN: %ocheck 3 %s -g // test debug emission too g() { return 3; } main() { if(0){ int i; f(); // shouldn't hit a linker error here - dead code a: i = 2; return g(i); } goto a; }
Test debug label emission with local variables
Test debug label emission with local variables
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
80867bf2320444893e7248bead8b63aec23993a4
core/base/inc/RVersion.h
core/base/inc/RVersion.h
#ifndef ROOT_RVersion #define ROOT_RVersion /* Version information automatically generated by installer. */ /* * These macros can be used in the following way: * * #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4) * #include <newheader.h> * #else * #include <oldheader.h> * #endif * */ #define ROOT_RELEASE "5.34/22" #define ROOT_RELEASE_DATE "Oct 10 2014" #define ROOT_RELEASE_TIME "15:29:14" #define ROOT_SVN_REVISION 49361 #define ROOT_GIT_COMMIT "v5-34-21-104-gf821c17" #define ROOT_GIT_BRANCH "heads/v5-34-00-patches" #define ROOT_VERSION_CODE 336406 #define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif
#ifndef ROOT_RVersion #define ROOT_RVersion /* Version information automatically generated by installer. */ /* * These macros can be used in the following way: * * #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4) * #include <newheader.h> * #else * #include <oldheader.h> * #endif * */ #define ROOT_RELEASE "5.34/23" #define ROOT_RELEASE_DATE "Nov 7 2014" #define ROOT_RELEASE_TIME "15:06:58" #define ROOT_SVN_REVISION 49361 #define ROOT_GIT_COMMIT "v5-34-22-106-g4a0dea3" #define ROOT_GIT_BRANCH "heads/v5-34-00-patches" #define ROOT_VERSION_CODE 336407 #define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif
Update ROOT version files to v5.34/23.
Update ROOT version files to v5.34/23.
C
lgpl-2.1
tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot
cd24cba0c92904ec7ee0a521d7074b3e232261ca
src/modules/conf_theme/e_int_config_theme.h
src/modules/conf_theme/e_int_config_theme.h
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void e_int_config_theme_update(E_Config_Dialog *dia, char *file); #endif #endif
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void e_int_config_theme_update(E_Config_Dialog *dia, char *file); EAPI void e_int_config_theme_web_done(E_Config_Dialog *dia); #endif #endif
Declare public function in header.
Declare public function in header. SVN revision: 35475
C
bsd-2-clause
rvandegrift/e,FlorentRevest/Enlightenment,tasn/enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment
d6846332e576ae56a8b9e73d746bec7305c92900
extensions/ringopengl/opengl11/ring_opengl11.c
extensions/ringopengl/opengl11/ring_opengl11.c
#include "ring.h" /* OpenGL 1.1 Extension Copyright (c) 2017 Mahmoud Fayed <[email protected]> */ #include <GL/glew.h> #include <GL/glut.h> RING_FUNC(ring_get_gl_zero) { RING_API_RETNUMBER(GL_ZERO); } RING_API void ringlib_init(RingState *pRingState) { ring_vm_funcregister("get_gl_zero",ring_get_gl_zero); }
Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_ZERO
Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_ZERO
C
mit
ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring
ba796b0f15918634fdab02132879016a50183ba4
include/libk/physical_allocator.h
include/libk/physical_allocator.h
#ifndef PHYSICAL_ALLOCATOR_H #define PHYSICAL_ALLOCATOR_H typedef uint32_t page_frame_t; #define PAGE_FRAME_CACHE_SIZE 32 #define PAGE_FRAME_MAP_SIZE (PHYS_MEMORY_SIZE/8/PAGE_SIZE) // Linear search of page frame bitmap page_frame_t alloc_frame_helper(); void free_frame(page_frame_t frame); page_frame_t alloc_frame(); void use_frame(page_frame_t frame); #endif
#ifndef PHYSICAL_ALLOCATOR_H #define PHYSICAL_ALLOCATOR_H #include <stdint.h> #include <stddef.h> #include <libk/kabort.h> #include <libk/kassert.h> #include <libk/kputs.h> #ifdef ARCH_X86 #include <arch/x86/memlayout.h> #endif #ifdef ARCH_USERLAND #include "tests/memlayout.h" #endif typedef uint32_t page_frame_t; #define BIT_INDEX(x) (1 << ((x) % 8)) #define BYTE_INDEX(x) ((x)/8) #define PAGE_FRAME_CACHE_SIZE 32 #define PAGE_FRAME_MAP_SIZE (PHYS_MEMORY_SIZE/8/PAGE_SIZE) // Linear search of page frame bitmap page_frame_t alloc_frame_helper(); void free_frame(page_frame_t frame); page_frame_t alloc_frame(); void use_frame(page_frame_t frame); #endif
Create macros for certain repetitive shifts
Create macros for certain repetitive shifts
C
mit
awensaunders/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth
12a7262f437f301f6004fb06a4634543685e532e
tests/apps/seh.c
tests/apps/seh.c
/************************************************************************** * * Copyright 2015 Jose Fonseca * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, 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 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 NON-INFRINGEMENT. NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OF OR CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * **************************************************************************/ #include <windows.h> int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { RaiseException(100, EXCEPTION_NONCONTINUABLE, 0, NULL); return 0; }
/************************************************************************** * * Copyright 2015 Jose Fonseca * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, 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 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 NON-INFRINGEMENT. NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OF OR CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * **************************************************************************/ #include <windows.h> int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { RaiseException(0xE0000001, EXCEPTION_NONCONTINUABLE, 0, NULL); return 0; }
Use a better custom exception code.
test/apps: Use a better custom exception code.
C
lgpl-2.1
jrfonseca/drmingw,jrfonseca/drmingw,jrfonseca/drmingw,jrfonseca/drmingw
aca5c7bac87a1b2fb4e9c6daa43f61ea0c021dd1
kernel/muen/muen-block.c
kernel/muen/muen-block.c
/* * Copyright (c) 2017 Contributors as noted in the AUTHORS file * * This file is part of Solo5, a unikernel base layer. * * Permission to use, copy, modify, and/or distribute this software * for any purpose with or without fee is hereby granted, provided * that the above copyright notice and this permission notice appear * in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 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. */ #include "../kernel.h" /* ukvm block interface */ int solo5_blk_write_sync(uint64_t sec __attribute__((unused)), uint8_t *data __attribute__((unused)), int n __attribute__((unused))) { return -1; } int solo5_blk_read_sync(uint64_t sec __attribute__((unused)), uint8_t *data __attribute__((unused)), int *n __attribute__((unused))) { return -1; } int solo5_blk_sector_size(void) { return -1; } uint64_t solo5_blk_sectors(void) { return 0; } int solo5_blk_rw(void) { return -1; }
Add dummy block implementation for Muen
Add dummy block implementation for Muen For now there is no support for block devices on the Muen platform.
C
isc
Solo5/solo5,djwillia/solo5,Solo5/solo5,mato/solo5,mato/solo5,Weichen81/solo5,Weichen81/solo5,mato/solo5,djwillia/solo5,Weichen81/solo5,djwillia/solo5
fd94904f4bffbcd8eec0ce025e7123fcb7569c03
tests/regression/06-symbeq/24-escape_rc.c
tests/regression/06-symbeq/24-escape_rc.c
// PARAM: --set ana.activated[+] "'var_eq'" // Copy of 04/45 with var_eq enabled // octApron needs to be included again and fixed #include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int *p = (int *) arg; pthread_mutex_lock(&mutex1); (*p)++; pthread_mutex_unlock(&mutex1); return NULL; } int main(void) { pthread_t id; int i = 0; pthread_create(&id, NULL, t_fun, (void *) &i); pthread_mutex_lock(&mutex2); assert(i == 0); // UNKNOWN! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; }
// PARAM: --set ana.activated[+] "'var_eq'" // Copy of 04/45 with var_eq enabled #include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int *p = (int *) arg; pthread_mutex_lock(&mutex1); (*p)++; pthread_mutex_unlock(&mutex1); return NULL; } int main(void) { pthread_t id; int i = 0; pthread_create(&id, NULL, t_fun, (void *) &i); pthread_mutex_lock(&mutex2); assert(i == 0); // UNKNOWN! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; }
Remove outdated octApron comment from 06/24
Remove outdated octApron comment from 06/24
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
9ad7e0d7b5652d3279d227a1537c3b39b8cad1d0
test/Sema/crash-invalid-array.c
test/Sema/crash-invalid-array.c
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify %s // PR6913 #include <stdio.h> int main() { int x[10][10]; int (*p)[] = x; int i; for(i = 0; i < 10; ++i) { p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int []'}} } } // rdar://13705391 void foo(int a[*][2]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo1(int a[2][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo2(int a[*][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo3(int a[2][*][2]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}} void foo4(int a[2][*][*]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}}
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // PR6913 int main() { int x[10][10]; int (*p)[] = x; int i; for(i = 0; i < 10; ++i) { p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int []'}} } } // rdar://13705391 void foo(int a[*][2]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo1(int a[2][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo2(int a[*][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo3(int a[2][*][2]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}} void foo4(int a[2][*][*]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}}
Remove an old stdio.h include from the invalid-array test
Remove an old stdio.h include from the invalid-array test This should get it up and running on win and other builders without system headers. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@196738 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
d3464b2f5f46a6db68f66a62e9d130b744cc6594
src/executeStage.h
src/executeStage.h
/* * File: executeStage.h * Author: Alex Savarda */ #define INSTR_COUNT 16 // Possible size of the instruction set #ifndef EXECUTESTAGE_H #define EXECUTESTAGE_H typedef struct { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; } eregister; struct E { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; }; // Function prototypes eregister getEregister(void); void clearEregister(void); void executeStage(); void initFuncPtrArray(void); void updateEregister(unsigned int stat, unsigned int icode, unsigned int ifun, unsigned int valC, unsigned int valA, unsigned int valB, unsigned int dstE, unsigned int dstM, unsigned int srcA, unsigned int srcB); #endif /* EXECUTESTAGE_H */
/* * File: executeStage.h * Author: Alex Savarda */ #define INSTR_COUNT 16 // Possible size of the instruction set #ifndef EXECUTESTAGE_H #define EXECUTESTAGE_H typedef struct { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; } eregister; struct E { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; }; // Function prototypes eregister getEregister(void); void clearEregister(void); void executeStage(); void initFuncPtrArray(void); void updateEregister(unsigned int stat, unsigned int icode, unsigned int ifun, unsigned int valC, unsigned int valA, unsigned int valB, unsigned int dstE, unsigned int dstM, unsigned int srcA, unsigned int srcB); #endif /* EXECUTESTAGE_H */
Convert a tab into a space
Convert a tab into a space
C
isc
sbennett1990/YESS,sbennett1990/YESS,sbennett1990/YESS
c0355a5eb3d8787fbd9bcac928e649b3381f73a3
modlib.h
modlib.h
/* This is main header file that is ought to be included as library */ //Include proper header files #include <string.h> #include <stdlib.h> #include <inttypes.h> #include "parser.h" //Function prototypes extern uint16_t MODBUSSwapEndian( uint16_t ); extern uint16_t MODBUSCRC16( uint16_t *, uint16_t );
/* This is main header file that is ought to be included as library */ //Include proper header files #include <string.h> #include <stdlib.h> #include <inttypes.h> //Function prototypes extern uint16_t MODBUSSwapEndian( uint16_t ); extern uint16_t MODBUSCRC16( uint8_t *, uint16_t );
Remove inclusion of 'parser.h' and fix pointer type
Remove inclusion of 'parser.h' and fix pointer type
C
mit
Jacajack/modlib
d7a05b9d921d191923ded5e9770339a0bebca33b
ComponentImplementationInclude.h
ComponentImplementationInclude.h
#include "Components.h" class HealthComponent : public HealthComponentBase { public: HealthComponent(Entity* entity, int maxHealth, int startHealth, const int& Health): HealthComponentBase(entity, maxHealth, startHealth, Health) { } void OnHeal(int amount) { } void OnDamage(int amount) { } void AttribHealth(int health) { } }; class MonsterDieComponent : public MonsterDieComponentBase { public: MonsterDieComponent(Entity* entity): MonsterDieComponentBase(entity) { } void OnDie() { } };
#include "Components.h" class HealthComponent : public HealthComponentBase { public: HealthComponent(Entity* entity, int maxHealth, int startHealth, const int& Health): HealthComponentBase(entity, maxHealth, startHealth, Health) { } void HandleHeal(int amount) { } void HandleDamage(int amount) { } void AttribHealth(int health) { } }; class MonsterDieComponent : public MonsterDieComponentBase { public: MonsterDieComponent(Entity* entity): MonsterDieComponentBase(entity) { } void HandleDie() { } };
Fix the small test to use Handle instead of On
Fix the small test to use Handle instead of On
C
bsd-3-clause
DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain
4bb3e5fe554bc5d9e54924456a8711c3e40e6191
hard_way/ex15.c
hard_way/ex15.c
#include <stdio.h> int main(int argc, char *argv[]){ //create two arrays we care about int ages[] = {23,55,15,34,78,12}; char *names[] = { "Feinb", "Fhilp", "Wastan", "Wustak","Henris","Abkar" }; //safely get the size of ages int count = sizeof(ages) / sizeof(int); int i = 0; //first way using indexing for(i = 0; i < count; i++){ printf("%s had lived for %d years.\n", names[i], ages[i]); } printf("---\n"); return 0; }
#include <stdio.h> int main(int argc, char *argv[]){ //create two arrays we care about int ages[] = {23,55,15,34,78,12}; char *names[] = { "Feinb", "Fhilp", "Wastan", "Wustak","Henris","Abkar" }; //safely get the size of ages int count = sizeof(ages) / sizeof(int); int i = 0; //first way using indexing for(i = 0; i < count; i++){ printf("%s has lived for %d years.\n", names[i], ages[i]); } printf("---\n"); //setup pointers to the start of the arrays int *cur_age = ages; char **cur_name = names; // second way using pointers for(i = 0; i < count; i++){ printf("%s is %d years old.\n", *(cur_name+i), *(cur_age+i)); } printf("---\n"); return 0; }
Use pointers to start of arrays
Use pointers to start of arrays
C
mit
thewazir/learning_c
93802e24742842db185ead1cf18db9827a3d8664
include/IFile.h
include/IFile.h
#ifndef IFILE_H #define IFILE_H #include <vector> #include <memory> #include "IMediaLibrary.h" #include "ITrackInformation.h" class IAlbumTrack; class IShowEpisode; class ITrackInformation; class IFile { public: enum Type { VideoType, // Any video file, not being a tv show episode AudioType, // Any kind of audio file, not being an album track ShowEpisodeType, AlbumTrackType, UnknownType, }; virtual ~IFile() {} virtual unsigned int id() const = 0; virtual AlbumTrackPtr albumTrack() = 0; virtual bool setAlbumTrack(AlbumTrackPtr albumTrack ) = 0; virtual unsigned int duration() const = 0; virtual std::shared_ptr<IShowEpisode> showEpisode() = 0; virtual bool setShowEpisode( ShowEpisodePtr showEpisode ) = 0; virtual int playCount() const = 0; virtual const std::string& mrl() const = 0; virtual bool addLabel( LabelPtr label ) = 0; virtual bool removeLabel( LabelPtr label ) = 0; virtual MoviePtr movie() = 0; virtual bool setMovie( MoviePtr movie ) = 0; virtual std::vector<std::shared_ptr<ILabel> > labels() = 0; }; #endif // IFILE_H
#ifndef IFILE_H #define IFILE_H #include <vector> #include <memory> #include "IMediaLibrary.h" #include "ITrackInformation.h" class IAlbumTrack; class IShowEpisode; class ITrackInformation; class IFile { public: enum Type { VideoType, // Any video file, not being a tv show episode AudioType, // Any kind of audio file, not being an album track ShowEpisodeType, AlbumTrackType, UnknownType }; virtual ~IFile() {} virtual unsigned int id() const = 0; virtual AlbumTrackPtr albumTrack() = 0; virtual bool setAlbumTrack(AlbumTrackPtr albumTrack ) = 0; virtual unsigned int duration() const = 0; virtual std::shared_ptr<IShowEpisode> showEpisode() = 0; virtual bool setShowEpisode( ShowEpisodePtr showEpisode ) = 0; virtual int playCount() const = 0; virtual const std::string& mrl() const = 0; virtual bool addLabel( LabelPtr label ) = 0; virtual bool removeLabel( LabelPtr label ) = 0; virtual MoviePtr movie() = 0; virtual bool setMovie( MoviePtr movie ) = 0; virtual std::vector<std::shared_ptr<ILabel> > labels() = 0; }; #endif // IFILE_H
Fix a warning with -pedantic on some old gcc versions
Fix a warning with -pedantic on some old gcc versions
C
lgpl-2.1
chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary
2803a40fe335a29f9584911d1a52856bdb302df7
webrtc/modules/audio_coding/codecs/ilbc/nearest_neighbor.c
webrtc/modules/audio_coding/codecs/ilbc/nearest_neighbor.c
/* * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /****************************************************************** iLBC Speech Coder ANSI-C Source Code WebRtcIlbcfix_NearestNeighbor.c ******************************************************************/ #include "defines.h" void WebRtcIlbcfix_NearestNeighbor(size_t* index, const size_t* array, size_t value, size_t arlength) { size_t min_diff = (size_t)-1; for (size_t i = 0; i < arlength; i++) { const size_t diff = (array[i] < value) ? (value - array[i]) : (array[i] - value); if (diff < min_diff) { *index = i; min_diff = diff; } } }
/* * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /****************************************************************** iLBC Speech Coder ANSI-C Source Code WebRtcIlbcfix_NearestNeighbor.c ******************************************************************/ #include "defines.h" void WebRtcIlbcfix_NearestNeighbor(size_t* index, const size_t* array, size_t value, size_t arlength) { size_t i; size_t min_diff = (size_t)-1; for (i = 0; i < arlength; i++) { const size_t diff = (array[i] < value) ? (value - array[i]) : (array[i] - value); if (diff < min_diff) { *index = i; min_diff = diff; } } }
Fix ChromeOS build (C99 break)
Fix ChromeOS build (C99 break) BUG=5016 [email protected] Review URL: https://codereview.webrtc.org/1354163002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#9992}
C
bsd-3-clause
TimothyGu/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc
405107c556390b65fecb7b20c8d7c33d53c34b9e
include/chewing-compat.h
include/chewing-compat.h
/* * chewing-compat.h * * Copyright (c) 2014 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ #ifndef _CHEWING_COMPAT_ #define _CHEWING_COMPAT_ /** @brief indicate the internal encoding of data processing. * @since 0.3.0 */ #define LIBCHEWING_ENCODING "UTF-8" /* deprecated function. for API compatibility */ CHEWING_API int chewing_zuin_Check(ChewingContext *ctx) DEPRECATED_FOR(chewing_bopomofo_Check); CHEWING_API char *chewing_zuin_String(ChewingContext *, int *zuin_count) DEPRECATED_FOR(chewing_bopomofo_String_static); CHEWING_API int chewing_Init(const char *dataPath, const char *hashPath) DEPRECATED; CHEWING_API void chewing_Terminate() DEPRECATED; CHEWING_API int chewing_Configure(ChewingContext *ctx, ChewingConfigData * pcd) DEPRECATED_FOR(chewing_set_*); CHEWING_API void chewing_set_hsuSelKeyType(ChewingContext *ctx, int mode) DEPRECATED_FOR(chewing_set_selKey); CHEWING_API int chewing_get_hsuSelKeyType(ChewingContext *ctx) DEPRECATED_FOR(chewing_get_selKey); #endif
/* * chewing-compat.h * * Copyright (c) 2014 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ /* *INDENT-OFF* */ #ifndef _CHEWING_COMPAT_ #define _CHEWING_COMPAT_ /* *INDENT-ON* */ /** @brief indicate the internal encoding of data processing. * @since 0.3.0 */ #define LIBCHEWING_ENCODING "UTF-8" /* deprecated function. for API compatibility */ CHEWING_API int chewing_zuin_Check(ChewingContext *ctx) DEPRECATED_FOR(chewing_bopomofo_Check); CHEWING_API char *chewing_zuin_String(ChewingContext *, int *zuin_count) DEPRECATED_FOR(chewing_bopomofo_String_static); CHEWING_API int chewing_Init(const char *dataPath, const char *hashPath) DEPRECATED; CHEWING_API void chewing_Terminate() DEPRECATED; CHEWING_API int chewing_Configure(ChewingContext *ctx, ChewingConfigData * pcd) DEPRECATED_FOR(chewing_set_*); CHEWING_API void chewing_set_hsuSelKeyType(ChewingContext *ctx, int mode) DEPRECATED_FOR(chewing_set_selKey); CHEWING_API int chewing_get_hsuSelKeyType(ChewingContext *ctx) DEPRECATED_FOR(chewing_get_selKey); /* *INDENT-OFF* */ #endif /* *INDENT-ON* */
Add indent comment for header guard
Add indent comment for header guard
C
lgpl-2.1
chewing/libchewing,bbyykk/libtaigi,PingNote/libchewing,czchen/libchewing,cwlin/libchewing,PeterDaveHello/libchewing,simonfork/libchewing,PingNote/libchewing,yan12125/libchewing,yan12125/libchewing,bbyykk/libtaigi,ShengYenPeng/libchewing,Chocobo1/libchewing,mangokingTW/libchewing,cwlin/libchewing,hiunnhue/libchewing,bbyykk/libtaigi,cwlin/libchewing,PeterDaveHello/libchewing,PeterDaveHello/libchewing,yan12125/libchewing,simonfork/libchewing,yan12125/libchewing,chewing/libchewing,kito-cheng/libchewing,mangokingTW/libchewing,PingNote/libchewing,hiunnhue/libchewing,hiunnhue/libchewing,kito-cheng/libchewing,robert501128/libchewing,czchen/libchewing,chewing/libchewing,kito-cheng/libchewing,chewing/libchewing,dimotsai/libchewing,PingNote/libchewing,PeterDaveHello/libchewing,mangokingTW/libchewing,cwlin/libchewing,bbyykk/libtaigi,Chocobo1/libchewing,hiunnhue/libchewing,robert501128/libchewing,czchen/libchewing,czchen/libchewing,Chocobo1/libchewing,ShengYenPeng/libchewing,Chocobo1/libchewing,simonfork/libchewing,hiunnhue/libchewing,dimotsai/libchewing,dimotsai/libchewing,dimotsai/libchewing,Chocobo1/libchewing,simonfork/libchewing,cwlin/libchewing,robert501128/libchewing,kito-cheng/libchewing,robert501128/libchewing,bbyykk/libtaigi,ShengYenPeng/libchewing,ShengYenPeng/libchewing,mangokingTW/libchewing
1fad3482bb25c2d77ac5ceb8b48b6985d91f7f48
sticks.c
sticks.c
#include <stdio.h> typedef struct { int hands[2][2]; int turn; } Sticks; void sticks_create(Sticks *sticks) { sticks->hands[0][0] = 1; sticks->hands[0][1] = 1; sticks->hands[1][0] = 1; sticks->hands[1][1] = 1; sticks->turn = 0; } void sticks_play(Sticks *sticks, int actor, int target) { sticks->hands[!sticks->turn][target] += sticks->hands[sticks->turn][actor]; sticks->turn = !sticks->turn; } int main(void) { Sticks sticks; sticks_create(&sticks); printf("%d\n", sticks.hands[0][0]); printf("%d\n", sticks.turn); sticks_play(&sticks, 0, 1); printf("%d\n", sticks.hands[1][1]); printf("%d\n", sticks.turn); }
#include <stdio.h> typedef struct { int hands[2][2]; int turn; } Sticks; void sticks_create(Sticks *sticks) { sticks->hands[0][0] = 1; sticks->hands[0][1] = 1; sticks->hands[1][0] = 1; sticks->hands[1][1] = 1; sticks->turn = 0; } void sticks_play(Sticks *sticks, int actor, int target) { sticks->hands[!sticks->turn][target] += sticks->hands[sticks->turn][actor]; if (sticks->hands[!sticks->turn][target] >= 5) { sticks->hands[!sticks->turn][target] = 0; } sticks->turn = !sticks->turn; } int main(void) { Sticks sticks; sticks_create(&sticks); printf("%d\n", sticks.hands[0][0]); printf("%d\n", sticks.turn); sticks_play(&sticks, 0, 1); printf("%d\n", sticks.hands[1][1]); printf("%d\n", sticks.turn); }
Kill hands that reach five fingers
Kill hands that reach five fingers
C
mit
tysonzero/c-ann
e838c93903d30eb03b606b9932a2072df0061060
3RVX/Controllers/Volume/VolumeController.h
3RVX/Controllers/Volume/VolumeController.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the current volume level as a float, ranging from 0.0 - 1.0 /// </summary> virtual float Volume() = 0; /// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary> virtual void Volume(float vol) = 0; virtual bool Muted() = 0; virtual void Muted(bool mute) = 0; virtual void ToggleMute() { (Muted() == true) ? Muted(false) : Muted(true); } virtual void AddTransformation(VolumeTransformation *transform) = 0; virtual void RemoveTransformation(VolumeTransformation *transform) = 0; public: static const int MSG_VOL_CHNG = WM_APP + 1080; static const int MSG_VOL_DEVCHNG = WM_APP + 1081; };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the current volume level as a float, ranging from 0.0 - 1.0 /// </summary> virtual float Volume() = 0; /// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary> virtual void Volume(float vol) = 0; virtual bool Muted() = 0; virtual void Muted(bool mute) = 0; virtual void ToggleMute() { (Muted() == true) ? Muted(false) : Muted(true); } virtual void Enabled() = 0; virtual void AddTransformation(VolumeTransformation *transform) = 0; virtual void RemoveTransformation(VolumeTransformation *transform) = 0; public: static const int MSG_VOL_CHNG = WM_APP + 1080; static const int MSG_VOL_DEVCHNG = WM_APP + 1081; };
Add method to check audio device state
Add method to check audio device state
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
7740285e7d73d5637ce04a9f901835f6cd33300f
tests/regression/13-privatized/29-multiple-protecting2-vesal.c
tests/regression/13-privatized/29-multiple-protecting2-vesal.c
// PARAM: --enable ana.int.interval // Copied & modified from 13/24. #include <pthread.h> #include <assert.h> int g2; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t __global_lock = PTHREAD_MUTEX_INITIALIZER; void *t2_fun(void *arg) { pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); g2++; pthread_mutex_unlock(&__global_lock); // Write Mine influence: [[g2, __global_lock], t2_fun, {mutex2}] -> 1 pthread_mutex_lock(&__global_lock); g2--; pthread_mutex_unlock(&__global_lock); // Write Mine influence: [[g2, __global_lock], t2_fun, {mutex2}] -> 0 pthread_mutex_unlock(&mutex2); return NULL; } int main(void) { pthread_t id2; pthread_create(&id2, NULL, t2_fun, NULL); pthread_mutex_lock(&mutex1); pthread_mutex_lock(&__global_lock); // Read & join to g2 Mine influence: [[g2, __global_lock], t2_fun, {mutex2}] -> (0 join 1 = Unknown) assert(0 <= g2); // TODO (widening) assert(g2 <= 1); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); assert(g2 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex2); pthread_mutex_unlock(&mutex1); pthread_join(id2, NULL); return 0; }
Add Vesal's version of 13/24 where mutex-oplus and mutex-meet are more precise than old and mine
Add Vesal's version of 13/24 where mutex-oplus and mutex-meet are more precise than old and mine
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
de9495f69321629067ec16ec41e271eeecca5a22
Source/Headers/InTimeShouldSyntax.h
Source/Headers/InTimeShouldSyntax.h
#import "AsyncActualValue.h" namespace CedarAsync { template<typename T> struct InTimeMarker { T(^actualExpression)(void); const char *fileName; int lineNumber; }; template<typename T> const AsyncActualValue<T> operator,(const InTimeMarker<T> & marker, const Cedar::Matchers::ActualValueMarker & _) { return AsyncActualValue<T>(marker.fileName, marker.lineNumber, marker.actualExpression); } template<typename T> const AsyncActualValueMatchProxy<T> operator,(const AsyncActualValue<T> & actualValue, bool negate) { return negate ? actualValue.to_not : actualValue.to; } template<typename T, typename MatcherType> void operator,(const AsyncActualValueMatchProxy<T> & matchProxy, const MatcherType & matcher) { matchProxy(matcher); } } #ifndef CEDAR_ASYNC_DISALLOW_IN_TIME #define in_time(x) (InTimeMarker<typeof(x)>){^{return x;}, __FILE__, __LINE__} #endif
#import "AsyncActualValue.h" namespace CedarAsync { template<typename T> struct InTimeMarker { T(^actualExpression)(void); const char *fileName; int lineNumber; }; template<typename T> const AsyncActualValue<T> operator,(const InTimeMarker<T> & marker, const Cedar::Matchers::ActualValueMarker & _) { return AsyncActualValue<T>(marker.fileName, marker.lineNumber, marker.actualExpression); } template<typename T> const AsyncActualValueMatchProxy<T> operator,(const AsyncActualValue<T> & actualValue, bool negate) { return negate ? actualValue.to_not : actualValue.to; } template<typename T, typename MatcherType> void operator,(const AsyncActualValueMatchProxy<T> & matchProxy, const MatcherType & matcher) { matchProxy(matcher); } } #ifndef CEDAR_ASYNC_DISALLOW_IN_TIME #define in_time(x) (InTimeMarker<__typeof__(x)>){^{return x;}, __FILE__, __LINE__} #endif
Use __typeof__ since typeof is unavailable in our build
Use __typeof__ since typeof is unavailable in our build
C
mit
cppforlife/CedarAsync,cppforlife/CedarAsync
12f1e5c3a3b2948359da2f87937214ee413db567
native/include/ssl_private.h
native/include/ssl_private.h
/* Copyright 2000-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by 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 SSL_PRIVATE_H #define SSL_PRIVATE_H /* OpenSSL headers */ #include <openssl/ssl.h> #include <openssl/err.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/crypto.h> #include <openssl/evp.h> #include <openssl/rand.h> #include <openssl/x509v3.h> /* Avoid tripping over an engine build installed globally and detected * when the user points at an explicit non-engine flavor of OpenSSL */ #if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT) #include <openssl/engine.h> #endif #endif /* SSL_PRIVATE_H */
/* Copyright 2000-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by 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 SSL_PRIVATE_H #define SSL_PRIVATE_H /* OpenSSL headers */ #include <openssl/ssl.h> #include <openssl/err.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/crypto.h> #include <openssl/evp.h> #include <openssl/rand.h> #include <openssl/x509v3.h> /* Avoid tripping over an engine build installed globally and detected * when the user points at an explicit non-engine flavor of OpenSSL */ #ifndef OPENSSL_NO_ENGINE #include <openssl/engine.h> #endif #endif /* SSL_PRIVATE_H */
Use OpenSSL engine by default.
Use OpenSSL engine by default. git-svn-id: b819289d3a0e8888cd070d2ae628b7cf730b797f@300663 13f79535-47bb-0310-9956-ffa450edef68
C
apache-2.0
apache/tomcat-native,andreydomas/tomcat-native,rmaucher/tomcat-native-openssl,rmaucher/tomcat-native-openssl,rmaucher/tomcat-native-openssl,apache/tomcat-native,apache/tomcat-native,apache/tomcat-native,andreydomas/tomcat-native,andreydomas/tomcat-native,rmaucher/tomcat-native-openssl,andreydomas/tomcat-native,andreydomas/tomcat-native,apache/tomcat-native,rmaucher/tomcat-native-openssl
dd15514211cdcdc037368e6b584dfe79e58f3535
onnx/optimizer/passes/optimize_pass.h
onnx/optimizer/passes/optimize_pass.h
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string name, API_TYPE type) : name(name), type(type) { } virtual void optimize(onnx::ModelProto& mp) {} virtual void optimize(Graph& graph) {} }; }} // namespace onnx::optimization
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string& name, API_TYPE type) : name(name), type(type) { } virtual void optimize(onnx::ModelProto& mp) {} virtual void optimize(Graph& graph) {} }; }} // namespace onnx::optimization
Fix the constructor of OptimizePass
Fix the constructor of OptimizePass
C
apache-2.0
onnx/onnx,onnx/onnx,onnx/onnx,onnx/onnx
4f75fcb3b8847d900a1f45b16e97c80d4e53ddbf
src/automaton.h
src/automaton.h
#ifndef _AUTOMATON_H_ #define _AUTOMATON_H_ /* * type and function definitions for an automaton */ #include "event.h" #include "srpc/srpc.h" typedef struct automaton Automaton; void au_init(void); Automaton *au_create(char *program, RpcConnection rpc, char *ebuf); int au_destroy(unsigned long id); void au_publish(unsigned long id, Event *event); unsigned long au_id(Automaton *au); Automaton *au_au(unsigned long id); RpcConnection au_rpc(Automaton *au); #endif /* _AUTOMATON_H_ */
#ifndef _AUTOMATON_H_ #define _AUTOMATON_H_ /* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * type and function definitions for an automaton */ #include "event.h" #include "srpc/srpc.h" typedef struct automaton Automaton; void au_init(void); Automaton *au_create(char *program, RpcConnection rpc, char *ebuf); int au_destroy(unsigned long id); void au_publish(unsigned long id, Event *event); unsigned long au_id(Automaton *au); Automaton *au_au(unsigned long id); RpcConnection au_rpc(Automaton *au); #endif /* _AUTOMATON_H_ */
Add BSD 3-clause open source header
Add BSD 3-clause open source header
C
bsd-3-clause
fergul/Cache,jsventek/Cache,fergul/Cache,fergul/Cache,jsventek/Cache,jsventek/Cache
4d8786007aab2ffe8dddc5b9ca440e484f8b9b9e
AudioEndPointLibrary/AudioEndPointLibrary.h
AudioEndPointLibrary/AudioEndPointLibrary.h
#include "DefSoundDeviceState.h" #include "AudioEndPointLibraryImpl.h" // This class is exported from the AudioEndPointLibrary.dll namespace AudioEndPoint { class AUDIOENDPOINTLIBRARY_API CAudioEndPointLibrary { public: ~CAudioEndPointLibrary(); HRESULT OnDeviceStateChanged(LPCWSTR pwstr_device_id, DWORD dw_new_state) const; HRESULT OnDeviceAdded(LPCWSTR pwstr_device_id) const; HRESULT OnDeviceRemoved(LPCWSTR pwstr_device_id) const; HRESULT OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstr_default_device_id) const; static CAudioEndPointLibrary& GetInstance(); AudioDeviceList GetPlaybackDevices(DefSound::EDeviceState state) const; AudioDeviceList GetRecordingDevices(DefSound::EDeviceState state) const; HRESULT RegisterNotificationClient() const; HRESULT UnRegisterNotificationClient() const; AudioEndPointLibrarySignals* m_signals1() const { return m_signals; } __declspec(property(get = m_signals1)) AudioEndPointLibrarySignals* Signals; private: CAudioEndPointLibrary(void); CAudioEndPointLibrary(CAudioEndPointLibrary const&) = delete; void operator=(CAudioEndPointLibrary const&) = delete; void Refresh() const; struct AudioEndPointLibraryImpl; struct AudioEndPointLibraryDevicesImpl; AudioEndPointLibraryImpl* m_container; AudioEndPointLibrarySignals* m_signals; AudioEndPointLibraryDevicesImpl* m_devices_lists; }; }
#include "DefSoundDeviceState.h" #include "AudioEndPointLibraryImpl.h" // This class is exported from the AudioEndPointLibrary.dll namespace AudioEndPoint { class AUDIOENDPOINTLIBRARY_API CAudioEndPointLibrary { public: ~CAudioEndPointLibrary(); HRESULT OnDeviceStateChanged(LPCWSTR pwstr_device_id, DWORD dw_new_state) const; HRESULT OnDeviceAdded(LPCWSTR pwstr_device_id) const; HRESULT OnDeviceRemoved(LPCWSTR pwstr_device_id) const; HRESULT OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstr_default_device_id) const; static CAudioEndPointLibrary& GetInstance(); AudioDeviceList GetPlaybackDevices(DefSound::EDeviceState state) const; AudioDeviceList GetRecordingDevices(DefSound::EDeviceState state) const; AudioEndPointLibrarySignals* m_signals1() const { return m_signals; } __declspec(property(get = m_signals1)) AudioEndPointLibrarySignals* Signals; private: CAudioEndPointLibrary(void); CAudioEndPointLibrary(CAudioEndPointLibrary const&) = delete; void operator=(CAudioEndPointLibrary const&) = delete; void Refresh() const; HRESULT RegisterNotificationClient() const; HRESULT UnRegisterNotificationClient() const; struct AudioEndPointLibraryImpl; struct AudioEndPointLibraryDevicesImpl; AudioEndPointLibraryImpl* m_container; AudioEndPointLibrarySignals* m_signals; AudioEndPointLibraryDevicesImpl* m_devices_lists; }; }
Make the registering and unregistering of the Notification private
Make the registering and unregistering of the Notification private
C
mit
Belphemur/AudioEndPointLibrary,Belphemur/AudioEndPointLibrary
db3fecc5b9a06af7b015b241b8ee735b65f786ea
gtk/fallback-c89.c
gtk/fallback-c89.c
/* GTK - The GIMP Toolkit * Copyright (C) 2011 Chun-wei Fan <[email protected]> * * Author: Chun-wei Fan <[email protected]> * * 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 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, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include <math.h> /* Workaround for round() for non-GCC/non-C99 compilers */ #ifndef HAVE_ROUND static inline double round (double x) { if (x >= 0) return floor (x + 0.5); else return ceil (x - 0.5); } #endif /* Workaround for rint() for non-GCC/non-C99 compilers */ #ifndef HAVE_RINT static inline double rint (double x) { if (ceil (x + 0.5) == floor (x + 0.5)) { int a; a = (int) ceil (x); if (a % 2 == 0) return ceil (x); else return floor (x); } else { if (x >= 0) return floor (x + 0.5); else return ceil (x - 0.5); } } #endif
Add fallback implemetation for rint()/round()
Add fallback implemetation for rint()/round() Add an implementation for rint() and round() for compilers that do not define one or both of them. Note that this file should be included after config.h was included.
C
lgpl-2.1
davidgumberg/gtk,davidgumberg/gtk,chergert/gtk,Sidnioulz/SandboxGtk,ebassi/gtk,Distrotech/gtk2,davidt/gtk,alexlarsson/gtk,Lyude/gtk-,Adamovskiy/gtk,jessevdk/gtk,chergert/gtk,Lyude/gtk-,bratsche/gtk-,jadahl/gtk,chergert/gtk,chergert/gtk,jigpu/gtk,grubersjoe/adwaita,jessevdk/gtk,msteinert/gtk,Adamovskiy/gtk,Adamovskiy/gtk,Sidnioulz/SandboxGtk,jessevdk/gtk,Sidnioulz/SandboxGtk,jadahl/gtk,Lyude/gtk-,jadahl/gtk,chergert/gtk,bratsche/gtk-,alexlarsson/gtk,msteinert/gtk,Lyude/gtk-,Distrotech/gtk2,Distrotech/gtk2,Adamovskiy/gtk,bratsche/gtk-,alexlarsson/gtk,jadahl/gtk,bratsche/gtk-,grubersjoe/adwaita,Adamovskiy/gtk,alexlarsson/gtk,alexlarsson/gtk,ahodesuka/gtk,ahodesuka/gtk,Lyude/gtk-,msteinert/gtk,jigpu/gtk,davidt/gtk,grubersjoe/adwaita,Adamovskiy/gtk,msteinert/gtk,msteinert/gtk,Sidnioulz/SandboxGtk,jessevdk/gtk,bratsche/gtk-,grubersjoe/adwaita,ahodesuka/gtk,ebassi/gtk,ebassi/gtk,jigpu/gtk,davidgumberg/gtk,davidt/gtk,ebassi/gtk,Distrotech/gtk2,Lyude/gtk-,bratsche/gtk-,davidgumberg/gtk,grubersjoe/adwaita,jessevdk/gtk,chergert/gtk,jigpu/gtk,davidt/gtk,Distrotech/gtk2,davidt/gtk,ahodesuka/gtk,Lyude/gtk-,alexlarsson/gtk,Lyude/gtk-,ahodesuka/gtk,jigpu/gtk,ahodesuka/gtk,Distrotech/gtk2,chergert/gtk,davidt/gtk,ebassi/gtk,grubersjoe/adwaita,jessevdk/gtk,jessevdk/gtk,davidgumberg/gtk,davidgumberg/gtk,jadahl/gtk,jigpu/gtk,grubersjoe/adwaita,jadahl/gtk,chergert/gtk,jigpu/gtk,Adamovskiy/gtk,msteinert/gtk,jigpu/gtk,jadahl/gtk,Sidnioulz/SandboxGtk,Adamovskiy/gtk,grubersjoe/adwaita,alexlarsson/gtk,ebassi/gtk,ahodesuka/gtk,ahodesuka/gtk,jadahl/gtk,davidgumberg/gtk,davidgumberg/gtk,alexlarsson/gtk,Sidnioulz/SandboxGtk
6cc425e21330a5fa456077def0fc727b92e6ecde
test/Sema/attr-availability-ios.c
test/Sema/attr-availability-ios.c
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3(int) __attribute__((availability(ios,introduced=3.0))); void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}} void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} }
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3(int) __attribute__((availability(ios,introduced=3.0))); void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}} void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0))); void f6(int) __attribute__((availability(ios,deprecated=3.0))); void f6(int) __attribute__((availability(ios,introduced=2.0))); void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} f5(0); // expected-warning{{'f5' is deprecated: first deprecated in iOS 3.0}} f6(0); // expected-warning{{'f6' is deprecated: first deprecated in iOS 3.0}} }
Test attribute merging for the availability attribute.
Test attribute merging for the availability attribute. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@128334 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
fe23dd2429da4b8e71b110d517370358256df785
You-DataStore/internal/operation.h
You-DataStore/internal/operation.h
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../ds_task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor /// \param stask the serialized task the operation need to work with explicit IOperation(SerializedTask& stask); virtual ~IOperation(); /// Executes the operation virtual void run() = 0; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../ds_task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor /// \param stask the serialized task the operation need to work with explicit IOperation(SerializedTask& stask); virtual ~IOperation(); /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
Change return value of run to bool
Change return value of run to bool Conflicts: You-DataStore/internal/operation.h You-DataStore/internal/operations/post_operation.h
C
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
f3b877cba4ab0ffdfc553f65547305698ef16391
src/BLEDeviceLimits.h
src/BLEDeviceLimits.h
// Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
// Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(NRF52) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
Fix length issues with nRF52
Fix length issues with nRF52
C
mit
sandeepmistry/arduino-BLEPeripheral,sandeepmistry/arduino-BLEPeripheral,sandeepmistry/arduino-BLEPeripheral
79dca367dc10e9598973895f6e22350b2d2f32b4
util.h
util.h
/* This file is part of ethash. ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ethash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ethash. If not, see <http://www.gnu.org/licenses/>. */ /** @file util.h * @author Tim Hughes <[email protected]> * @date 2015 */ #pragma once #include <stdint.h> #include "compiler.h" #ifdef __cplusplus extern "C" { #endif #ifdef _MSC_VER void debugf(char const* str, ...); #else #define debugf printf #endif static inline uint32_t min_u32(uint32_t a, uint32_t b) { return a < b ? a : b; } static inline uint32_t clamp_u32(uint32_t x, uint32_t min_, uint32_t max_) { return x < min_ ? min_ : (x > max_ ? max_ : x); } #ifdef __cplusplus } #endif
/* This file is part of ethash. ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ethash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ethash. If not, see <http://www.gnu.org/licenses/>. */ /** @file util.h * @author Tim Hughes <[email protected]> * @date 2015 */ #pragma once #include <stdint.h> #include "compiler.h" #ifdef __cplusplus extern "C" { #endif //#ifdef _MSC_VER void debugf(char const* str, ...); //#else //#define debugf printf //#endif static inline uint32_t min_u32(uint32_t a, uint32_t b) { return a < b ? a : b; } static inline uint32_t clamp_u32(uint32_t x, uint32_t min_, uint32_t max_) { return x < min_ ? min_ : (x > max_ ? max_ : x); } #ifdef __cplusplus } #endif
Comment out conflicting debug macro
Comment out conflicting debug macro
C
mit
LefterisJP/webthree-umbrella,programonauta/webthree-umbrella,joeldo/cpp-ethereum,gluk256/cpp-ethereum,yann300/cpp-ethereum,eco/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,yann300/cpp-ethereum,karek314/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,vaporry/cpp-ethereum,eco/cpp-ethereum,expanse-project/cpp-expanse,Sorceror32/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,vaporry/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,karek314/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,expanse-org/cpp-expanse,PaulGrey30/go-get--u-github.com-tools-godep,programonauta/webthree-umbrella,ethers/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,smartbitcoin/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,eco/cpp-ethereum,smartbitcoin/cpp-ethereum,d-das/cpp-ethereum,ethers/cpp-ethereum,xeddmc/cpp-ethereum,karek314/cpp-ethereum,expanse-project/cpp-expanse,d-das/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,xeddmc/cpp-ethereum,LefterisJP/cpp-ethereum,gluk256/cpp-ethereum,expanse-project/cpp-expanse,joeldo/cpp-ethereum,vaporry/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,vaporry/cpp-ethereum,LefterisJP/webthree-umbrella,yann300/cpp-ethereum,anthony-cros/cpp-ethereum,johnpeter66/ethminer,expanse-project/cpp-expanse,smartbitcoin/cpp-ethereum,expanse-org/cpp-expanse,expanse-project/cpp-expanse,d-das/cpp-ethereum,LefterisJP/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,anthony-cros/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,smartbitcoin/cpp-ethereum,eco/cpp-ethereum,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,eco/cpp-ethereum,yann300/cpp-ethereum,anthony-cros/cpp-ethereum,anthony-cros/cpp-ethereum,d-das/cpp-ethereum,LefterisJP/cpp-ethereum,xeddmc/cpp-ethereum,yann300/cpp-ethereum,LefterisJP/cpp-ethereum,expanse-org/cpp-expanse,Sorceror32/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,gluk256/cpp-ethereum,vaporry/webthree-umbrella,gluk256/cpp-ethereum,LefterisJP/cpp-ethereum,eco/cpp-ethereum,johnpeter66/ethminer,gluk256/cpp-ethereum,ethers/cpp-ethereum,karek314/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,joeldo/cpp-ethereum,arkpar/webthree-umbrella,xeddmc/cpp-ethereum,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,smartbitcoin/cpp-ethereum,chfast/webthree-umbrella,vaporry/cpp-ethereum,d-das/cpp-ethereum,vaporry/cpp-ethereum,expanse-project/cpp-expanse,smartbitcoin/cpp-ethereum,xeddmc/cpp-ethereum,expanse-org/cpp-expanse,yann300/cpp-ethereum,anthony-cros/cpp-ethereum,gluk256/cpp-ethereum,expanse-org/cpp-expanse,karek314/cpp-ethereum,d-das/cpp-ethereum,expanse-org/cpp-expanse,joeldo/cpp-ethereum,johnpeter66/ethminer,ethers/cpp-ethereum,anthony-cros/cpp-ethereum
20669c2fbecaa850c3c5a2035fd068ef968f8b25
coursework/assignment2/integral_c.c
coursework/assignment2/integral_c.c
#include <stdio.h> #include <math.h> float f(float x) { return 1/x; } int main(int argc, char *argv[]) { // Integral (1 to 6) of 1/x float integral; float a = 1, b = 6; int n = 2000; float h; float x; h = (b-a)/n; integral = (f(a) + f(b)) / 2.0; x = a; for (int i = 1; i <= n - 1; i++) { x = x + h; integral = integral + f(x); } integral = integral * h; float expected = 1.79175946923; printf("Integral (%.0f to %.0f) of 1/x \n\n", a, b); printf("Expected result = %.11f\n", expected); printf("Estimated result = %.11f\n", integral); printf(" -------------\n"); float difference = expected - integral; difference = fabsf(difference); // absolute value (no minus sign) printf("Difference = %.11f\n", difference); return 0; }
#include <stdio.h> #include <math.h> double f(double x) { return 1 / x; } int main(int argc, char *argv[]) { // Integral (1 to 6) of 1/x double integral; int a = 1, b = 6; int n = 2000; double h; double x; h = (double)(b-a)/n; integral = (f(a) + f(b)) / 2.0; x = a; for (int i = 1; i < n; i++) { x = x + h; integral = integral + f(x); } integral = integral * h; double expected = 1.79175946923; printf("Integral (%d to %d) of 1/x \n\n", a, b); printf("Expected result = %.11f\n", expected); printf("Estimated result = %.11f\n", integral); printf(" -------------\n"); double difference = expected - integral; difference = fabsf(difference); // absolute value (no minus sign) printf("Difference = %.11f\n", difference); return 0; }
Use double instead of float
Use double instead of float Float was not able to maintain data precision
C
mit
arthurazs/uff-lpp,arthurazs/uff-lpp,arthurazs/uff-lpp
aa22b1c3df494da25286a787c9c5bfa6fa37c468
cpp/cpp_odbc/Library/cpp_odbc/level2/u16string_buffer.h
cpp/cpp_odbc/Library/cpp_odbc/level2/u16string_buffer.h
#pragma once #include <string> #include <vector> #include <sqltypes.h> namespace cpp_odbc { namespace level2 { /** * @brief This class represents a buffer for u16strings for use with the unixodbc C API. */ class u16string_buffer { public: /** * @brief Constructs a new string buffer with the given capacity, i.e., maximum size * @param capacity Capacity of the buffer */ u16string_buffer(signed short int capacity); /** * @brief Retrieve the capacity of the buffer (in characters) in a format suitable for passing * to unixodbc API functions. */ signed short int capacity() const; /** * @brief Retrieve a pointer to the internal buffer suitable for passing to unixodbc API functions. * This buffer contains the actual string data. Do not exceed the allocated capacity! */ SQLWCHAR * data_pointer(); /** * @brief Retrieve a pointer to a size buffer suitable for passing to unixodbc API functions. * This buffer contains the number of significant bytes in the buffer returned by * data_pointer(). */ signed short int * size_pointer(); /** * @brief Conversion operator. Retrieve the buffered data as a string. Bad things will happen if * the value of size_pointer is larger than the capacity! */ operator std::u16string() const; private: std::vector<SQLWCHAR> data_; signed short int used_size_; }; } }
#pragma once #include <string> #include <vector> #include <sql.h> namespace cpp_odbc { namespace level2 { /** * @brief This class represents a buffer for u16strings for use with the unixodbc C API. */ class u16string_buffer { public: /** * @brief Constructs a new string buffer with the given capacity, i.e., maximum size * @param capacity Capacity of the buffer */ u16string_buffer(signed short int capacity); /** * @brief Retrieve the capacity of the buffer (in characters) in a format suitable for passing * to unixodbc API functions. */ signed short int capacity() const; /** * @brief Retrieve a pointer to the internal buffer suitable for passing to unixodbc API functions. * This buffer contains the actual string data. Do not exceed the allocated capacity! */ SQLWCHAR * data_pointer(); /** * @brief Retrieve a pointer to a size buffer suitable for passing to unixodbc API functions. * This buffer contains the number of significant bytes in the buffer returned by * data_pointer(). */ signed short int * size_pointer(); /** * @brief Conversion operator. Retrieve the buffered data as a string. Bad things will happen if * the value of size_pointer is larger than the capacity! */ operator std::u16string() const; private: std::vector<SQLWCHAR> data_; signed short int used_size_; }; } }
Use different header to be yet more compatible with Windows
Use different header to be yet more compatible with Windows
C
mit
blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc