after
stringlengths
72
2.11k
before
stringlengths
21
1.55k
diff
stringlengths
85
2.31k
instruction
stringlengths
20
1.71k
license
stringclasses
13 values
repos
stringlengths
7
82.6k
commit
stringlengths
40
40
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type applications, so we have designed the bytecode format to support // quick reading. // //===----------------------------------------------------------------------===// #ifndef LLVM_BYTECODE_READER_H #define LLVM_BYTECODE_READER_H #include <string> #include <vector> class Module; // Parse and return a class... // Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr = 0); Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize, std::string *ErrorStr = 0); // ReadArchiveFile - Read bytecode files from the specfied .a file, returning // true on error, or false on success. // bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects, std::string *ErrorStr = 0); #endif
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type applications, so we have designed the bytecode format to support // quick reading. // //===----------------------------------------------------------------------===// #ifndef LLVM_BYTECODE_READER_H #define LLVM_BYTECODE_READER_H #include <string> class Module; // Parse and return a class... // Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr = 0); Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize, std::string *ErrorStr = 0); #endif
--- +++ @@ -13,6 +13,7 @@ #define LLVM_BYTECODE_READER_H #include <string> +#include <vector> class Module; @@ -23,4 +24,10 @@ Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize, std::string *ErrorStr = 0); +// ReadArchiveFile - Read bytecode files from the specfied .a file, returning +// true on error, or false on success. +// +bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects, + std::string *ErrorStr = 0); + #endif
Add prototype to read .a files git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@5821 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm
23e0a58c5a48802946cf0fbadef023179a443f05
#pragma once #include <string> #include <iostream> #include <math.h> #include "Standard.hxx" #include "Standard_PrimitiveTypes.hxx" #include "Standard_Stream.hxx" #include "Standard_Failure.hxx" #include "Standard_Transient.hxx"
#pragma once #include <string> #include <iostream> #include <math.h> #include "Standard.hxx" #include "Standard_PrimitiveTypes.hxx" #include "Standard_Stream.hxx" #include "Standard_Failure.hxx" #include "Standard_Transient.hxx" #ifdef USE_STL_STREAM #include <sstream> #else /* USE_STL_STREAM */ #ifdef WNT #include <strstrea.h> #else #include <strstream.h> #endif #endif
--- +++ @@ -10,12 +10,3 @@ #include "Standard_Failure.hxx" #include "Standard_Transient.hxx" -#ifdef USE_STL_STREAM -#include <sstream> -#else /* USE_STL_STREAM */ -#ifdef WNT -#include <strstrea.h> -#else -#include <strstream.h> -#endif -#endif
Remove obsolete includes in TKernel precompiled
lgpl-2.1
finetjul/oce,heartvalve/oce,heartvalve/oce,Tridify/oce,BenoitPerrot/oce,tpaviot/oce,tpaviot/oce,EvgeneOskin/oce,EvgeneOskin/oce,finetjul/oce,heartvalve/oce,finetjul/oce,finetjul/oce,Tridify/oce,EvgeneOskin/oce,Tridify/oce,BenoitPerrot/oce,BenoitPerrot/oce,finetjul/oce,Tridify/oce,tpaviot/oce,tpaviot/oce,heartvalve/oce,Tridify/oce,heartvalve/oce,EvgeneOskin/oce,BenoitPerrot/oce,EvgeneOskin/oce,BenoitPerrot/oce,tpaviot/oce
6f470d631baf6f5a9d30e49ef67593a12e7d7faa
#include <string.h> #include "ruby.h" #include "rubyspec.h" #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_RB_PROC_NEW VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; if (TYPE(args) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strcat(buffer, StringValuePtr(v)); strcat(buffer, "_"); } buffer[strlen(buffer) - 1] = 0; return rb_str_new2(buffer); } VALUE sp_underline_concat_proc(VALUE self) { return rb_proc_new(concat_func, Qnil); } #endif void Init_proc_spec() { VALUE cls; cls = rb_define_class("CApiProcSpecs", rb_cObject); #ifdef HAVE_RB_PROC_NEW rb_define_method(cls, "underline_concat_proc", sp_underline_concat_proc, 0); #endif } #ifdef __cplusplus } #endif
#include <string.h> #include "ruby.h" #include "rubyspec.h" #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_RB_PROC_NEW VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; if (TYPE(val) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strcat(buffer, StringValuePtr(v)); strcat(buffer, "_"); } buffer[strlen(buffer) - 1] = 0; return rb_str_new2(buffer); } VALUE sp_underline_concat_proc(VALUE self) { return rb_proc_new(concat_func, Qnil); } #endif void Init_proc_spec() { VALUE cls; cls = rb_define_class("CApiProcSpecs", rb_cObject); #ifdef HAVE_RB_PROC_NEW rb_define_method(cls, "underline_concat_proc", sp_underline_concat_proc, 0); #endif } #ifdef __cplusplus } #endif
--- +++ @@ -11,7 +11,7 @@ VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; - if (TYPE(val) != T_ARRAY) return Qnil; + if (TYPE(args) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strcat(buffer, StringValuePtr(v));
Fix typo in the commit a5312c77.
mit
julik/rubyspec,mrkn/rubyspec,no6v/rubyspec,ruby/spec,josedonizetti/rubyspec,wied03/rubyspec,timfel/rubyspec,jstepien/rubyspec,benburkert/rubyspec,Aesthetikx/rubyspec,timfel/rubyspec,iliabylich/rubyspec,rdp/rubyspec,alindeman/rubyspec,markburns/rubyspec,kachick/rubyspec,xaviershay/rubyspec,rdp/rubyspec,rkh/rubyspec,amarshall/rubyspec,yaauie/rubyspec,saturnflyer/rubyspec,sgarciac/spec,ericmeyer/rubyspec,saturnflyer/rubyspec,griff/rubyspec,qmx/rubyspec,alexch/rubyspec,eregon/rubyspec,BanzaiMan/rubyspec,benlovell/rubyspec,freerange/rubyspec,enricosada/rubyspec,nevir/rubyspec,oggy/rubyspec,nevir/rubyspec,yaauie/rubyspec,qmx/rubyspec,sferik/rubyspec,alindeman/rubyspec,benburkert/rubyspec,flavio/rubyspec,DavidEGrayson/rubyspec,yous/rubyspec,ruby/spec,JuanitoFatas/rubyspec,kidaa/rubyspec,godfat/rubyspec,ruby/rubyspec,jannishuebl/rubyspec,tinco/rubyspec,iliabylich/rubyspec,MagLev/rubyspec,Aesthetikx/rubyspec,Zoxc/rubyspec,ruby/rubyspec,tinco/rubyspec,amarshall/rubyspec,DawidJanczak/rubyspec,ericmeyer/rubyspec,yb66/rubyspec,alex/rubyspec,ruby/spec,metadave/rubyspec,marcandre/rubyspec,oggy/rubyspec,iainbeeston/rubyspec,shirosaki/rubyspec,atambo/rubyspec,eregon/rubyspec,roshats/rubyspec,sferik/rubyspec,scooter-dangle/rubyspec,jannishuebl/rubyspec,julik/rubyspec,atambo/rubyspec,BanzaiMan/rubyspec,wied03/rubyspec,nobu/rubyspec,MagLev/rubyspec,nobu/rubyspec,benlovell/rubyspec,jstepien/rubyspec,mbj/rubyspec,bomatson/rubyspec,metadave/rubyspec,agrimm/rubyspec,JuanitoFatas/rubyspec,flavio/rubyspec,bjeanes/rubyspec,enricosada/rubyspec,lucaspinto/rubyspec,neomadara/rubyspec,DawidJanczak/rubyspec,xaviershay/rubyspec,bjeanes/rubyspec,godfat/rubyspec,bl4ckdu5t/rubyspec,markburns/rubyspec,terceiro/rubyspec,alexch/rubyspec,freerange/rubyspec,griff/rubyspec,alex/rubyspec,scooter-dangle/rubyspec,nobu/rubyspec,Zoxc/rubyspec,jvshahid/rubyspec,yb66/rubyspec,neomadara/rubyspec,marcandre/rubyspec,sgarciac/spec,wied03/rubyspec,DavidEGrayson/rubyspec,no6v/rubyspec,bl4ckdu5t/rubyspec,yous/rubyspec,terceiro/rubyspec,chesterbr/rubyspec,mrkn/rubyspec,kidaa/rubyspec,josedonizetti/rubyspec,bomatson/rubyspec,teleological/rubyspec,eregon/rubyspec,rkh/rubyspec,kachick/rubyspec,shirosaki/rubyspec,mbj/rubyspec,askl56/rubyspec,kachick/rubyspec,jvshahid/rubyspec,agrimm/rubyspec,chesterbr/rubyspec,teleological/rubyspec,iainbeeston/rubyspec,sgarciac/spec,lucaspinto/rubyspec,roshats/rubyspec,askl56/rubyspec
401825d6045ab8e3bd1514404e7c326a045a92ae
#ifndef EXPR_TOK_H #define EXPR_TOK_H extern expr_n tok_cur_num; extern enum tok { tok_ident = -1, tok_num = -2, tok_eof = 0, tok_lparen = '(', tok_rparen = ')', /* operators returned as char-value, * except for double-char ops */ /* binary */ tok_multiply = '*', tok_divide = '/', tok_modulus = '%', tok_plus = '+', tok_minus = '-', tok_xor = '^', tok_or = '|', tok_and = '&', tok_orsc = -3, tok_andsc = -4, tok_shiftl = -5, tok_shiftr = -6, /* unary - TODO */ tok_not = '!', tok_bnot = '~', /* comparison */ tok_eq = -7, tok_ne = -8, tok_le = -9, tok_lt = '<', tok_ge = -10, tok_gt = '>', /* ternary */ tok_question = '?', tok_colon = ':', #define MIN_OP -10 } tok_cur; void tok_next(void); void tok_begin(char *); const char *tok_last(void); #endif
#ifndef EXPR_TOK_H #define EXPR_TOK_H extern expr_n tok_cur_num; extern enum tok { tok_ident = -1, tok_num = -2, tok_eof = 0, tok_lparen = '(', tok_rparen = ')', /* operators returned as char-value, * except for double-char ops */ /* binary */ tok_multiply = '*', tok_divide = '/', tok_modulus = '%', tok_plus = '+', tok_minus = '-', tok_xor = '^', tok_or = '|', tok_and = '&', tok_orsc = -1, tok_andsc = -2, tok_shiftl = -3, tok_shiftr = -4, /* unary - TODO */ tok_not = '!', tok_bnot = '~', /* comparison */ tok_eq = -5, tok_ne = -6, tok_le = -7, tok_lt = '<', tok_ge = -8, tok_gt = '>', /* ternary */ tok_question = '?', tok_colon = ':', #define MIN_OP -8 } tok_cur; void tok_next(void); void tok_begin(char *); const char *tok_last(void); #endif
--- +++ @@ -25,28 +25,28 @@ tok_xor = '^', tok_or = '|', tok_and = '&', - tok_orsc = -1, - tok_andsc = -2, - tok_shiftl = -3, - tok_shiftr = -4, + tok_orsc = -3, + tok_andsc = -4, + tok_shiftl = -5, + tok_shiftr = -6, /* unary - TODO */ tok_not = '!', tok_bnot = '~', /* comparison */ - tok_eq = -5, - tok_ne = -6, - tok_le = -7, + tok_eq = -7, + tok_ne = -8, + tok_le = -9, tok_lt = '<', - tok_ge = -8, + tok_ge = -10, tok_gt = '>', /* ternary */ tok_question = '?', tok_colon = ':', -#define MIN_OP -8 +#define MIN_OP -10 } tok_cur; void tok_next(void);
Fix clash in cpp tokens
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
c49c79960407e33d6ba47d5de0c78500cbf3205f
#ifndef ROUTER_H #define ROUTER_H #include <apr_queue.h> #include "operator/operator.h" #include "planner/planner.h" #include "types/tuple.h" typedef struct C4Router C4Router; C4Router *router_make(C4Runtime *c4, apr_queue_t *queue); void router_main_loop(C4Router *router); apr_queue_t *router_get_queue(C4Router *router); void router_enqueue_program(apr_queue_t *queue, const char *src); void router_enqueue_tuple(apr_queue_t *queue, Tuple *tuple, TableDef *tbl_def); char *router_enqueue_dump_table(apr_queue_t *queue, const char *tbl_name, apr_pool_t *pool); /* Internal APIs: XXX: clearer naming */ void router_install_tuple(C4Router *router, Tuple *tuple, TableDef *tbl_def); void router_enqueue_internal(C4Router *router, Tuple *tuple, TableDef *tbl_def); void router_enqueue_net(C4Router *router, Tuple *tuple, TableDef *tbl_def); OpChainList *router_get_opchain_list(C4Router *router, const char *tbl_name); void router_add_op_chain(C4Router *router, OpChain *op_chain); #endif /* ROUTER_H */
#ifndef ROUTER_H #define ROUTER_H #include <apr_queue.h> #include "operator/operator.h" #include "planner/planner.h" #include "types/tuple.h" typedef struct C4Router C4Router; C4Router *router_make(C4Runtime *c4, apr_queue_t *queue); void router_main_loop(C4Router *router); apr_queue_t *router_get_queue(C4Router *router); void router_enqueue_program(apr_queue_t *queue, const char *src); void router_enqueue_tuple(apr_queue_t *queue, Tuple *tuple, TableDef *tbl_def); char *router_enqueue_dump_table(apr_queue_t *queue, const char *table, apr_pool_t *pool); /* Internal APIs: XXX: clearer naming */ void router_install_tuple(C4Router *router, Tuple *tuple, TableDef *tbl_def); void router_enqueue_internal(C4Router *router, Tuple *tuple, TableDef *tbl_def); void router_enqueue_net(C4Router *router, Tuple *tuple, TableDef *tbl_def); OpChainList *router_get_opchain_list(C4Router *router, const char *tbl_name); void router_add_op_chain(C4Router *router, OpChain *op_chain); #endif /* ROUTER_H */
--- +++ @@ -17,7 +17,7 @@ void router_enqueue_tuple(apr_queue_t *queue, Tuple *tuple, TableDef *tbl_def); -char *router_enqueue_dump_table(apr_queue_t *queue, const char *table, +char *router_enqueue_dump_table(apr_queue_t *queue, const char *tbl_name, apr_pool_t *pool); /* Internal APIs: XXX: clearer naming */
Tweak a function prototype in header.
mit
bloom-lang/c4,bloom-lang/c4,bloom-lang/c4
73606739ba6dba3ae32debf6823ea05483429e53
#pragma once #include <math.h> struct Vector3 { union { float v[3]; struct { float x; float y; float z; }; struct { union { float azimuth; float yaw; }; float pitch; float roll; }; }; Vector3() { x = 0; y = 0; z = 0; } float norm() { return sqrt(x*x + y*y + z*z); } void normalize() { float n = norm(); if(n > 0) { x /= n; y /= n; z /= n; } } };
#pragma once #include <math.h> struct Vector3 { union { float v[3]; struct { float x; float y; float z; }; struct { float azimuth; float pitch; float roll; }; }; Vector3() { x = 0; y = 0; z = 0; } float norm() { return sqrt(x*x + y*y + z*z); } void normalize() { float n = norm(); if(n > 0) { x /= n; y /= n; z /= n; } } };
--- +++ @@ -11,7 +11,10 @@ float z; }; struct { - float azimuth; + union { + float azimuth; + float yaw; + }; float pitch; float roll; };
Allow both yaw and azimuth
mit
loopj/i2c-sensor-hal,loopj/i2c-sensor-hal
8b30c206f7da701fa5c609c1100c3957ae22c916
void dc_dump() { // TODO: Check direction and change to U and D static int prev_l = 0, prev_r = 0; if (!prev_l && vexRT[Btn7L]) dump_set(-127); if (!prev_r && vexRT[Btn7R]) dump_set(127); if ((prev_l && !vexRT[Btn7L]) || (prev_r && !vexRT[Btn7R])) dump_set(0); prev_l = vexRT[Btn7L]; prev_r = vexRT[Btn7R]; }
void dc_dump() { static int prev_l = 0, prev_r = 0; if (!prev_l && vexRT[Btn7L]) dump_set(-80); if (!prev_r && vexRT[Btn7R]) dump_set(80); if ((prev_l && !vexRT[Btn7L]) || (prev_r && !vexRT[Btn7R])) dump_set(0); prev_l = vexRT[Btn7L]; prev_r = vexRT[Btn7R]; }
--- +++ @@ -1,11 +1,13 @@ void dc_dump() { + + // TODO: Check direction and change to U and D static int prev_l = 0, prev_r = 0; if (!prev_l && vexRT[Btn7L]) - dump_set(-80); + dump_set(-127); if (!prev_r && vexRT[Btn7R]) - dump_set(80); + dump_set(127); if ((prev_l && !vexRT[Btn7L]) || (prev_r && !vexRT[Btn7R])) dump_set(0);
Change dump power to 127
mit
qsctr/vex-4194b-2016
269c892039f901b97057614b664e72df31c2c597
// // Toolkit header to include the main headers of the 'AFToolkit' library. // #import "AFDefines.h" #import "AFLogHelper.h" #import "AFFileHelper.h" #import "AFPlatformHelper.h" #import "AFKVO.h" #import "AFArray.h" #import "AFMutableArray.h" #import "UITableViewCell+Universal.h" #import "AFDBClient.h" #import "AFView.h" #import "AFViewController.h"
// // Toolkit header to include the main headers of the 'AFToolkit' library. // #pragma mark - Common Import #import "AFLogHelper.h" #import "AFFileHelper.h" #import "AFPlatformHelper.h" #import "AFKVO.h" #import "AFArray.h" #import "AFMutableArray.h" #import "UITableViewCell+Universal.h" #import "AFDBClient.h" #import "AFView.h" #import "AFViewController.h"
--- +++ @@ -2,9 +2,7 @@ // Toolkit header to include the main headers of the 'AFToolkit' library. // - -#pragma mark - Common Import - +#import "AFDefines.h" #import "AFLogHelper.h" #import "AFFileHelper.h" #import "AFPlatformHelper.h"
Add defines header to toolkit header
mit
mlatham/AFToolkit
4e24df1ba483b3028017176b08bc336b8ca79274
/*------------------------------------------------------------------------- * * pgtz.c * Timezone Library Integration Functions * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.6 2004/05/01 22:07:03 momjian Exp $ * *------------------------------------------------------------------------- */ #include "pgtz.h" #include "tzfile.h" static char tzdir[MAXPGPATH]; static int done_tzdir = 0; char * pg_TZDIR(void) { char *p; if (done_tzdir) return tzdir; #ifndef WIN32 StrNCpy(tzdir, PGDATADIR, MAXPGPATH); #else if (GetModuleFileName(NULL, tzdir, MAXPGPATH) == 0) return NULL; #endif canonicalize_path(tzdir); #ifdef WIN32 /* trim off binary name, then go up a directory */ if ((p = last_path_separator(tzdir)) == NULL) return NULL; else *p = '\0'; strcat(tzdir, "/../share/timezone"); #endif strcat(tzdir, "/timezone"); done_tzdir = 1; return tzdir; }
/*------------------------------------------------------------------------- * * pgtz.c * Timezone Library Integration Functions * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.5 2004/05/01 01:38:53 momjian Exp $ * *------------------------------------------------------------------------- */ #include "pgtz.h" #include "tzfile.h" static char tzdir[MAXPGPATH]; static int done_tzdir = 0; char * pg_TZDIR(void) { char *p; if (done_tzdir) return tzdir; #ifndef WIN32 StrNCpy(tzdir, PGDATADIR, MAXPGPATH); #else if (GetModuleFileName(NULL, tzdir, MAXPGPATH) == 0) return NULL; #endif canonicalize_path(tzdir); #if 0 if ((p = last_path_separator(tzdir)) == NULL) return NULL; else *p = '\0'; #endif strcat(tzdir, "/timezone"); done_tzdir = 1; return tzdir; }
--- +++ @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.5 2004/05/01 01:38:53 momjian Exp $ + * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.6 2004/05/01 22:07:03 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -33,14 +33,16 @@ #endif canonicalize_path(tzdir); -#if 0 +#ifdef WIN32 + /* trim off binary name, then go up a directory */ if ((p = last_path_separator(tzdir)) == NULL) return NULL; else *p = '\0'; + strcat(tzdir, "/../share/timezone"); #endif + strcat(tzdir, "/timezone"); - strcat(tzdir, "/timezone"); done_tzdir = 1; return tzdir;
Fix timezone data path for Unix and win32.
apache-2.0
yuanzhao/gpdb,atris/gpdb,kmjungersen/PostgresXL,zeroae/postgres-xl,yuanzhao/gpdb,jmcatamney/gpdb,50wu/gpdb,yuanzhao/gpdb,rubikloud/gpdb,rvs/gpdb,lpetrov-pivotal/gpdb,techdragon/Postgres-XL,yuanzhao/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,lintzc/gpdb,rubikloud/gpdb,janebeckman/gpdb,lintzc/gpdb,Chibin/gpdb,janebeckman/gpdb,50wu/gpdb,Quikling/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,foyzur/gpdb,chrishajas/gpdb,cjcjameson/gpdb,janebeckman/gpdb,lintzc/gpdb,foyzur/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,ashwinstar/gpdb,rubikloud/gpdb,atris/gpdb,edespino/gpdb,kaknikhil/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,0x0FFF/gpdb,atris/gpdb,kaknikhil/gpdb,xuegang/gpdb,rvs/gpdb,xinzweb/gpdb,edespino/gpdb,zeroae/postgres-xl,adam8157/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,lpetrov-pivotal/gpdb,foyzur/gpdb,royc1/gpdb,0x0FFF/gpdb,randomtask1155/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,chrishajas/gpdb,jmcatamney/gpdb,arcivanov/postgres-xl,ahachete/gpdb,randomtask1155/gpdb,Quikling/gpdb,royc1/gpdb,xuegang/gpdb,edespino/gpdb,janebeckman/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,xinzweb/gpdb,snaga/postgres-xl,ovr/postgres-xl,ashwinstar/gpdb,chrishajas/gpdb,adam8157/gpdb,xuegang/gpdb,yazun/postgres-xl,tangp3/gpdb,edespino/gpdb,ovr/postgres-xl,edespino/gpdb,atris/gpdb,rvs/gpdb,chrishajas/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,chrishajas/gpdb,cjcjameson/gpdb,arcivanov/postgres-xl,pavanvd/postgres-xl,yuanzhao/gpdb,rubikloud/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,xuegang/gpdb,ahachete/gpdb,jmcatamney/gpdb,tangp3/gpdb,CraigHarris/gpdb,rubikloud/gpdb,edespino/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,kmjungersen/PostgresXL,rvs/gpdb,yuanzhao/gpdb,yazun/postgres-xl,ashwinstar/gpdb,zeroae/postgres-xl,Chibin/gpdb,ahachete/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,pavanvd/postgres-xl,lpetrov-pivotal/gpdb,randomtask1155/gpdb,techdragon/Postgres-XL,ovr/postgres-xl,chrishajas/gpdb,greenplum-db/gpdb,adam8157/gpdb,pavanvd/postgres-xl,tpostgres-projects/tPostgres,lpetrov-pivotal/gpdb,chrishajas/gpdb,Quikling/gpdb,CraigHarris/gpdb,yazun/postgres-xl,snaga/postgres-xl,lpetrov-pivotal/gpdb,yazun/postgres-xl,cjcjameson/gpdb,adam8157/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,lintzc/gpdb,arcivanov/postgres-xl,yuanzhao/gpdb,adam8157/gpdb,lisakowen/gpdb,Chibin/gpdb,Chibin/gpdb,jmcatamney/gpdb,kmjungersen/PostgresXL,snaga/postgres-xl,techdragon/Postgres-XL,jmcatamney/gpdb,adam8157/gpdb,xinzweb/gpdb,cjcjameson/gpdb,xinzweb/gpdb,edespino/gpdb,edespino/gpdb,lintzc/gpdb,tangp3/gpdb,50wu/gpdb,zaksoup/gpdb,yazun/postgres-xl,Chibin/gpdb,royc1/gpdb,xinzweb/gpdb,xuegang/gpdb,lisakowen/gpdb,chrishajas/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,foyzur/gpdb,ashwinstar/gpdb,royc1/gpdb,foyzur/gpdb,CraigHarris/gpdb,tpostgres-projects/tPostgres,0x0FFF/gpdb,foyzur/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,snaga/postgres-xl,snaga/postgres-xl,randomtask1155/gpdb,kmjungersen/PostgresXL,Quikling/gpdb,ahachete/gpdb,Chibin/gpdb,royc1/gpdb,ovr/postgres-xl,greenplum-db/gpdb,0x0FFF/gpdb,lisakowen/gpdb,zeroae/postgres-xl,Quikling/gpdb,Chibin/gpdb,zaksoup/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,techdragon/Postgres-XL,atris/gpdb,lintzc/gpdb,atris/gpdb,randomtask1155/gpdb,rvs/gpdb,tangp3/gpdb,janebeckman/gpdb,xuegang/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,kaknikhil/gpdb,ahachete/gpdb,xinzweb/gpdb,50wu/gpdb,janebeckman/gpdb,0x0FFF/gpdb,tangp3/gpdb,0x0FFF/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,postmind-net/postgres-xl,ahachete/gpdb,lisakowen/gpdb,rvs/gpdb,rubikloud/gpdb,postmind-net/postgres-xl,Quikling/gpdb,arcivanov/postgres-xl,Quikling/gpdb,zaksoup/gpdb,lintzc/gpdb,tangp3/gpdb,jmcatamney/gpdb,tpostgres-projects/tPostgres,50wu/gpdb,zaksoup/gpdb,rvs/gpdb,jmcatamney/gpdb,xuegang/gpdb,greenplum-db/gpdb,tangp3/gpdb,50wu/gpdb,50wu/gpdb,Chibin/gpdb,janebeckman/gpdb,postmind-net/postgres-xl,xuegang/gpdb,janebeckman/gpdb,Quikling/gpdb,oberstet/postgres-xl,tpostgres-projects/tPostgres,ahachete/gpdb,Chibin/gpdb,lpetrov-pivotal/gpdb,Quikling/gpdb,rvs/gpdb,Postgres-XL/Postgres-XL,edespino/gpdb,oberstet/postgres-xl,atris/gpdb,kaknikhil/gpdb,rvs/gpdb,cjcjameson/gpdb,lintzc/gpdb,Quikling/gpdb,rubikloud/gpdb,kaknikhil/gpdb,ovr/postgres-xl,ahachete/gpdb,royc1/gpdb,pavanvd/postgres-xl,kaknikhil/gpdb,kaknikhil/gpdb,zaksoup/gpdb,rubikloud/gpdb,Chibin/gpdb,lisakowen/gpdb,oberstet/postgres-xl,cjcjameson/gpdb,foyzur/gpdb,kaknikhil/gpdb,oberstet/postgres-xl,atris/gpdb,yuanzhao/gpdb,zaksoup/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,CraigHarris/gpdb,tangp3/gpdb,arcivanov/postgres-xl,zaksoup/gpdb,adam8157/gpdb,CraigHarris/gpdb,royc1/gpdb,janebeckman/gpdb,rvs/gpdb,xuegang/gpdb,adam8157/gpdb,50wu/gpdb,lintzc/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,yuanzhao/gpdb,royc1/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,foyzur/gpdb,CraigHarris/gpdb,lpetrov-pivotal/gpdb
f4c69c820550a352cb123bfb0b16c33c659a4ca6
#import <Foundation/Foundation.h> #import "Nocilla.h" @class LSStubRequest; @class LSStubResponse; @protocol LSHTTPRequest; extern NSString * const LSUnexpectedRequest; @interface LSNocilla : NSObject + (LSNocilla *)sharedInstance; @property (nonatomic, strong, readonly) NSArray *stubbedRequests; - (void)start; - (void)stop; - (void)addStubbedRequest:(LSStubRequest *)request; - (void)clearStubs; - (LSStubResponse *)responseForRequest:(id<LSHTTPRequest>)request; @end
#import <Foundation/Foundation.h> #import "Nocilla.h" #import "LSHTTPRequest.h" @class LSStubRequest; @class LSStubResponse; extern NSString * const LSUnexpectedRequest; @interface LSNocilla : NSObject + (LSNocilla *)sharedInstance; @property (nonatomic, strong, readonly) NSArray *stubbedRequests; - (void)start; - (void)stop; - (void)addStubbedRequest:(LSStubRequest *)request; - (void)clearStubs; - (LSStubResponse *)responseForRequest:(id<LSHTTPRequest>)request; @end
--- +++ @@ -1,9 +1,9 @@ #import <Foundation/Foundation.h> #import "Nocilla.h" -#import "LSHTTPRequest.h" @class LSStubRequest; @class LSStubResponse; +@protocol LSHTTPRequest; extern NSString * const LSUnexpectedRequest;
Replace import with forward declaration.
mit
pcantrell/Nocilla,ileitch/Nocilla,luisobo/Nocilla,0xmax/Nocilla,patcheng/Nocilla,tomguthrie/Nocilla,Panajev/Nocilla,luxe-eng/valet-ios.Nocilla,SanjoDeundiak/Nocilla,TheAdamBorek/Nocilla,luxe-eng/valet-ios.Nocilla,0xmax/Nocilla,TheAdamBorek/Nocilla
f6a808e5190055af32abe8060bbe7d4ab2d5d6d4
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <gmock/gmock.h> #include <react/renderer/scheduler/SurfaceHandler.h> namespace facebook { namespace react { class MockSurfaceHandler : public SurfaceHandler { public: MockSurfaceHandler() : SurfaceHandler("moduleName", 0){}; MOCK_QUALIFIED_METHOD1(setDisplayMode, const noexcept, void(DisplayMode)); MOCK_QUALIFIED_METHOD0(getSurfaceId, const noexcept, SurfaceId()); }; } // namespace react } // namespace facebook
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <gmock/gmock.h> #include <react/renderer/scheduler/SurfaceHandler.h> namespace facebook { namespace react { class MockSurfaceHandler : public SurfaceHandler { public: MockSurfaceHandler() : SurfaceHandler("moduleName", 0){}; MOCK_METHOD(void, setDisplayMode, (DisplayMode), (const, noexcept)); MOCK_METHOD(SurfaceId, getSurfaceId, (), (const, noexcept)); }; } // namespace react } // namespace facebook
--- +++ @@ -18,8 +18,8 @@ public: MockSurfaceHandler() : SurfaceHandler("moduleName", 0){}; - MOCK_METHOD(void, setDisplayMode, (DisplayMode), (const, noexcept)); - MOCK_METHOD(SurfaceId, getSurfaceId, (), (const, noexcept)); + MOCK_QUALIFIED_METHOD1(setDisplayMode, const noexcept, void(DisplayMode)); + MOCK_QUALIFIED_METHOD0(getSurfaceId, const noexcept, SurfaceId()); }; } // namespace react
Revert D34351084: Migrate from googletest 1.8 to googletest 1.10 Differential Revision: D34351084 (https://github.com/facebook/react-native/commit/94891ab5f883efa55146dc42e1cd9705506794f3) Original commit changeset: 939b3985ab63 Original Phabricator Diff: D34351084 (https://github.com/facebook/react-native/commit/94891ab5f883efa55146dc42e1cd9705506794f3) fbshipit-source-id: 2fd17e0ccd9d1f1d643f4a372d84cb95f5add1f8
mit
facebook/react-native,janicduplessis/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,javache/react-native,facebook/react-native,facebook/react-native,javache/react-native,facebook/react-native,javache/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,javache/react-native,facebook/react-native,janicduplessis/react-native,javache/react-native,facebook/react-native,javache/react-native,facebook/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native,janicduplessis/react-native
eb434c1c76cdad0f5f841487dc9568c5079c6fb8
#ifndef CALC_SCANNER_DEF_H_ #define CALC_SCANNER_DEF_H_ typedef union { int int_value; } YYSTYPE; class ParserState { public: int result; int eval; ParserState() : result(0) { } }; #endif // CALC_SCANNER_DEF_H_
#ifndef CALC_SCANNER_DEF_H_ #define CALC_SCANNER_DEF_H_ typedef union { int int_value; } YYSTYPE; typedef struct { int function; int result; YYSTYPE lhs; YYSTYPE rhs; } BinaryFunction; class ParserState { public: int result; int eval; ParserState() : result(0) { } }; #endif // CALC_SCANNER_DEF_H_
--- +++ @@ -4,13 +4,6 @@ typedef union { int int_value; } YYSTYPE; - -typedef struct { - int function; - int result; - YYSTYPE lhs; - YYSTYPE rhs; -} BinaryFunction; class ParserState { public:
Remove silly struct that's silly
mit
nic0lette/lemony,nic0lette/lemony,nic0lette/lemony
1213144d03d3bc69979ea50b32979ddd2b7f8dd2
#ifndef PROBLEM_H #define PROBLEM_H #include "sense.h" class Problem { public: int objcnt; // Number of objectives double* rhs; int** objind; // Objective indices double** objcoef; // Objective coefficients Sense objsen; // Objective sense. Note that all objectives must have the same // sense (i.e., either all objectives are to be minimised, or // all objectives are to be maximised). int* conind; char* consense; Problem(); ~Problem(); }; inline Problem::Problem() : objcnt(0) { } inline Problem::~Problem() { // If objcnt == 0, then no problem has been assigned and no memory allocated if (objcnt == 0) return; for(int j = 0; j < objcnt; ++j) { delete[] objind[j]; delete[] objcoef[j]; } delete[] objind; delete[] objcoef; delete[] rhs; delete[] conind; delete[] consense; } #endif /* PROBLEM_H */
#ifndef PROBLEM_H #define PROBLEM_H #include "sense.h" class Problem { public: int objcnt; // Number of objectives double* rhs; int** objind; // Objective indices double** objcoef; // Objective coefficients Sense objsen; // Objective sense. Note that all objectives must have the same // sense (i.e., either all objectives are to be minimised, or // all objectives are to be maximised). int* conind; char* consense; ~Problem(); }; inline Problem::~Problem() { for(int j = 0; j < objcnt; ++j) { delete[] objind[j]; delete[] objcoef[j]; } delete[] objind; delete[] objcoef; delete[] rhs; delete[] conind; delete[] consense; } #endif /* PROBLEM_H */
--- +++ @@ -15,12 +15,17 @@ int* conind; char* consense; + Problem(); ~Problem(); }; +inline Problem::Problem() : objcnt(0) { } inline Problem::~Problem() { + // If objcnt == 0, then no problem has been assigned and no memory allocated + if (objcnt == 0) + return; for(int j = 0; j < objcnt; ++j) { delete[] objind[j]; delete[] objcoef[j];
Fix invalid delete[] calls in ~Problem If objcnt is 0, then no memory has been allocated.
bsd-2-clause
WPettersson/moip_aira,WPettersson/moip_aira,WPettersson/moip_aira,WPettersson/moip_aira
240a18f3955c0c2749c867b32c231b19672d83e0
#ifndef DECL_H #define DECL_H #include <stdint.h> typedef enum DeclSpec { DECL_SPEC_NONE = 0x0, DECL_SPEC_FLOAT = 0x1, DECL_SPEC_INT = 0x2, DECL_SPEC_SIGNED = 0x4, DECL_SPEC_UNSIGNED = 0x8, DECL_SPEC_VOID = 0x10, } DeclSpec; typedef uint16_t DeclSpecs; #endif
#ifndef DECL_H #define DECL_H #include <stdlib.h> typedef enum DeclSpec { DECL_SPEC_NONE = 0x0, DECL_SPEC_FLOAT = 0x1, DECL_SPEC_INT = 0x2, DECL_SPEC_SIGNED = 0x4, DECL_SPEC_UNSIGNED = 0x8, DECL_SPEC_VOID = 0x10, } DeclSpec; typedef size_t DeclSpecs; #endif
--- +++ @@ -1,7 +1,7 @@ #ifndef DECL_H #define DECL_H -#include <stdlib.h> +#include <stdint.h> typedef enum DeclSpec { DECL_SPEC_NONE = 0x0, @@ -12,6 +12,6 @@ DECL_SPEC_VOID = 0x10, } DeclSpec; -typedef size_t DeclSpecs; +typedef uint16_t DeclSpecs; #endif
Change type of DeclSpecs to uint16_t Using size_t was a bit overkill.
unlicense
InternetUnexplorer/Periapsis-CC
e0540dc80d92c82729dc8b40aeae20d3011dc46e
#include "util.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include "laco.h" static inline void ignore_extra(const char chr, char** string_ptr) { if(*string_ptr == NULL) return; while(**string_ptr == chr) { *string_ptr += 1; } } /* External API */ void laco_kill(LacoState* laco, int status, const char* message) { laco_destroy_laco_state(laco); if(message != NULL) { fprintf(stderr, "%s\n", message); } exit(status); } bool laco_is_match(const char** matches, const char* test_string) { int i; const char* match; for(i = 0; (match = matches[i]); i++) { if(strcmp(test_string, match) == 0) { return true; } } return false; } char** laco_split_by(const char split_with, char* string, int ignore_repeats) { if(string == NULL) return NULL; char** result = calloc(16, sizeof(char*)); size_t i = 0; while(1) { result[i] = strsep(&string, &split_with); if(result[i] == NULL) break; if(ignore_repeats) ignore_extra(split_with, &string); i += 1; } return result; }
#include "util.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include "laco.h" static inline void ignore_extra(const char chr, char** string_ptr) { if(*string_ptr == NULL) return; while(**string_ptr == chr) { *string_ptr += 1; } } /* External API */ void laco_kill(LacoState* laco, int status, const char* message) { laco_destroy_laco_state(laco); if(message != NULL) { fprintf(stderr, "%s\n", message); } exit(status); } bool laco_is_match(const char** matches, const char* test_string) { int i; char* match; for(i = 0; (match = (char*) matches[i]); i++) { if(strcmp(test_string, match) == 0) { return true; } } return false; } char** laco_split_by(const char split_with, char* string, int ignore_repeats) { if(string == NULL) return NULL; char** result = calloc(16, sizeof(char*)); size_t i = 0; while(1) { result[i] = strsep(&string, &split_with); if(result[i] == NULL) break; if(ignore_repeats) ignore_extra(split_with, &string); i += 1; } return result; }
--- +++ @@ -28,9 +28,9 @@ bool laco_is_match(const char** matches, const char* test_string) { int i; - char* match; + const char* match; - for(i = 0; (match = (char*) matches[i]); i++) { + for(i = 0; (match = matches[i]); i++) { if(strcmp(test_string, match) == 0) { return true; }
Change type from `char*` to `const char*` This is to gets rid of the explicit type conversation every iteration of the loop.
bsd-2-clause
sourrust/laco
96018d05e6801cf935ef630288d45dc2238b5db8
#ifdef __cplusplus extern "C" { #endif /* * buf: input fuzzing data * len: size of the 'buf' data * * Return value: should return 0 */ int LLVMFuzzerTestOneInput(const uint8_t * buf, size_t len); /* * argc: ptr to main's argc * argv: ptr to main's argv * * Return value: ignored */ int LLVMFuzzerInitialize(int *argc, char ***argv); /* * * An alternative for LLVMFuzzerTestOneInput() * * buf_ptr: will be set to input fuzzing data * len_ptr: will be set to the size of the input fuzzing data */ void HF_ITER(const uint8_t ** buf_ptr, size_t * len_ptr); #if defined(__linux__) /* * Enter Linux namespaces * * cloneFlags: see 'man unshare' */ bool linuxEnterNs(uintptr_t cloneFlags); /* * Bring network interface up * * ifacename: name of the interface, typically "lo" */ bool linuxIfaceUp(const char *ifacename); /* * Mount tmpfs over a mount point * * dst: mount point for tmfs */ bool linuxMountTmpfs(const char *dst); #endif /* defined(__linux__) */ #ifdef __cplusplus } /* extern "C" */ #endif
#ifdef __cplusplus extern "C" { #endif /* * buf: input fuzzing data * len: size of the 'buf' data * * Return value: should return 0 */ int LLVMFuzzerTestOneInput(const uint8_t * buf, size_t len); /* * argc: ptr to main's argc * argv: ptr to main's argv * * Return value: ignored */ int LLVMFuzzerInitialize(int *argc, char ***argv); /* * * An alternative for LLVMFuzzerTestOneInput() * * buf_ptr: will be set to input fuzzing data * len_ptr: will be set to the size of the input fuzzing data */ void HF_ITER(const uint8_t ** buf_ptr, size_t * len_ptr); #if defined(_HF_ARCH_LINUX) /* * Enter Linux namespaces * * cloneFlags: see 'man unshare' */ bool linuxEnterNs(uintptr_t cloneFlags); /* * Bring network interface up * * ifacename: name of the interface, typically "lo" */ bool linuxIfaceUp(const char *ifacename); /* * Mount tmpfs over a mount point * * dst: mount point for tmfs */ bool linuxMountTmpfs(const char *dst); #endif /* defined(_HF_ARCH_LINUX) */ #ifdef __cplusplus } /* extern "C" */ #endif
--- +++ @@ -27,7 +27,7 @@ */ void HF_ITER(const uint8_t ** buf_ptr, size_t * len_ptr); -#if defined(_HF_ARCH_LINUX) +#if defined(__linux__) /* * Enter Linux namespaces @@ -48,7 +48,7 @@ */ bool linuxMountTmpfs(const char *dst); -#endif /* defined(_HF_ARCH_LINUX) */ +#endif /* defined(__linux__) */ #ifdef __cplusplus } /* extern "C" */
Change defined(_HF_ARCH_LINUX) -> defined(__linux__) for public includes
apache-2.0
google/honggfuzz,google/honggfuzz,anestisb/honggfuzz,google/honggfuzz
0061b22b7bfe41ca8e5ec39a199fc1c8fa9203d0
/** * This is used to setup the UART device on an AVR unit. */ #pragma once #include <avr/io.h> #ifndef BAUD # define BAUD 9600 # warning BAUD rate not set. Setting BAUD rate to 9600. #endif // BAUD #define BAUDRATE ((F_CPU)/(BAUD*16UL)-1) static inline void uart_enable(void) { UBRR0H = BAUDRATE >> 8; UBRR0L = BAUDRATE; // Set RX/TN enabled UCSR0B |= _BV(TXEN0) | _BV(RXEN0); // Set asynchronous USART // Set frame format: 8-bit data, 2-stop bit UCSR0C |= _BV(USBS0) | _BV(UCSZ01) | _BV(UCSZ00); } static inline void uart_transmit(unsigned char data) { while (!(UCSR0A & _BV(UDRE0))); UDR0 = data; } static inline unsigned char uart_receive(void) { while (!(UCSR0A & _BV(RXC0))); return UDR0; }
/** * This is used to setup the UART device on an AVR unit. */ #pragma once #include <avr/io.h> #ifndef BAUD # define BAUD 9600 # warning BAUD rate not set. Setting BAUD rate to 9600. #endif // BAUD #define BAUDRATE ((F_CPU)/(BAUD*16UL)-1) static inline void uart_enable(void) { UBRR0H = BAUDRATE >> 8; UBRR0L = BAUDRATE; UCSR0B |= _BV(TXEN0) | _BV(RXEN0); UCSR0C |= _BV(UMSEL00) | _BV(UCSZ01) | _BV(UCSZ00); } static inline void uart_transmit(unsigned char data) { while (!(UCSR0A & _BV(UDRE0))); UDR0 = data; } static inline unsigned char uart_receive(void) { while (!(UCSR0A & _BV(RXC0))); return UDR0; }
--- +++ @@ -16,8 +16,13 @@ static inline void uart_enable(void) { UBRR0H = BAUDRATE >> 8; UBRR0L = BAUDRATE; + + // Set RX/TN enabled UCSR0B |= _BV(TXEN0) | _BV(RXEN0); - UCSR0C |= _BV(UMSEL00) | _BV(UCSZ01) | _BV(UCSZ00); + + // Set asynchronous USART + // Set frame format: 8-bit data, 2-stop bit + UCSR0C |= _BV(USBS0) | _BV(UCSZ01) | _BV(UCSZ00); } static inline void uart_transmit(unsigned char data) {
Correct the frame format and async mode for the UART. Add useful comments.
mpl-2.0
grimwm/avr,grimwm/avr,grimwm/avr,grimwm/avr
7ef1bd0d3543ec940405f94e3c908771b6a3c210
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #ifdef USE_TI_UISCROLLABLEVIEW #import "TiUIView.h" @interface TiUIScrollableView : TiUIView<UIScrollViewDelegate> { @private UIScrollView *scrollview; UIPageControl *pageControl; int currentPage; // Duplicate some info, just in case we're not showing the page control BOOL showPageControl; CGFloat pageControlHeight; BOOL handlingPageControlEvent; // Have to correct for an apple goof; rotation stops scrolling, AND doesn't move to the next page. BOOL rotatedWhileScrolling; // See the code for why we need this... int lastPage; int cacheSize; } -(void)manageRotation; -(UIScrollView*)scrollview; @end #endif
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #ifdef USE_TI_UISCROLLABLEVIEW #import "TiUIView.h" @interface TiUIScrollableView : TiUIView<UIScrollViewDelegate> { @private UIScrollView *scrollview; UIPageControl *pageControl; int currentPage; // Duplicate some info, just in case we're not showing the page control BOOL showPageControl; CGFloat pageControlHeight; BOOL handlingPageControlEvent; CGFloat maxScale; CGFloat minScale; // Have to correct for an apple goof; rotation stops scrolling, AND doesn't move to the next page. BOOL rotatedWhileScrolling; // See the code for why we need this... int lastPage; int cacheSize; } -(void)manageRotation; -(UIScrollView*)scrollview; @end #endif
--- +++ @@ -16,8 +16,6 @@ BOOL showPageControl; CGFloat pageControlHeight; BOOL handlingPageControlEvent; - CGFloat maxScale; - CGFloat minScale; // Have to correct for an apple goof; rotation stops scrolling, AND doesn't move to the next page. BOOL rotatedWhileScrolling;
[timob-4738] Include header file changes missed from last checkin
apache-2.0
pec1985/titanium_mobile,kopiro/titanium_mobile,shopmium/titanium_mobile,pinnamur/titanium_mobile,peymanmortazavi/titanium_mobile,jhaynie/titanium_mobile,FokkeZB/titanium_mobile,benbahrenburg/titanium_mobile,smit1625/titanium_mobile,shopmium/titanium_mobile,ashcoding/titanium_mobile,indera/titanium_mobile,falkolab/titanium_mobile,falkolab/titanium_mobile,AngelkPetkov/titanium_mobile,prop/titanium_mobile,mano-mykingdom/titanium_mobile,openbaoz/titanium_mobile,pinnamur/titanium_mobile,mano-mykingdom/titanium_mobile,sriks/titanium_mobile,pec1985/titanium_mobile,ashcoding/titanium_mobile,mvitr/titanium_mobile,bhatfield/titanium_mobile,jhaynie/titanium_mobile,mano-mykingdom/titanium_mobile,prop/titanium_mobile,mano-mykingdom/titanium_mobile,KoketsoMabuela92/titanium_mobile,mvitr/titanium_mobile,bhatfield/titanium_mobile,cheekiatng/titanium_mobile,pec1985/titanium_mobile,prop/titanium_mobile,peymanmortazavi/titanium_mobile,csg-coder/titanium_mobile,shopmium/titanium_mobile,prop/titanium_mobile,jvkops/titanium_mobile,arnaudsj/titanium_mobile,kopiro/titanium_mobile,kopiro/titanium_mobile,perdona/titanium_mobile,smit1625/titanium_mobile,formalin14/titanium_mobile,ashcoding/titanium_mobile,peymanmortazavi/titanium_mobile,pinnamur/titanium_mobile,linearhub/titanium_mobile,bhatfield/titanium_mobile,openbaoz/titanium_mobile,kopiro/titanium_mobile,emilyvon/titanium_mobile,emilyvon/titanium_mobile,indera/titanium_mobile,jhaynie/titanium_mobile,formalin14/titanium_mobile,hieupham007/Titanium_Mobile,pec1985/titanium_mobile,taoger/titanium_mobile,perdona/titanium_mobile,KoketsoMabuela92/titanium_mobile,csg-coder/titanium_mobile,AngelkPetkov/titanium_mobile,FokkeZB/titanium_mobile,rblalock/titanium_mobile,peymanmortazavi/titanium_mobile,cheekiatng/titanium_mobile,csg-coder/titanium_mobile,FokkeZB/titanium_mobile,openbaoz/titanium_mobile,arnaudsj/titanium_mobile,jvkops/titanium_mobile,arnaudsj/titanium_mobile,linearhub/titanium_mobile,sriks/titanium_mobile,cheekiatng/titanium_mobile,jhaynie/titanium_mobile,bright-sparks/titanium_mobile,indera/titanium_mobile,ashcoding/titanium_mobile,sriks/titanium_mobile,bright-sparks/titanium_mobile,smit1625/titanium_mobile,arnaudsj/titanium_mobile,indera/titanium_mobile,sriks/titanium_mobile,mvitr/titanium_mobile,peymanmortazavi/titanium_mobile,cheekiatng/titanium_mobile,emilyvon/titanium_mobile,pinnamur/titanium_mobile,emilyvon/titanium_mobile,benbahrenburg/titanium_mobile,csg-coder/titanium_mobile,shopmium/titanium_mobile,mvitr/titanium_mobile,formalin14/titanium_mobile,shopmium/titanium_mobile,emilyvon/titanium_mobile,mvitr/titanium_mobile,AngelkPetkov/titanium_mobile,linearhub/titanium_mobile,mvitr/titanium_mobile,peymanmortazavi/titanium_mobile,ashcoding/titanium_mobile,hieupham007/Titanium_Mobile,pec1985/titanium_mobile,FokkeZB/titanium_mobile,csg-coder/titanium_mobile,sriks/titanium_mobile,KangaCoders/titanium_mobile,indera/titanium_mobile,KangaCoders/titanium_mobile,benbahrenburg/titanium_mobile,bright-sparks/titanium_mobile,perdona/titanium_mobile,collinprice/titanium_mobile,prop/titanium_mobile,jvkops/titanium_mobile,hieupham007/Titanium_Mobile,pec1985/titanium_mobile,kopiro/titanium_mobile,bhatfield/titanium_mobile,falkolab/titanium_mobile,sriks/titanium_mobile,kopiro/titanium_mobile,openbaoz/titanium_mobile,FokkeZB/titanium_mobile,bhatfield/titanium_mobile,openbaoz/titanium_mobile,jvkops/titanium_mobile,pec1985/titanium_mobile,taoger/titanium_mobile,jhaynie/titanium_mobile,bright-sparks/titanium_mobile,mano-mykingdom/titanium_mobile,bhatfield/titanium_mobile,perdona/titanium_mobile,emilyvon/titanium_mobile,pec1985/titanium_mobile,shopmium/titanium_mobile,bright-sparks/titanium_mobile,shopmium/titanium_mobile,bright-sparks/titanium_mobile,falkolab/titanium_mobile,mvitr/titanium_mobile,emilyvon/titanium_mobile,KoketsoMabuela92/titanium_mobile,collinprice/titanium_mobile,benbahrenburg/titanium_mobile,peymanmortazavi/titanium_mobile,pinnamur/titanium_mobile,benbahrenburg/titanium_mobile,bhatfield/titanium_mobile,AngelkPetkov/titanium_mobile,AngelkPetkov/titanium_mobile,KoketsoMabuela92/titanium_mobile,kopiro/titanium_mobile,jvkops/titanium_mobile,linearhub/titanium_mobile,KangaCoders/titanium_mobile,taoger/titanium_mobile,pinnamur/titanium_mobile,prop/titanium_mobile,smit1625/titanium_mobile,bhatfield/titanium_mobile,smit1625/titanium_mobile,hieupham007/Titanium_Mobile,jhaynie/titanium_mobile,mvitr/titanium_mobile,perdona/titanium_mobile,hieupham007/Titanium_Mobile,hieupham007/Titanium_Mobile,taoger/titanium_mobile,AngelkPetkov/titanium_mobile,rblalock/titanium_mobile,benbahrenburg/titanium_mobile,linearhub/titanium_mobile,mano-mykingdom/titanium_mobile,benbahrenburg/titanium_mobile,perdona/titanium_mobile,linearhub/titanium_mobile,indera/titanium_mobile,falkolab/titanium_mobile,hieupham007/Titanium_Mobile,perdona/titanium_mobile,jvkops/titanium_mobile,shopmium/titanium_mobile,linearhub/titanium_mobile,hieupham007/Titanium_Mobile,formalin14/titanium_mobile,rblalock/titanium_mobile,taoger/titanium_mobile,prop/titanium_mobile,bright-sparks/titanium_mobile,jhaynie/titanium_mobile,collinprice/titanium_mobile,openbaoz/titanium_mobile,jhaynie/titanium_mobile,KangaCoders/titanium_mobile,formalin14/titanium_mobile,jvkops/titanium_mobile,KangaCoders/titanium_mobile,KoketsoMabuela92/titanium_mobile,AngelkPetkov/titanium_mobile,FokkeZB/titanium_mobile,cheekiatng/titanium_mobile,rblalock/titanium_mobile,ashcoding/titanium_mobile,bright-sparks/titanium_mobile,falkolab/titanium_mobile,prop/titanium_mobile,taoger/titanium_mobile,FokkeZB/titanium_mobile,ashcoding/titanium_mobile,rblalock/titanium_mobile,mano-mykingdom/titanium_mobile,pinnamur/titanium_mobile,openbaoz/titanium_mobile,pec1985/titanium_mobile,jvkops/titanium_mobile,cheekiatng/titanium_mobile,perdona/titanium_mobile,rblalock/titanium_mobile,falkolab/titanium_mobile,sriks/titanium_mobile,pinnamur/titanium_mobile,arnaudsj/titanium_mobile,indera/titanium_mobile,formalin14/titanium_mobile,collinprice/titanium_mobile,linearhub/titanium_mobile,smit1625/titanium_mobile,cheekiatng/titanium_mobile,KoketsoMabuela92/titanium_mobile,openbaoz/titanium_mobile,pinnamur/titanium_mobile,emilyvon/titanium_mobile,peymanmortazavi/titanium_mobile,benbahrenburg/titanium_mobile,KoketsoMabuela92/titanium_mobile,rblalock/titanium_mobile,smit1625/titanium_mobile,collinprice/titanium_mobile,ashcoding/titanium_mobile,indera/titanium_mobile,sriks/titanium_mobile,collinprice/titanium_mobile,taoger/titanium_mobile,rblalock/titanium_mobile,collinprice/titanium_mobile,formalin14/titanium_mobile,collinprice/titanium_mobile,AngelkPetkov/titanium_mobile,csg-coder/titanium_mobile,KangaCoders/titanium_mobile,falkolab/titanium_mobile,KangaCoders/titanium_mobile,smit1625/titanium_mobile,FokkeZB/titanium_mobile,KoketsoMabuela92/titanium_mobile,KangaCoders/titanium_mobile,taoger/titanium_mobile,kopiro/titanium_mobile,csg-coder/titanium_mobile,csg-coder/titanium_mobile,cheekiatng/titanium_mobile,arnaudsj/titanium_mobile,formalin14/titanium_mobile,mano-mykingdom/titanium_mobile
f73256aa30d789aa13df85fd31ce45581bf029a5
/*===- ConfinementForce.h - libSimulation -===================================== * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef CONFINEMENTFORCE_H #define CONFINEMENTFORCE_H #include "Force.h" class ConfinementForce : public Force { public: ConfinementForce(Cloud * const C, double confineConst) : Force(C), confine(confineConst) {} // IMPORTANT: In the above constructor, confineConst must be positive! ~ConfinementForce() {} virtual void force1(const double currentTime); // rk substep 1 virtual void force2(const double currentTime); // rk substep 2 virtual void force3(const double currentTime); // rk substep 3 virtual void force4(const double currentTime); // rk substep 4 virtual void writeForce(fitsfile * const file, int * const error) const; virtual void readForce(fitsfile * const file, int * const error); private: double confine; // [V/m^2] void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY); }; #endif // CONFINEMENTFORCE_H
/*===- ConfinementForce.h - libSimulation -===================================== * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef CONFINEMENTFORCE_H #define CONFINEMENTFORCE_H #include "Force.h" class ConfinementForce : public Force { public: ConfinementForce(Cloud * const C, double confineConst) : Force(C), confine(confineConst) {} // IMPORTANT: In the above constructor, confineConst must be positive! ~ConfinementForce() {} void force1(const double currentTime); // rk substep 1 void force2(const double currentTime); // rk substep 2 void force3(const double currentTime); // rk substep 3 void force4(const double currentTime); // rk substep 4 void writeForce(fitsfile * const file, int * const error) const; void readForce(fitsfile * const file, int * const error); private: double confine; // [V/m^2] void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY); }; #endif // CONFINEMENTFORCE_H
--- +++ @@ -19,13 +19,13 @@ // IMPORTANT: In the above constructor, confineConst must be positive! ~ConfinementForce() {} - void force1(const double currentTime); // rk substep 1 - void force2(const double currentTime); // rk substep 2 - void force3(const double currentTime); // rk substep 3 - void force4(const double currentTime); // rk substep 4 + virtual void force1(const double currentTime); // rk substep 1 + virtual void force2(const double currentTime); // rk substep 2 + virtual void force3(const double currentTime); // rk substep 3 + virtual void force4(const double currentTime); // rk substep 4 - void writeForce(fitsfile * const file, int * const error) const; - void readForce(fitsfile * const file, int * const error); + virtual void writeForce(fitsfile * const file, int * const error) const; + virtual void readForce(fitsfile * const file, int * const error); private: double confine; // [V/m^2]
Add virtual to methods that get overridden.
bsd-3-clause
leios/demonsimulationcode,leios/demonsimulationcode
9899ff8cb4bd63601fc3dfa115b00d65c3388fff
#import <Foundation/Foundation.h> /// Macro that marks an initializer as designated, and also makes the default Foundation initializers unavailable #define HUB_DESIGNATED_INITIALIZER NS_DESIGNATED_INITIALIZER; \ /** Unavailable. Use the designated initializer instead */ \ + (instancetype)new NS_UNAVAILABLE; \ /** Unavailable. Use the designated initializer instead */ \ - (instancetype)init NS_UNAVAILABLE; \ /** Unavailable. Use the designated initializer instead */ \ - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; /// This macro was introduced in Xcode 8, so adding this here for now (if not defined) to support Xcode 7 as well #ifndef NS_EXTENSIBLE_STRING_ENUM #define NS_EXTENSIBLE_STRING_ENUM #endif
#import <Foundation/Foundation.h> /// Macro that marks an initializer as designated, and also makes the default Foundation initializers unavailable #define HUB_DESIGNATED_INITIALIZER NS_DESIGNATED_INITIALIZER; \ /** Unavailable. Use the designated initializer instead */ \ + (instancetype)new NS_UNAVAILABLE; \ /** Unavailable. Use the designated initializer instead */ \ - (instancetype)init NS_UNAVAILABLE; \ /** Unavailable. Use the designated initializer instead */ \ - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
--- +++ @@ -8,3 +8,8 @@ - (instancetype)init NS_UNAVAILABLE; \ /** Unavailable. Use the designated initializer instead */ \ - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; + +/// This macro was introduced in Xcode 8, so adding this here for now (if not defined) to support Xcode 7 as well +#ifndef NS_EXTENSIBLE_STRING_ENUM + #define NS_EXTENSIBLE_STRING_ENUM +#endif
Define NS_EXTENSIBLE_STRING_ENUM if not defined This enables us to support building with Xcode 7.
apache-2.0
spotify/HubFramework,spotify/HubFramework,spotify/HubFramework,spotify/HubFramework
3d1939e899fdbb7d71998f33221e687b61c291af
/* Minimal C SDL example. This code is in the public domain. Compile with: gcc -o minc minc.c `sdl2-config --cflags --libs` */ #include <unistd.h> #include <assert.h> #include <stdio.h> #include "SDL.h" int main(int argc, char** argv) { assert (SDL_Init(SDL_INIT_VIDEO) == 0); SDL_Window *w = SDL_CreateWindow ("SDL OpenGL (C)", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL); assert (w); SDL_Delay (3000); SDL_DestroyWindow (w); SDL_Quit (); return 0; }
/* Minimal C SDL example. This code is in the public domain. Compile with: gcc `sdl2-config --cflags` `sdl2-config --libs` minc.c */ #include <unistd.h> #include <assert.h> #include <stdio.h> #include "SDL.h" int main(int argc, char** argv) { assert (SDL_Init(SDL_INIT_VIDEO) == 0); SDL_Window *w = SDL_CreateWindow ("SDL OpenGL (C)", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL); assert (w); SDL_Delay (3000); SDL_DestroyWindow (w); SDL_Quit (); return 0; }
--- +++ @@ -1,7 +1,7 @@ /* Minimal C SDL example. This code is in the public domain. Compile with: - gcc `sdl2-config --cflags` `sdl2-config --libs` minc.c + gcc -o minc minc.c `sdl2-config --cflags --libs` */ #include <unistd.h>
Update compilation instructions for minimal C example.
isc
dbuenzli/tsdl
22190c6a5152fba9cec3807d96762a8da9a31130
// See copyright notice in Copying. #ifndef COMMON_BLOCK_H #define COMMON_BLOCK_H #define FLAG_DEFAULT 0u #define FLAG_IS_FRAGMENT (1u << 0) #define FLAG_ADMIN (1u << 1) #define FLAG_NO_FRAGMENT (1u << 2) #define FLAG_CUSTODY (1u << 3) #define FLAG_SINGLETON (1u << 4) #define FLAG_ACK (1u << 5) #define PRIO_RESET ~(0x3u << 7) #define PRIO_BULK (0x0u << 7) #define PRIO_NORMAL (0x1u << 7) #define PRIO_EXPEDITED (0x2u << 7) #define REPORT_RECEPTION (1u << 14) #define REPORT_CUSTODY (1u << 15) #define REPORT_FORWARDING (1u << 16) #define REPORT_DELIVERY (1u << 17) #define REPORT_DELETION (1u << 18) #define FLAG_REPLICATE (1u << 0) #define FLAG_TRANSMIT_STATUS (1u << 1) #define FLAG_DELETE_BUNDLE (1u << 2) #define FLAG_LAST_BLOCK (1u << 3) #define FLAG_DISCARD_BLOCK (1u << 4) #define FLAG_FORWARDED (1u << 5) #define FLAG_CONTAINS_REF (1u << 6) #define FLAG_INVALID (1u << 31) #endif
// See copyright notice in Copying. #ifndef COMMON_BLOCK_H #define COMMON_BLOCK_H enum { FLAG_DEFAULT = 0, FLAG_IS_FRAGMENT = 1 << 0, FLAG_ADMIN = 1 << 1, FLAG_NO_FRAGMENT = 1 << 2, FLAG_CUSTODY = 1 << 3, FLAG_SINGLETON = 1 << 4, FLAG_ACK = 1 << 5, PRIO_RESET = ~(0x3 << 7), PRIO_BULK = 0x0 << 7, PRIO_NORMAL = 0x1 << 7, PRIO_EXPEDITED = 0x2 << 7, REPORT_RECEPTION = 1 << 14, REPORT_CUSTODY = 1 << 15, REPORT_FORWARDING = 1 << 16, REPORT_DELIVERY = 1 << 17, REPORT_DELETION = 1 << 18, FLAG_REPLICATE = 1 << 0, FLAG_TRANSMIT_STATUS = 1 << 1, FLAG_DELETE_BUNDLE = 1 << 2, FLAG_LAST_BLOCK = 1 << 3, FLAG_DISCARD_BLOCK = 1 << 4, FLAG_FORWARDED = 1 << 5, FLAG_CONTAINS_REF = 1 << 6, FLAG_INVALID = 1 << 31, }; #endif
--- +++ @@ -3,36 +3,34 @@ #ifndef COMMON_BLOCK_H #define COMMON_BLOCK_H -enum { - FLAG_DEFAULT = 0, +#define FLAG_DEFAULT 0u - FLAG_IS_FRAGMENT = 1 << 0, - FLAG_ADMIN = 1 << 1, - FLAG_NO_FRAGMENT = 1 << 2, - FLAG_CUSTODY = 1 << 3, - FLAG_SINGLETON = 1 << 4, - FLAG_ACK = 1 << 5, +#define FLAG_IS_FRAGMENT (1u << 0) +#define FLAG_ADMIN (1u << 1) +#define FLAG_NO_FRAGMENT (1u << 2) +#define FLAG_CUSTODY (1u << 3) +#define FLAG_SINGLETON (1u << 4) +#define FLAG_ACK (1u << 5) - PRIO_RESET = ~(0x3 << 7), - PRIO_BULK = 0x0 << 7, - PRIO_NORMAL = 0x1 << 7, - PRIO_EXPEDITED = 0x2 << 7, +#define PRIO_RESET ~(0x3u << 7) +#define PRIO_BULK (0x0u << 7) +#define PRIO_NORMAL (0x1u << 7) +#define PRIO_EXPEDITED (0x2u << 7) - REPORT_RECEPTION = 1 << 14, - REPORT_CUSTODY = 1 << 15, - REPORT_FORWARDING = 1 << 16, - REPORT_DELIVERY = 1 << 17, - REPORT_DELETION = 1 << 18, +#define REPORT_RECEPTION (1u << 14) +#define REPORT_CUSTODY (1u << 15) +#define REPORT_FORWARDING (1u << 16) +#define REPORT_DELIVERY (1u << 17) +#define REPORT_DELETION (1u << 18) - FLAG_REPLICATE = 1 << 0, - FLAG_TRANSMIT_STATUS = 1 << 1, - FLAG_DELETE_BUNDLE = 1 << 2, - FLAG_LAST_BLOCK = 1 << 3, - FLAG_DISCARD_BLOCK = 1 << 4, - FLAG_FORWARDED = 1 << 5, - FLAG_CONTAINS_REF = 1 << 6, +#define FLAG_REPLICATE (1u << 0) +#define FLAG_TRANSMIT_STATUS (1u << 1) +#define FLAG_DELETE_BUNDLE (1u << 2) +#define FLAG_LAST_BLOCK (1u << 3) +#define FLAG_DISCARD_BLOCK (1u << 4) +#define FLAG_FORWARDED (1u << 5) +#define FLAG_CONTAINS_REF (1u << 6) - FLAG_INVALID = 1 << 31, -}; +#define FLAG_INVALID (1u << 31) #endif
Convert flag constants from enum to defines This fixes signedness errors
mit
kchmck/mkbundle
fae9876b444ebf71c67626d2d3d5f9a11ab7b664
#include "NativeNodeUtils.h" #ifndef __FF_CATCHCVEXCEPTIONWORKER_H__ #define __FF_CATCHCVEXCEPTIONWORKER_H__ struct CatchCvExceptionWorker : public FF::SimpleWorker { public: std::string execute() { try { return executeCatchCvExceptionWorker(); } catch (std::exception &e) { return std::string(e.what()); } } virtual std::string executeCatchCvExceptionWorker() = 0; }; #endif
#include "NativeNodeUtils.h" #ifndef __FF_CATCHCVEXCEPTIONWORKER_H__ #define __FF_CATCHCVEXCEPTIONWORKER_H__ struct CatchCvExceptionWorker : public FF::SimpleWorker { public: std::string execute() { try { return executeCatchCvExceptionWorker(); } catch (std::exception e) { return std::string(e.what()); } } virtual std::string executeCatchCvExceptionWorker() = 0; }; #endif
--- +++ @@ -8,7 +8,7 @@ std::string execute() { try { return executeCatchCvExceptionWorker(); - } catch (std::exception e) { + } catch (std::exception &e) { return std::string(e.what()); } }
Add more helpful C++ error messages
mit
justadudewhohacks/opencv4nodejs,justadudewhohacks/opencv4nodejs,justadudewhohacks/opencv4nodejs,justadudewhohacks/opencv4nodejs,justadudewhohacks/opencv4nodejs,justadudewhohacks/opencv4nodejs
4d26eeb21841892bbab01c023a32f285e94a84bb
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <area51/hashmap.h> #include <area51/list.h> #include <area51/log.h> #include <nre/reference.h> #include <nre/schedule.h> /* * Callback to add a schedule to the crs locations map */ static bool indexAll(void *k, void *v, void *c) { int *ridId = k; struct Schedule *sched = v; struct Schedules *s = c; Node *n = list_getHead(&sched->locations); while (list_isNode(n)) { struct SchedLoc *sl = (struct SchedLoc *) n; n = list_getNext(n); struct LocationRef *l = hashmapGet(s->ref->tiploc, &sl->tpl); if (l && l->crs > 0) hashmapAddList(s->crs, &l->crs, sched); } return true; } /** * Index all schedules adding them to the crs hashmap so we have a list of entries for each station * @param s */ void indexSchedules(struct Schedules *s) { logconsole("Indexing %d schedules", hashmapSize(s->schedules)); // Run through each crs hashmapForEach(s->schedules, indexAll, s); }
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <area51/hashmap.h> #include <area51/list.h> #include <area51/log.h> #include <libxml/xmlreader.h> #include <nre/reference.h> #include <nre/schedule.h> /* * Callback to add a schedule to the crs locations map */ static bool indexAll(void *k, void *v, void *c) { int *ridId = k; struct Schedule *sched = v; struct Schedules *s = c; Node *n = list_getHead(&sched->locations); while (list_isNode(n)) { struct SchedLoc *sl = (struct SchedLoc *) n; n = list_getNext(n); struct LocationRef *l = hashmapGet(s->ref->tiploc, &sl->tpl); if (l && l->crs > 0) hashmapAddList(s->crs, &l->crs, s); } return true; } /** * Index all schedules adding them to the crs hashmap so we have a list of entries for each station * @param s */ void indexSchedules(struct Schedules *s) { logconsole("Indexing %d schedules", hashmapSize(s->schedules)); // Run through each crs hashmapForEach(s->schedules, indexAll, s); }
--- +++ @@ -6,7 +6,6 @@ #include <area51/hashmap.h> #include <area51/list.h> #include <area51/log.h> -#include <libxml/xmlreader.h> #include <nre/reference.h> #include <nre/schedule.h> @@ -25,7 +24,7 @@ struct LocationRef *l = hashmapGet(s->ref->tiploc, &sl->tpl); if (l && l->crs > 0) - hashmapAddList(s->crs, &l->crs, s); + hashmapAddList(s->crs, &l->crs, sched); } return true;
Index schedule not the main struct
apache-2.0
peter-mount/departureboards,peter-mount/departureboards,peter-mount/departureboards
b883b10aef5ff23e7ad6c9342b5d27db26632837
// // PSTCKTransactionParams.h // Paystack // #import <Foundation/Foundation.h> #import "PSTCKFormEncodable.h" /** * Representation of the transaction to perform on a card */ @interface PSTCKTransactionParams : NSObject<PSTCKFormEncodable> @property (nonatomic, copy, nonnull) NSString *email; @property (nonatomic) NSUInteger amount; @property (nonatomic, copy, nullable) NSString *reference; @property (nonatomic, copy, nullable) NSString *subaccount; @property (nonatomic) NSInteger transaction_charge; @property (nonatomic, copy, nullable) NSString *bearer; @property (nonatomic, readonly, nullable) NSString *metadata; @property (nonatomic, nullable) NSString *plan; @property (nonatomic, nullable) NSString *currency; - (nullable PSTCKTransactionParams *) setMetadataValue:(nonnull NSString*)value forKey:(nonnull NSString*)key error:(NSError * _Nullable __autoreleasing * _Nonnull) error; - (nullable PSTCKTransactionParams *) setCustomFieldValue:(nonnull NSString*)value displayedAs:(nonnull NSString*)display_name error:(NSError * _Nullable __autoreleasing * _Nonnull) error; @end
// // PSTCKTransactionParams.h // Paystack // #import <Foundation/Foundation.h> #import "PSTCKFormEncodable.h" /** * Representation of the transaction to perform on a card */ @interface PSTCKTransactionParams : NSObject<PSTCKFormEncodable> @property (nonatomic, copy, nonnull) NSString *email; @property (nonatomic) NSUInteger amount; @property (nonatomic, copy, nullable) NSString *reference; @property (nonatomic, copy, nullable) NSString *subaccount; @property (nonatomic) NSInteger transaction_charge; @property (nonatomic, copy, nullable) NSString *bearer; @property (nonatomic, readonly, nullable) NSString *metadata; @property (nonatomic, readonly, nullable) NSString *plan; @property (nonatomic, readonly, nullable) NSString *currency; - (nullable PSTCKTransactionParams *) setMetadataValue:(nonnull NSString*)value forKey:(nonnull NSString*)key error:(NSError * _Nullable __autoreleasing * _Nonnull) error; - (nullable PSTCKTransactionParams *) setCustomFieldValue:(nonnull NSString*)value displayedAs:(nonnull NSString*)display_name error:(NSError * _Nullable __autoreleasing * _Nonnull) error; @end
--- +++ @@ -17,8 +17,8 @@ @property (nonatomic) NSInteger transaction_charge; @property (nonatomic, copy, nullable) NSString *bearer; @property (nonatomic, readonly, nullable) NSString *metadata; -@property (nonatomic, readonly, nullable) NSString *plan; -@property (nonatomic, readonly, nullable) NSString *currency; +@property (nonatomic, nullable) NSString *plan; +@property (nonatomic, nullable) NSString *currency; - (nullable PSTCKTransactionParams *) setMetadataValue:(nonnull NSString*)value forKey:(nonnull NSString*)key
[fix] Make sure plan and currency are not readonly
mit
PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios
bd1ce049956272df99ec52598a2234afa32b3055
#pragma once #include <array> namespace filter { /* * Warning: This class does not protect against sum overflow. It is possible * that the sum of values exceeds the maximum value T can store. */ template <typename T, size_t N> class MovingAverage { public: MovingAverage(T initial_value=static_cast<T>(0)); T output() const; // return average of data in buffer T output(T input); // add new value to buffer and return average private: std::array<T, N> m_data; // circular buffer containing samples size_t m_data_index; // index of oldest circular buffer element T m_sum; // sum of all elements in buffer }; } // namespace filter #include "filter/movingaverage.hh"
#pragma once #include <array> namespace filter { template <typename T, size_t N> class MovingAverage { public: MovingAverage(T initial_value=static_cast<T>(0)); T output() const; // return average of data in buffer T output(T input); // add new value to buffer and return average private: std::array<T, N> m_data; // circular buffer containing samples size_t m_data_index; // index of oldest circular buffer element T m_sum; // sum of all elements in buffer }; } // namespace filter #include "filter/movingaverage.hh"
--- +++ @@ -2,6 +2,11 @@ #include <array> namespace filter { + +/* + * Warning: This class does not protect against sum overflow. It is possible + * that the sum of values exceeds the maximum value T can store. + */ template <typename T, size_t N> class MovingAverage {
Document possibility of sum overflow in MovingAverage
bsd-2-clause
oliverlee/phobos,oliverlee/phobos,oliverlee/phobos,oliverlee/phobos
f0d5e3667099a34ca060fc13de19ef5be0c84db2
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_FLOAT_UTIL_H_ #define BASE_FLOAT_UTIL_H_ #pragma once #include "build/build_config.h" #include <float.h> #include <math.h> #if defined(OS_SOLARIS) #include <ieeefp.h> #endif namespace base { inline bool IsFinite(const double& number) { #if defined(OS_MACOSX) // C99 says isfinite() replaced finite(), and iOS does not provide the // older call. return isfinite(number) != 0; #elif defined(OS_POSIX) return finite(number) != 0; #elif defined(OS_WIN) return _finite(number) != 0; #endif } } // namespace base #endif // BASE_FLOAT_UTIL_H_
// Copyright (c) 2006-2008 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 BASE_FLOAT_UTIL_H_ #define BASE_FLOAT_UTIL_H_ #pragma once #include "build/build_config.h" #include <float.h> #include <math.h> #if defined(OS_SOLARIS) #include <ieeefp.h> #endif namespace base { inline bool IsFinite(const double& number) { #if defined(OS_POSIX) return finite(number) != 0; #elif defined(OS_WIN) return _finite(number) != 0; #endif } } // namespace base #endif // BASE_FLOAT_UTIL_H_
--- +++ @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,7 +18,11 @@ namespace base { inline bool IsFinite(const double& number) { -#if defined(OS_POSIX) +#if defined(OS_MACOSX) + // C99 says isfinite() replaced finite(), and iOS does not provide the + // older call. + return isfinite(number) != 0; +#elif defined(OS_POSIX) return finite(number) != 0; #elif defined(OS_WIN) return _finite(number) != 0;
Use isfinite instead of finite on Mac According to math.h in the 10.6 SDK, finite is deprecated in favor of isfinite, and finite isn't available on iOS. BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10704126 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@145876 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
dushu1203/chromium.src,hujiajie/pa-chromium,dednal/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,dednal/chromium.src,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,patrickm/chromium.src,patrickm/chromium.src,keishi/chromium,axinging/chromium-crosswalk,hujiajie/pa-chromium,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,M4sse/chromium.src,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,M4sse/chromium.src,hujiajie/pa-chromium,ltilve/chromium,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,keishi/chromium,hgl888/chromium-crosswalk,anirudhSK/chromium,keishi/chromium,patrickm/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,keishi/chromium,hgl888/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,Chilledheart/chromium,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,patrickm/chromium.src,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,ltilve/chromium,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,anirudhSK/chromium,Just-D/chromium-1,markYoungH/chromium.src,anirudhSK/chromium,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,jaruba/chromium.src,zcbenz/cefode-chromium,dednal/chromium.src,dushu1203/chromium.src,fujunwei/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,ondra-novak/chromium.src,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,littlstar/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,keishi/chromium,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,zcbenz/cefode-chromium,Just-D/chromium-1,M4sse/chromium.src,jaruba/chromium.src,Chilledheart/chromium,Chilledheart/chromium,keishi/chromium,junmin-zhu/chromium-rivertrail,ltilve/chromium,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,nacl-webkit/chrome_deps,patrickm/chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,anirudhSK/chromium,markYoungH/chromium.src,fujunwei/chromium-crosswalk,keishi/chromium,dushu1203/chromium.src,keishi/chromium,jaruba/chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,mogoweb/chromium-crosswalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,dednal/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,keishi/chromium,ltilve/chromium,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,Chilledheart/chromium,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,dednal/chromium.src,jaruba/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,markYoungH/chromium.src,anirudhSK/chromium,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,patrickm/chromium.src,anirudhSK/chromium,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,Chilledheart/chromium,hujiajie/pa-chromium,keishi/chromium,ondra-novak/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,ltilve/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,keishi/chromium,timopulkkinen/BubbleFish,Jonekee/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,dednal/chromium.src,ChromiumWebApps/chromium,M4sse/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium
c894081a7f7ac467d6282b8955e32dd3ac040ef1
class dccChat : public Module { public: virtual void onDCCReceive(std::string dccid, std::string message); }; class dccSender : public Module { public: virtual void dccSend(std::string dccid, std::string message); virtual bool hookDCCMessage(std::string modName, std::string hookMsg); };
class dccChat : public Module { public: void onDCCReceive(std::string dccid, std::string message); }; class dccSender : public Module { public: void dccSend(std::string dccid, std::string message); };
--- +++ @@ -1,9 +1,10 @@ class dccChat : public Module { public: - void onDCCReceive(std::string dccid, std::string message); + virtual void onDCCReceive(std::string dccid, std::string message); }; class dccSender : public Module { public: - void dccSend(std::string dccid, std::string message); + virtual void dccSend(std::string dccid, std::string message); + virtual bool hookDCCMessage(std::string modName, std::string hookMsg); };
Fix those functions not being virtual.
mit
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
d569c69ea1a361ada0e09f2c58bd611b686d82e9
/** * \file os_rmdir.c * \brief Remove a subdirectory. * \author Copyright (c) 2002-2013 Jason Perkins and the Premake project */ #include <stdlib.h> #include "premake.h" int os_rmdir(lua_State* L) { int z; const char* path = luaL_checkstring(L, 1); #if PLATFORM_WINDOWS z = RemoveDirectory(path); #else z = (0 == rmdir(path)); #endif if (!z) { lua_pushnil(L); lua_pushfstring(L, "unable to remove directory '%s'", path); return 2; } else { lua_pushboolean(L, 1); return 1; } }
/** * \file os_rmdir.c * \brief Remove a subdirectory. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include <stdlib.h> #include "premake.h" int os_rmdir(lua_State* L) { int z; const char* path = luaL_checkstring(L, 1); #if PLATFORM_WINDOWS z = RemoveDirectory(path); #else z = rmdir(path); #endif if (!z) { lua_pushnil(L); lua_pushfstring(L, "unable to remove directory '%s'", path); return 2; } else { lua_pushboolean(L, 1); return 1; } }
--- +++ @@ -1,7 +1,7 @@ /** * \file os_rmdir.c * \brief Remove a subdirectory. - * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project + * \author Copyright (c) 2002-2013 Jason Perkins and the Premake project */ #include <stdlib.h> @@ -16,7 +16,7 @@ #if PLATFORM_WINDOWS z = RemoveDirectory(path); #else - z = rmdir(path); + z = (0 == rmdir(path)); #endif if (!z)
Fix error result handling in os.rmdir()
bsd-3-clause
Yhgenomics/premake-core,felipeprov/premake-core,sleepingwit/premake-core,xriss/premake-core,bravnsgaard/premake-core,grbd/premake-core,PlexChat/premake-core,prapin/premake-core,soundsrc/premake-core,prapin/premake-core,prapin/premake-core,jsfdez/premake-core,sleepingwit/premake-core,resetnow/premake-core,LORgames/premake-core,sleepingwit/premake-core,PlexChat/premake-core,noresources/premake-core,Blizzard/premake-core,soundsrc/premake-core,Meoo/premake-core,lizh06/premake-core,resetnow/premake-core,tvandijck/premake-core,TurkeyMan/premake-core,sleepingwit/premake-core,martin-traverse/premake-core,felipeprov/premake-core,jstewart-amd/premake-core,LORgames/premake-core,jsfdez/premake-core,aleksijuvani/premake-core,mendsley/premake-core,Meoo/premake-core,LORgames/premake-core,martin-traverse/premake-core,soundsrc/premake-core,premake/premake-core,resetnow/premake-core,mandersan/premake-core,lizh06/premake-core,starkos/premake-core,starkos/premake-core,premake/premake-core,mendsley/premake-core,noresources/premake-core,Blizzard/premake-core,alarouche/premake-core,TurkeyMan/premake-core,saberhawk/premake-core,TurkeyMan/premake-core,prapin/premake-core,alarouche/premake-core,Yhgenomics/premake-core,mandersan/premake-core,CodeAnxiety/premake-core,tritao/premake-core,dcourtois/premake-core,mandersan/premake-core,alarouche/premake-core,Meoo/premake-core,mendsley/premake-core,dcourtois/premake-core,Blizzard/premake-core,noresources/premake-core,bravnsgaard/premake-core,Blizzard/premake-core,soundsrc/premake-core,jstewart-amd/premake-core,Blizzard/premake-core,dcourtois/premake-core,dcourtois/premake-core,jsfdez/premake-core,sleepingwit/premake-core,akaStiX/premake-core,premake/premake-core,Tiger66639/premake-core,Zefiros-Software/premake-core,grbd/premake-core,saberhawk/premake-core,aleksijuvani/premake-core,PlexChat/premake-core,CodeAnxiety/premake-core,Zefiros-Software/premake-core,tvandijck/premake-core,alarouche/premake-core,Meoo/premake-core,jsfdez/premake-core,grbd/premake-core,Tiger66639/premake-core,starkos/premake-core,starkos/premake-core,tritao/premake-core,Yhgenomics/premake-core,xriss/premake-core,kankaristo/premake-core,bravnsgaard/premake-core,xriss/premake-core,Zefiros-Software/premake-core,dcourtois/premake-core,saberhawk/premake-core,felipeprov/premake-core,premake/premake-core,premake/premake-core,mandersan/premake-core,grbd/premake-core,akaStiX/premake-core,starkos/premake-core,Tiger66639/premake-core,jstewart-amd/premake-core,tvandijck/premake-core,noresources/premake-core,tritao/premake-core,martin-traverse/premake-core,kankaristo/premake-core,noresources/premake-core,TurkeyMan/premake-core,jstewart-amd/premake-core,resetnow/premake-core,Zefiros-Software/premake-core,aleksijuvani/premake-core,xriss/premake-core,tvandijck/premake-core,saberhawk/premake-core,PlexChat/premake-core,bravnsgaard/premake-core,dcourtois/premake-core,jstewart-amd/premake-core,premake/premake-core,tritao/premake-core,mandersan/premake-core,Zefiros-Software/premake-core,mendsley/premake-core,martin-traverse/premake-core,noresources/premake-core,resetnow/premake-core,CodeAnxiety/premake-core,xriss/premake-core,TurkeyMan/premake-core,CodeAnxiety/premake-core,bravnsgaard/premake-core,felipeprov/premake-core,Tiger66639/premake-core,akaStiX/premake-core,akaStiX/premake-core,LORgames/premake-core,lizh06/premake-core,LORgames/premake-core,soundsrc/premake-core,CodeAnxiety/premake-core,Blizzard/premake-core,premake/premake-core,aleksijuvani/premake-core,starkos/premake-core,starkos/premake-core,kankaristo/premake-core,Yhgenomics/premake-core,dcourtois/premake-core,kankaristo/premake-core,tvandijck/premake-core,noresources/premake-core,mendsley/premake-core,aleksijuvani/premake-core,lizh06/premake-core
ff8d8029fdfa0b28c67012b8fcddb4e2d9a2523d
#ifdef _WIN32 #include <time.h> #ifndef METRO #include <winsock2.h> #endif #include <windows.h> #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 #else #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #endif struct timeval; int gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ft; unsigned __int64 tmpres = 0; if (tv) { GetSystemTimeAsFileTime(&ft); tmpres |= ft.dwHighDateTime; tmpres <<= 32; tmpres |= ft.dwLowDateTime; tmpres /= 10; /*convert into microseconds*/ /*converting file time to unix epoch*/ tmpres -= DELTA_EPOCH_IN_MICROSECS; tv->tv_sec = (long)(tmpres / 1000000UL); tv->tv_usec = (long)(tmpres % 1000000UL); } return 0; } #else void fz_gettimeofday_dummy() { } #endif
#ifdef _WIN32 #include <time.h> #include <winsock2.h> #include <windows.h> #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 #else #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #endif struct timeval; int gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ft; unsigned __int64 tmpres = 0; if (tv) { GetSystemTimeAsFileTime(&ft); tmpres |= ft.dwHighDateTime; tmpres <<= 32; tmpres |= ft.dwLowDateTime; tmpres /= 10; /*convert into microseconds*/ /*converting file time to unix epoch*/ tmpres -= DELTA_EPOCH_IN_MICROSECS; tv->tv_sec = (long)(tmpres / 1000000UL); tv->tv_usec = (long)(tmpres % 1000000UL); } return 0; } #else void fz_gettimeofday_dummy() { } #endif
--- +++ @@ -1,7 +1,9 @@ #ifdef _WIN32 #include <time.h> +#ifndef METRO #include <winsock2.h> +#endif #include <windows.h> #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
Tweak to allow building on metro. Limited testing seems to suggest that the only thing stopping the MuPDF library building on metro seems to be the use of winsock.h.
agpl-3.0
hackqiang/mupdf,crow-misia/mupdf,knielsen/mupdf,lustersir/MuPDF,ArtifexSoftware/mupdf,lamemate/mupdf,flipstudio/MuPDF,FabriceSalvaire/mupdf-cmake,lolo32/mupdf-mirror,MokiMobility/muPDF,geetakaur/NewApps,sebras/mupdf,Kalp695/mupdf,kobolabs/mupdf,asbloomf/mupdf,hxx0215/MuPDFMirror,michaelcadilhac/pdfannot,tophyr/mupdf,hjiayz/forkmupdf,muennich/mupdf,benoit-pierre/mupdf,muennich/mupdf,xiangxw/mupdf,FabriceSalvaire/mupdf-v1.3,github201407/MuPDF,zeniko/mupdf,poor-grad-student/mupdf,flipstudio/MuPDF,ArtifexSoftware/mupdf,seagullua/MuPDF,MokiMobility/muPDF,knielsen/mupdf,ylixir/mupdf,github201407/MuPDF,PuzzleFlow/mupdf,derek-watson/mupdf,crow-misia/mupdf,wzhsunn/mupdf,kobolabs/mupdf,cgogolin/penandpdf,wzhsunn/mupdf,lustersir/MuPDF,Kalp695/mupdf,lamemate/mupdf,fluks/mupdf-x11-bookmarks,nqv/mupdf,hackqiang/mupdf,github201407/MuPDF,fluks/mupdf-x11-bookmarks,ccxvii/mupdf,sebras/mupdf,clchiou/mupdf,ArtifexSoftware/mupdf,ArtifexSoftware/mupdf,andyhan/mupdf,michaelcadilhac/pdfannot,derek-watson/mupdf,samturneruk/mupdf_secure_android,tribals/mupdf,wzhsunn/mupdf,Kalp695/mupdf,wild0/opened_mupdf,FabriceSalvaire/mupdf-v1.3,wild0/opened_mupdf,ArtifexSoftware/mupdf,issuestand/mupdf,TamirEvan/mupdf,muennich/mupdf,andyhan/mupdf,kobolabs/mupdf,poor-grad-student/mupdf,hxx0215/MuPDFMirror,robamler/mupdf-nacl,sebras/mupdf,muennich/mupdf,tribals/mupdf,issuestand/mupdf,hackqiang/mupdf,ccxvii/mupdf,ArtifexSoftware/mupdf,cgogolin/penandpdf,geetakaur/NewApps,asbloomf/mupdf,andyhan/mupdf,nqv/mupdf,loungeup/mupdf,hxx0215/MuPDFMirror,lustersir/MuPDF,wild0/opened_mupdf,fluks/mupdf-x11-bookmarks,seagullua/MuPDF,lamemate/mupdf,knielsen/mupdf,wzhsunn/mupdf,MokiMobility/muPDF,TamirEvan/mupdf,hjiayz/forkmupdf,github201407/MuPDF,nqv/mupdf,lolo32/mupdf-mirror,nqv/mupdf,samturneruk/mupdf_secure_android,PuzzleFlow/mupdf,loungeup/mupdf,Kalp695/mupdf,andyhan/mupdf,hjiayz/forkmupdf,hjiayz/forkmupdf,derek-watson/mupdf,hxx0215/MuPDFMirror,robamler/mupdf-nacl,sebras/mupdf,tribals/mupdf,seagullua/MuPDF,issuestand/mupdf,lustersir/MuPDF,Kalp695/mupdf,issuestand/mupdf,MokiMobility/muPDF,isavin/humblepdf,FabriceSalvaire/mupdf-cmake,samturneruk/mupdf_secure_android,clchiou/mupdf,hackqiang/mupdf,lolo32/mupdf-mirror,robamler/mupdf-nacl,FabriceSalvaire/mupdf-v1.3,wild0/opened_mupdf,github201407/MuPDF,isavin/humblepdf,zeniko/mupdf,tribals/mupdf,loungeup/mupdf,Kalp695/mupdf,hxx0215/MuPDFMirror,FabriceSalvaire/mupdf-v1.3,ziel/mupdf,zeniko/mupdf,cgogolin/penandpdf,zeniko/mupdf,tophyr/mupdf,lolo32/mupdf-mirror,TamirEvan/mupdf,hackqiang/mupdf,TamirEvan/mupdf,lamemate/mupdf,lolo32/mupdf-mirror,ziel/mupdf,muennich/mupdf,FabriceSalvaire/mupdf-cmake,geetakaur/NewApps,hjiayz/forkmupdf,robamler/mupdf-nacl,TamirEvan/mupdf,lolo32/mupdf-mirror,isavin/humblepdf,ccxvii/mupdf,lolo32/mupdf-mirror,flipstudio/MuPDF,knielsen/mupdf,ArtifexSoftware/mupdf,clchiou/mupdf,derek-watson/mupdf,benoit-pierre/mupdf,PuzzleFlow/mupdf,ylixir/mupdf,lamemate/mupdf,crow-misia/mupdf,MokiMobility/muPDF,samturneruk/mupdf_secure_android,poor-grad-student/mupdf,cgogolin/penandpdf,poor-grad-student/mupdf,hxx0215/MuPDFMirror,flipstudio/MuPDF,benoit-pierre/mupdf,MokiMobility/muPDF,andyhan/mupdf,flipstudio/MuPDF,isavin/humblepdf,geetakaur/NewApps,lustersir/MuPDF,FabriceSalvaire/mupdf-v1.3,isavin/humblepdf,FabriceSalvaire/mupdf-cmake,wzhsunn/mupdf,benoit-pierre/mupdf,xiangxw/mupdf,muennich/mupdf,clchiou/mupdf,ziel/mupdf,geetakaur/NewApps,michaelcadilhac/pdfannot,benoit-pierre/mupdf,derek-watson/mupdf,sebras/mupdf,asbloomf/mupdf,knielsen/mupdf,kobolabs/mupdf,benoit-pierre/mupdf,zeniko/mupdf,xiangxw/mupdf,isavin/humblepdf,PuzzleFlow/mupdf,PuzzleFlow/mupdf,tophyr/mupdf,michaelcadilhac/pdfannot,FabriceSalvaire/mupdf-v1.3,tophyr/mupdf,lustersir/MuPDF,wzhsunn/mupdf,ylixir/mupdf,samturneruk/mupdf_secure_android,TamirEvan/mupdf,michaelcadilhac/pdfannot,crow-misia/mupdf,tophyr/mupdf,geetakaur/NewApps,PuzzleFlow/mupdf,zeniko/mupdf,ylixir/mupdf,loungeup/mupdf,fluks/mupdf-x11-bookmarks,loungeup/mupdf,asbloomf/mupdf,ylixir/mupdf,github201407/MuPDF,tribals/mupdf,tophyr/mupdf,xiangxw/mupdf,poor-grad-student/mupdf,ziel/mupdf,fluks/mupdf-x11-bookmarks,xiangxw/mupdf,clchiou/mupdf,poor-grad-student/mupdf,crow-misia/mupdf,xiangxw/mupdf,loungeup/mupdf,isavin/humblepdf,ziel/mupdf,hjiayz/forkmupdf,andyhan/mupdf,kobolabs/mupdf,ArtifexSoftware/mupdf,issuestand/mupdf,knielsen/mupdf,seagullua/MuPDF,FabriceSalvaire/mupdf-cmake,seagullua/MuPDF,muennich/mupdf,Kalp695/mupdf,nqv/mupdf,cgogolin/penandpdf,crow-misia/mupdf,nqv/mupdf,hackqiang/mupdf,TamirEvan/mupdf,samturneruk/mupdf_secure_android,xiangxw/mupdf,kobolabs/mupdf,ziel/mupdf,ccxvii/mupdf,fluks/mupdf-x11-bookmarks,ylixir/mupdf,PuzzleFlow/mupdf,ccxvii/mupdf,tribals/mupdf,kobolabs/mupdf,robamler/mupdf-nacl,wild0/opened_mupdf,flipstudio/MuPDF,fluks/mupdf-x11-bookmarks,lamemate/mupdf,FabriceSalvaire/mupdf-cmake,clchiou/mupdf,ccxvii/mupdf,sebras/mupdf,derek-watson/mupdf,michaelcadilhac/pdfannot,wild0/opened_mupdf,cgogolin/penandpdf,wild0/opened_mupdf,TamirEvan/mupdf,asbloomf/mupdf,issuestand/mupdf,robamler/mupdf-nacl,asbloomf/mupdf,seagullua/MuPDF
0cd78c0a12ebc84b56a58016fbcc83aefba64e1a
// MockUIAlertController by Jon Reid, http://qualitycoding.org/about/ // Copyright 2015 Jonathan M. Reid. See LICENSE.txt #import <UIKit/UIKit.h> #import "QCOMockPopoverPresentationController.h" // Convenience import instead of @class /** Captures mocked UIAlertController arguments. */ @interface QCOMockAlertVerifier : NSObject @property (nonatomic, assign) NSUInteger presentedCount; @property (nonatomic, strong) NSNumber *animated; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *message; @property (nonatomic, assign) UIAlertControllerStyle preferredStyle; @property (nonatomic, readonly) NSArray *actionTitles; @property (nonatomic, strong) QCOMockPopoverPresentationController *popover; - (UIAlertActionStyle)styleForButtonWithTitle:(NSString *)title; - (void)executeActionForButtonWithTitle:(NSString *)title; @end
// MockUIAlertController by Jon Reid, http://qualitycoding.org/about/ // Copyright 2015 Jonathan M. Reid. See LICENSE.txt #import <UIKit/UIKit.h> #import "QCOMockPopoverPresentationController.h" // Convenience import instead of @class /** Captures QCOMockAlertController arguments. */ @interface QCOMockAlertVerifier : NSObject @property (nonatomic, assign) NSUInteger presentedCount; @property (nonatomic, strong) NSNumber *animated; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *message; @property (nonatomic, assign) UIAlertControllerStyle preferredStyle; @property (nonatomic, readonly) NSArray *actionTitles; @property (nonatomic, strong) QCOMockPopoverPresentationController *popover; - (UIAlertActionStyle)styleForButtonWithTitle:(NSString *)title; - (void)executeActionForButtonWithTitle:(NSString *)title; @end
--- +++ @@ -7,7 +7,7 @@ /** - Captures QCOMockAlertController arguments. + Captures mocked UIAlertController arguments. */ @interface QCOMockAlertVerifier : NSObject
Change comment to eliminate reference to eliminated test double
mit
foulkesjohn/MockUIAlertController,yas375/MockUIAlertController,carabina/MockUIAlertController
f1c400b56e0bd233a28553053e6fbf70f2d87331
// SDLAbstractProtocol.h // @class SDLAbstractTransport; @class SDLRPCMessage; @class SDLRPCRequest; #import "SDLProtocolListener.h" #import "SDLTransportDelegate.h" @interface SDLAbstractProtocol : NSObject <SDLTransportDelegate> @property (strong) NSString *debugConsoleGroupName; @property (weak) SDLAbstractTransport *transport; @property (strong) NSHashTable *protocolDelegateTable; // table of id<SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendHeartbeat; - (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; - (void)dispose; @end
// SDLAbstractProtocol.h // @class SDLAbstractTransport; @class SDLRPCMessage; @class SDLRPCRequest; #import "SDLProtocolListener.h" #import "SDLTransportDelegate.h" @interface SDLAbstractProtocol : NSObject <SDLTransportDelegate> @property (strong) NSString *debugConsoleGroupName; @property (weak) SDLAbstractTransport *transport; @property (weak) NSHashTable *protocolDelegateTable; // table of id<SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendHeartbeat; - (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; - (void)dispose; @end
--- +++ @@ -13,7 +13,7 @@ @property (strong) NSString *debugConsoleGroupName; @property (weak) SDLAbstractTransport *transport; -@property (weak) NSHashTable *protocolDelegateTable; // table of id<SDLProtocolListener> +@property (strong) NSHashTable *protocolDelegateTable; // table of id<SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType;
Fix SDLProtocol delegate table being released too early
bsd-3-clause
FordDev/sdl_ios,APCVSRepo/sdl_ios,smartdevicelink/sdl_ios,adein/sdl_ios,kshala-ford/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,FordDev/sdl_ios,APCVSRepo/sdl_ios,kshala-ford/sdl_ios,APCVSRepo/sdl_ios,davidswi/sdl_ios,kshala-ford/sdl_ios,davidswi/sdl_ios,APCVSRepo/sdl_ios,FordDev/sdl_ios,FordDev/sdl_ios,smartdevicelink/sdl_ios,adein/sdl_ios,smartdevicelink/sdl_ios,kshala-ford/sdl_ios,davidswi/sdl_ios,davidswi/sdl_ios,APCVSRepo/sdl_ios,FordDev/sdl_ios,davidswi/sdl_ios,smartdevicelink/sdl_ios
a58c131cca2faedf386aa57b7f68b0ab0dd4f6b8
#ifndef _POLYGON_H_ #define _POLYGON_H_ /* * geometric properties of the polygon meant for solving * * The default C pre-processor configuration here is to solve triangles. */ #ifndef POLYGON_DEPTH #define POLYGON_DEPTH 3 #endif #if (POLYGON_DEPTH < 3) #error You cannot have a polygon with fewer than 3 sides! #endif #if (POLYGON_DEPTH > 'Z' - 'A') #error Angle labels are currently lettered. Sorry for this limitation. #endif /* * All polygons have a fixed limit to the total measure of their angles. * For example, the angles of a triangle always sum up to 180 degrees. */ #define INTERIOR_DEGREES (180 * ((POLYGON_DEPTH) - 2)) /* * Geometric lengths cannot be negative or zero. * We will reserve non-positive measures to indicate un-solved "unknowns". */ #define KNOWN(measure) ((measure) > 0) extern int solve_polygon(double * angles, double * sides); extern int already_solved(double * angels, double * sides); extern int find_angle(double * angles); extern int find_side(double * sides, const double * angles); extern int arc_find_angles(double * angles, const double * sides); #endif
#ifndef _POLYGON_H_ #define _POLYGON_H_ /* * geometric properties of the polygon meant for solving * * The default C pre-processor configuration here is to solve triangles. */ #define POLYGON_DEPTH 3 #if (POLYGON_DEPTH < 3) #error You cannot have a polygon with fewer than 3 sides! #endif #if (POLYGON_DEPTH > 'Z' - 'A') #error Angle labels are currently lettered. Sorry for this limitation. #endif /* * All polygons have a fixed limit to the total measure of their angles. * For example, the angles of a triangle always sum up to 180 degrees. */ #define INTERIOR_DEGREES (180 * ((POLYGON_DEPTH) - 2)) /* * Geometric lengths cannot be negative or zero. * We will reserve non-positive measures to indicate un-solved "unknowns". */ #define KNOWN(measure) ((measure) > 0) extern int solve_polygon(double * angles, double * sides); extern int already_solved(double * angels, double * sides); extern int find_angle(double * angles); extern int find_side(double * sides, const double * angles); extern int arc_find_angles(double * angles, const double * sides); #endif
--- +++ @@ -6,8 +6,10 @@ * * The default C pre-processor configuration here is to solve triangles. */ +#ifndef POLYGON_DEPTH +#define POLYGON_DEPTH 3 +#endif -#define POLYGON_DEPTH 3 #if (POLYGON_DEPTH < 3) #error You cannot have a polygon with fewer than 3 sides! #endif
Allow POLYGON_DEPTH to be configurable by compile commands.
cc0-1.0
cxd4/trig,cxd4/trig
941075e6a69846082231e76aca8642d299c2093c
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc #if !defined(__linux__) && !defined(__FreeBSD__) && \ !defined(__OpenBSD__) && !defined(__CYGWIN__) void foo() __attribute__((weak_import)); #else void foo() __attribute__((weak)); #endif void bar() { foo(); }
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) void foo() __attribute__((weak_import)); #else void foo() __attribute__((weak)); #endif void bar() { foo(); }
--- +++ @@ -1,7 +1,8 @@ // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc -#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) +#if !defined(__linux__) && !defined(__FreeBSD__) && \ + !defined(__OpenBSD__) && !defined(__CYGWIN__) void foo() __attribute__((weak_import)); #else void foo() __attribute__((weak));
Make this pass for CYGWIN. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@44354 91177308-0d34-0410-b5e6-96231b3b80d8
bsd-2-clause
dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap
f19341dec7361451f100a882a023b14583454d7e
/*- * This file is in the public domain. */ /* $FreeBSD$ */ #include <i386/clock.h>
/*- * Copyright (C) 2005 TAKAHASHI Yoshihiro. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _PC98_INCLUDE_CLOCK_H_ #define _PC98_INCLUDE_CLOCK_H_ #include <i386/clock.h> #endif /* _PC98_INCLUDE_CLOCK_H_ */
--- +++ @@ -1,33 +1,6 @@ /*- - * Copyright (C) 2005 TAKAHASHI Yoshihiro. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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. - * - * $FreeBSD$ + * This file is in the public domain. */ - -#ifndef _PC98_INCLUDE_CLOCK_H_ -#define _PC98_INCLUDE_CLOCK_H_ +/* $FreeBSD$ */ #include <i386/clock.h> - -#endif /* _PC98_INCLUDE_CLOCK_H_ */
Remove my copyright. This file includes simply i386's one now.
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
4f133b2d11568f9e495cfa76ed1a61bed8b4c81c
/* * rmgrdesc.c * * pg_xlogdump resource managers definition * * contrib/pg_xlogdump/rmgrdesc.c */ #define FRONTEND 1 #include "postgres.h" #include "access/clog.h" #include "access/gin.h" #include "access/gist_private.h" #include "access/hash.h" #include "access/heapam_xlog.h" #include "access/multixact.h" #include "access/nbtree.h" #include "access/rmgr.h" #include "access/spgist.h" #include "access/xact.h" #include "access/xlog_internal.h" #include "catalog/storage_xlog.h" #include "commands/dbcommands.h" #include "commands/sequence.h" #include "commands/tablespace.h" #include "rmgrdesc.h" #include "storage/standby.h" #include "utils/relmapper.h" #define PG_RMGR(symname,name,redo,desc,startup,cleanup) \ { name, desc, }, const RmgrDescData RmgrDescTable[RM_MAX_ID + 1] = { #include "access/rmgrlist.h" };
/* * rmgrdesc.c * * pg_xlogdump resource managers definition * * contrib/pg_xlogdump/rmgrdesc.c */ #define FRONTEND 1 #include "postgres.h" #include "access/clog.h" #include "access/gin.h" #include "access/gist_private.h" #include "access/hash.h" #include "access/heapam_xlog.h" #include "access/multixact.h" #include "access/nbtree.h" #include "access/rmgr.h" #include "access/spgist.h" #include "access/xact.h" #include "access/xlog_internal.h" #include "catalog/storage_xlog.h" #include "commands/dbcommands.h" #include "commands/sequence.h" #include "commands/tablespace.h" #include "rmgrdesc.h" #include "storage/standby.h" #include "utils/relmapper.h" #define PG_RMGR(symname,name,redo,desc,startup,cleanup,restartpoint) \ { name, desc, }, const RmgrDescData RmgrDescTable[RM_MAX_ID + 1] = { #include "access/rmgrlist.h" };
--- +++ @@ -27,7 +27,7 @@ #include "storage/standby.h" #include "utils/relmapper.h" -#define PG_RMGR(symname,name,redo,desc,startup,cleanup,restartpoint) \ +#define PG_RMGR(symname,name,redo,desc,startup,cleanup) \ { name, desc, }, const RmgrDescData RmgrDescTable[RM_MAX_ID + 1] = {
Fix compilation of pg_xlogdump, now that rm_safe_restartpoint is no more. Oops. Pointed out by Andres Freund.
mpl-2.0
Postgres-XL/Postgres-XL,ovr/postgres-xl,oberstet/postgres-xl,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ovr/postgres-xl,adam8157/gpdb,jmcatamney/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,zeroae/postgres-xl,techdragon/Postgres-XL,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,ovr/postgres-xl,greenplum-db/gpdb,greenplum-db/gpdb,yazun/postgres-xl,Postgres-XL/Postgres-XL,ashwinstar/gpdb,yazun/postgres-xl,zeroae/postgres-xl,xinzweb/gpdb,jmcatamney/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,pavanvd/postgres-xl,lisakowen/gpdb,yazun/postgres-xl,ashwinstar/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,xinzweb/gpdb,lisakowen/gpdb,lisakowen/gpdb,zeroae/postgres-xl,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,ovr/postgres-xl,50wu/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,jmcatamney/gpdb,pavanvd/postgres-xl,greenplum-db/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,ashwinstar/gpdb,xinzweb/gpdb,ashwinstar/gpdb,adam8157/gpdb,adam8157/gpdb,50wu/gpdb,oberstet/postgres-xl,techdragon/Postgres-XL,ovr/postgres-xl,ashwinstar/gpdb,lisakowen/gpdb,50wu/gpdb,oberstet/postgres-xl,adam8157/gpdb,jmcatamney/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,adam8157/gpdb,adam8157/gpdb,xinzweb/gpdb,yazun/postgres-xl,greenplum-db/gpdb,jmcatamney/gpdb,yazun/postgres-xl,50wu/gpdb,zeroae/postgres-xl,50wu/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,lisakowen/gpdb,oberstet/postgres-xl
033dc1c92cf018d396e983d425b821dda420cfff
#include "clar_libgit2.h" #include "cache.h" static git_repository *g_repo; void test_threads_basic__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); } void test_threads_basic__cleanup(void) { cl_git_sandbox_cleanup(); } void test_threads_basic__cache(void) { // run several threads polling the cache at the same time cl_assert(1 == 1); } void test_threads_basic__multiple_init(void) { git_repository *nested_repo; git_threads_init(); cl_git_pass(git_repository_open(&nested_repo, cl_fixture("testrepo.git"))); git_repository_free(nested_repo); git_threads_shutdown(); cl_git_pass(git_repository_open(&nested_repo, cl_fixture("testrepo.git"))); git_repository_free(nested_repo); }
#include "clar_libgit2.h" #include "cache.h" static git_repository *g_repo; void test_threads_basic__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); } void test_threads_basic__cleanup(void) { cl_git_sandbox_cleanup(); } void test_threads_basic__cache(void) { // run several threads polling the cache at the same time cl_assert(1 == 1); }
--- +++ @@ -21,3 +21,16 @@ // run several threads polling the cache at the same time cl_assert(1 == 1); } + +void test_threads_basic__multiple_init(void) +{ + git_repository *nested_repo; + + git_threads_init(); + cl_git_pass(git_repository_open(&nested_repo, cl_fixture("testrepo.git"))); + git_repository_free(nested_repo); + + git_threads_shutdown(); + cl_git_pass(git_repository_open(&nested_repo, cl_fixture("testrepo.git"))); + git_repository_free(nested_repo); +}
Add test for multiple thread init/shutdown
lgpl-2.1
mhp/libgit2,maxiaoqian/libgit2,t0xicCode/libgit2,rcorre/libgit2,KTXSoftware/libgit2,Aorjoa/libgit2_maked_lib,chiayolin/libgit2,claudelee/libgit2,claudelee/libgit2,sygool/libgit2,nokiddin/libgit2,yongthecoder/libgit2,oaastest/libgit2,Tousiph/Demo1,spraints/libgit2,Aorjoa/libgit2_maked_lib,leoyanggit/libgit2,yosefhackmon/libgit2,since2014/libgit2,Snazz2001/libgit2,mhp/libgit2,claudelee/libgit2,skabel/manguse,falqas/libgit2,kissthink/libgit2,Snazz2001/libgit2,yosefhackmon/libgit2,maxiaoqian/libgit2,ardumont/libgit2,Tousiph/Demo1,ardumont/libgit2,jflesch/libgit2-mariadb,skabel/manguse,falqas/libgit2,sim0629/libgit2,iankronquist/libgit2,whoisj/libgit2,sygool/libgit2,saurabhsuniljain/libgit2,saurabhsuniljain/libgit2,since2014/libgit2,dleehr/libgit2,falqas/libgit2,raybrad/libit2,oaastest/libgit2,kissthink/libgit2,yongthecoder/libgit2,spraints/libgit2,kissthink/libgit2,magnus98/TEST,rcorre/libgit2,JIghtuse/libgit2,sim0629/libgit2,raybrad/libit2,leoyanggit/libgit2,sygool/libgit2,since2014/libgit2,mcanthony/libgit2,mcanthony/libgit2,spraints/libgit2,nokiddin/libgit2,falqas/libgit2,KTXSoftware/libgit2,mingyaaaa/libgit2,sygool/libgit2,skabel/manguse,Snazz2001/libgit2,kenprice/libgit2,yosefhackmon/libgit2,kenprice/libgit2,Tousiph/Demo1,maxiaoqian/libgit2,dleehr/libgit2,linquize/libgit2,KTXSoftware/libgit2,MrHacky/libgit2,leoyanggit/libgit2,Tousiph/Demo1,rcorre/libgit2,kenprice/libgit2,kenprice/libgit2,jflesch/libgit2-mariadb,Aorjoa/libgit2_maked_lib,Aorjoa/libgit2_maked_lib,ardumont/libgit2,chiayolin/libgit2,jflesch/libgit2-mariadb,jeffhostetler/public_libgit2,saurabhsuniljain/libgit2,yongthecoder/libgit2,iankronquist/libgit2,whoisj/libgit2,joshtriplett/libgit2,linquize/libgit2,yongthecoder/libgit2,raybrad/libit2,mcanthony/libgit2,linquize/libgit2,falqas/libgit2,saurabhsuniljain/libgit2,whoisj/libgit2,swisspol/DEMO-libgit2,amyvmiwei/libgit2,KTXSoftware/libgit2,mhp/libgit2,joshtriplett/libgit2,mingyaaaa/libgit2,kissthink/libgit2,dleehr/libgit2,stewid/libgit2,yosefhackmon/libgit2,spraints/libgit2,oaastest/libgit2,Corillian/libgit2,swisspol/DEMO-libgit2,skabel/manguse,magnus98/TEST,nokiddin/libgit2,MrHacky/libgit2,JIghtuse/libgit2,oaastest/libgit2,leoyanggit/libgit2,mcanthony/libgit2,magnus98/TEST,jeffhostetler/public_libgit2,stewid/libgit2,rcorre/libgit2,mrksrm/Mingijura,dleehr/libgit2,sim0629/libgit2,yongthecoder/libgit2,stewid/libgit2,mrksrm/Mingijura,JIghtuse/libgit2,JIghtuse/libgit2,mhp/libgit2,claudelee/libgit2,Corillian/libgit2,mrksrm/Mingijura,sim0629/libgit2,Snazz2001/libgit2,JIghtuse/libgit2,dleehr/libgit2,joshtriplett/libgit2,since2014/libgit2,mrksrm/Mingijura,skabel/manguse,KTXSoftware/libgit2,magnus98/TEST,oaastest/libgit2,ardumont/libgit2,mingyaaaa/libgit2,saurabhsuniljain/libgit2,leoyanggit/libgit2,JIghtuse/libgit2,amyvmiwei/libgit2,whoisj/libgit2,kenprice/libgit2,kenprice/libgit2,mcanthony/libgit2,stewid/libgit2,ardumont/libgit2,mingyaaaa/libgit2,spraints/libgit2,magnus98/TEST,falqas/libgit2,Corillian/libgit2,Corillian/libgit2,jflesch/libgit2-mariadb,yosefhackmon/libgit2,MrHacky/libgit2,swisspol/DEMO-libgit2,linquize/libgit2,t0xicCode/libgit2,claudelee/libgit2,maxiaoqian/libgit2,Aorjoa/libgit2_maked_lib,oaastest/libgit2,skabel/manguse,swisspol/DEMO-libgit2,Tousiph/Demo1,mingyaaaa/libgit2,iankronquist/libgit2,jeffhostetler/public_libgit2,MrHacky/libgit2,jeffhostetler/public_libgit2,Tousiph/Demo1,joshtriplett/libgit2,mcanthony/libgit2,nokiddin/libgit2,spraints/libgit2,MrHacky/libgit2,jeffhostetler/public_libgit2,joshtriplett/libgit2,joshtriplett/libgit2,KTXSoftware/libgit2,mhp/libgit2,leoyanggit/libgit2,raybrad/libit2,ardumont/libgit2,swisspol/DEMO-libgit2,maxiaoqian/libgit2,rcorre/libgit2,t0xicCode/libgit2,iankronquist/libgit2,claudelee/libgit2,whoisj/libgit2,t0xicCode/libgit2,magnus98/TEST,amyvmiwei/libgit2,since2014/libgit2,Corillian/libgit2,nokiddin/libgit2,dleehr/libgit2,chiayolin/libgit2,Snazz2001/libgit2,mhp/libgit2,amyvmiwei/libgit2,yongthecoder/libgit2,sygool/libgit2,jflesch/libgit2-mariadb,chiayolin/libgit2,t0xicCode/libgit2,mrksrm/Mingijura,sim0629/libgit2,sim0629/libgit2,iankronquist/libgit2,jflesch/libgit2-mariadb,stewid/libgit2,chiayolin/libgit2,stewid/libgit2,mrksrm/Mingijura,linquize/libgit2,t0xicCode/libgit2,yosefhackmon/libgit2,rcorre/libgit2,raybrad/libit2,amyvmiwei/libgit2,sygool/libgit2,Corillian/libgit2,mingyaaaa/libgit2,Snazz2001/libgit2,linquize/libgit2,since2014/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,chiayolin/libgit2,kissthink/libgit2,MrHacky/libgit2,swisspol/DEMO-libgit2,amyvmiwei/libgit2,nokiddin/libgit2,whoisj/libgit2,iankronquist/libgit2,maxiaoqian/libgit2,kissthink/libgit2
cfd192b0140f004404a208cde967ac8eef16cdff
/* * macsetfiletype - Set the mac's idea of file type * */ #include "macdefs.h" int setfiletype(name, creator, type) char *name; long creator, type; { FInfo info; unsigned char *pname; pname = (StringPtr) c2pstr(name); if ( GetFInfo(pname, 0, &info) < 0 ) return -1; info.fdType = type; info.fdCreator = creator; return SetFInfo(pname, 0, &info); }
/* * macsetfiletype - Set the mac's idea of file type * */ #include <Files.h> #include <pascal.h> int setfiletype(name, creator, type) char *name; long creator, type; { FInfo info; unsigned char *pname; pname = c2pstr(name); if ( GetFInfo(pname, 0, &info) < 0 ) return -1; info.fdType = type; info.fdCreator = creator; return SetFInfo(pname, 0, &info); }
--- +++ @@ -4,8 +4,7 @@ * */ -#include <Files.h> -#include <pascal.h> +#include "macdefs.h" int setfiletype(name, creator, type) @@ -15,7 +14,7 @@ FInfo info; unsigned char *pname; - pname = c2pstr(name); + pname = (StringPtr) c2pstr(name); if ( GetFInfo(pname, 0, &info) < 0 ) return -1; info.fdType = type;
Make it work under MPW too.
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
d940b57163ff5ab118821be7ad3e9ede057f5a75
//===- Transforms/Instrumentation.h - Instrumentation passes ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This files defines constructor functions for instrumentation passes. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H #define LLVM_TRANSFORMS_INSTRUMENTATION_H namespace llvm { class ModulePass; class FunctionPass; // Reoptimizer support pass: add instrumentation calls to back-edges of loops ModulePass *createLoopInstrumentationPass (); // Reoptimizer support pass: combine multiple back-edges w/ same target into one FunctionPass *createCombineBranchesPass(); // Reoptimizer support pass: emit table of global functions FunctionPass *createEmitFunctionTablePass (); //===----------------------------------------------------------------------===// // Support for inserting LLVM code to print values at basic block and function // exits. // // Just trace function entry/exit FunctionPass *createTraceValuesPassForBasicBlocks(); // Trace BB's and methods FunctionPass *createTraceValuesPassForFunction(); } // End llvm namespace #endif
//===- Transforms/Instrumentation.h - Instrumentation passes ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This files defines constructor functions for instrumentation passes. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H #define LLVM_TRANSFORMS_INSTRUMENTATION_H namespace llvm { class Pass; //===----------------------------------------------------------------------===// // Support for inserting LLVM code to print values at basic block and function // exits. // Pass *createTraceValuesPassForFunction(); // Just trace function entry/exit Pass *createTraceValuesPassForBasicBlocks(); // Trace BB's and methods } // End llvm namespace #endif
--- +++ @@ -16,14 +16,29 @@ namespace llvm { -class Pass; +class ModulePass; +class FunctionPass; + +// Reoptimizer support pass: add instrumentation calls to back-edges of loops +ModulePass *createLoopInstrumentationPass (); + +// Reoptimizer support pass: combine multiple back-edges w/ same target into one +FunctionPass *createCombineBranchesPass(); + +// Reoptimizer support pass: emit table of global functions +FunctionPass *createEmitFunctionTablePass (); + //===----------------------------------------------------------------------===// // Support for inserting LLVM code to print values at basic block and function // exits. // -Pass *createTraceValuesPassForFunction(); // Just trace function entry/exit -Pass *createTraceValuesPassForBasicBlocks(); // Trace BB's and methods + +// Just trace function entry/exit +FunctionPass *createTraceValuesPassForBasicBlocks(); + +// Trace BB's and methods +FunctionPass *createTraceValuesPassForFunction(); } // End llvm namespace
Add accessor function prototypes for reoptimizer support passes. Make accessors return FunctionPass* as appropriate. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@16619 91177308-0d34-0410-b5e6-96231b3b80d8
bsd-2-clause
dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm
f858f7f3804ea20b80a38dab9b1b2d098e1df2a1
#ifndef __INSECT_H__ #define __INSECT_H__ #ifdef __cplusplus extern "C" { #endif /* C++ */ #include "insect/crawler.h" #include "insect/records.h" /* basic file API */ #include "insect/file/stat.h" #ifdef USE_THREADS #include "insect/concurrent/thread.h" #endif /* USE_THREADS */ #ifdef __cplusplus } /* extern "C" */ #endif /* C++ */ #endif /* __INSECT_H__ */
#ifndef __INSECT_H__ #define __INSECT_H__ #include "insect/crawler.h" #include "insect/records.h" /* basic file API */ #include "insect/file/stat.h" #ifdef USE_THREADS #include "insect/concurrent/thread.h" #endif /* USE_THREADS */ #endif /* __INSECT_H__ */
--- +++ @@ -1,5 +1,9 @@ #ifndef __INSECT_H__ #define __INSECT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* C++ */ #include "insect/crawler.h" #include "insect/records.h" @@ -11,4 +15,8 @@ #include "insect/concurrent/thread.h" #endif /* USE_THREADS */ +#ifdef __cplusplus +} /* extern "C" */ +#endif /* C++ */ + #endif /* __INSECT_H__ */
Add extern "C" wrapper to main header, for C++
bsd-2-clause
hagemt/insect,hagemt/insect
fbe96411e7888bfb9cc92fe85e35e093239d24a7
#pragma once #include "geometry.h" #include "yaml_utils.h" #include <vector> #include <boost/shared_ptr.hpp> #include <librevenge/librevenge.h> namespace libpagemaker { class PMDPage { std::vector<boost::shared_ptr<PMDLineSet> > m_shapes; public: PMDPage() : m_shapes() { } void addShape(boost::shared_ptr<PMDLineSet> shape) { m_shapes.push_back(shape); } unsigned numShapes() const { return m_shapes.size(); } boost::shared_ptr<const PMDLineSet> getShape(unsigned i) const { return m_shapes.at(i); } void emitYaml(yaml_emitter_t *emitter) const { yamlBeginMap(emitter); yamlIndirectForeach(emitter, "shapes", m_shapes); yamlEndMap(emitter); } }; } /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
#pragma once #include "geometry.h" #include "yaml_utils.h" #include <vector> #include <boost/shared_ptr.hpp> #include <librevenge/librevenge.h> namespace libpagemaker { class PMDPage { std::vector<boost::shared_ptr<PMDLineSet> > m_shapes; public: PMDPage() : m_shapes() { } void addShape(boost::shared_ptr<PMDLineSet> shape) { m_shapes.push_back(shape); } unsigned numShapes() const { return m_shapes.size(); } boost::shared_ptr<const PMDLineSet> getShape(unsigned i) const { return m_shapes.at(i); } void emitYaml(yaml_emitter_t *emitter) const { yamlIndirectForeach(emitter, "shapes", m_shapes); } }; } /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
--- +++ @@ -33,7 +33,9 @@ void emitYaml(yaml_emitter_t *emitter) const { + yamlBeginMap(emitter); yamlIndirectForeach(emitter, "shapes", m_shapes); + yamlEndMap(emitter); } };
Fix bug in shape yaml emit
mpl-2.0
umanwizard/libpagemaker,umanwizard/libpagemaker,umanwizard/libpagemaker,anuragkanungo/libpagemaker,anuragkanungo/libpagemaker,umanwizard/libpagemaker,anuragkanungo/libpagemaker,umanwizard/libpagemaker,anuragkanungo/libpagemaker
37ffe379713c08899981532bad1a9df96c7fd3e2
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef __SYS_CONFIG_FCB_H_ #define __SYS_CONFIG_FCB_H_ #ifdef FCB_PRESENT #include <fcb/fcb.h> #include "config/config.h" struct conf_fcb { struct conf_store cf_store; struct fcb cf_fcb; }; int conf_fcb_src(struct conf_fcb *fcb); int conf_fcb_dst(struct conf_fcb *fcb); #endif #endif /* __SYS_CONFIG_FCB_H_ */
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef __SYS_CONFIG_FCB_H_ #define __SYS_CONFIG_FCB_H_ #ifdef FCB_PRESENT #include <fcb/fcb.h> #include "config/config.h" struct conf_file { struct cf_storage cf_itf; struct fcb cf_fcb; }; int conf_fcb_src(struct conf_fcb *fcb); int conf_fcb_dst(struct conf_fcb *fcb); #endif #endif /* __SYS_CONFIG_FCB_H_ */
--- +++ @@ -24,8 +24,8 @@ #include <fcb/fcb.h> #include "config/config.h" -struct conf_file { - struct cf_storage cf_itf; +struct conf_fcb { + struct conf_store cf_store; struct fcb cf_fcb; };
Update to catch up with renames of internal structures.
apache-2.0
mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,IMGJulian/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,wes3/incubator-mynewt-core,mlaz/mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,wes3/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core,wes3/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,mlaz/mynewt-core
2b03ded9e3f9a0668784a2090852625adfd58485
/* * public domain strtok_r() by Charlie Gordon * * from comp.lang.c 9/14/2007 * * http://groups.google.com/group/comp.lang.c/msg/2ab1ecbb86646684 * * (Declaration that it's public domain): * http://groups.google.com/group/comp.lang.c/msg/7c7b39328fefab9c */ #include <string.h> #ifdef __MINGW32__ # ifndef strtok_r char* strtok_r(char *str, const char *delim, char **nextp) { char *ret; if (str == NULL) str = *nextp; str += strspn(str, delim); if (*str == '\0') { *nextp = str; return NULL; } ret = str; str += strcspn(str, delim); if (*str) *str++ = '\0'; *nextp = str; return ret; } # endif /* !strtok_r */ #endif /* __MINGW32__ */
/* * public domain strtok_r() by Charlie Gordon * * from comp.lang.c 9/14/2007 * * http://groups.google.com/group/comp.lang.c/msg/2ab1ecbb86646684 * * (Declaration that it's public domain): * http://groups.google.com/group/comp.lang.c/msg/7c7b39328fefab9c */ #include <string.h> #ifdef __MINGW32__ # ifndef strtok_r char* strtok_r(char *str, const char *delim, char **nextp) { char *ret; if (str == NULL) str = *nextp; str += strspn(str, delim); if (*str == '\0') return NULL; ret = str; str += strcspn(str, delim); if (*str) *str++ = '\0'; *nextp = str; return ret; } # endif /* !strtok_r */ #endif /* __MINGW32__ */
--- +++ @@ -24,7 +24,10 @@ str += strspn(str, delim); if (*str == '\0') + { + *nextp = str; return NULL; + } ret = str; str += strcspn(str, delim);
Fix possible invalid write on Windows-specific `strtok_r` stub
agpl-3.0
Levak/warfacebot,Levak/warfacebot,Levak/warfacebot
621af6e0e6a48c8a8c5b4804de1bdc91c3436f5b
#ifndef XMMSC_SOCKETS_H #define XMMSC_SOCKETS_H #include <xmmsc/xmmsc_stdbool.h> /* Windows */ #ifdef _MSC_VER #include <Winsock2.h> #include <Ws2tcpip.h> typedef SOCKET xmms_socket_t; typedef int socklen_t; #define XMMS_EINTR WSAEINTR #define XMMS_EAGAIN WSAEWOULDBLOCK /* UNIX */ #else #define SOCKET_ERROR (-1) #define XMMS_EINTR EINTR #define XMMS_EAGAIN EWOULDBLOCK #include <sys/types.h> #include <sys/socket.h> #include <sys/select.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> typedef int xmms_socket_t; #endif int xmms_sockets_initialize(); int xmms_socket_set_nonblock(xmms_socket_t socket); int xmms_socket_valid(xmms_socket_t socket); void xmms_socket_close(xmms_socket_t socket); int xmms_socket_errno(); bool xmms_socket_error_recoverable(); #endif
#ifndef XMMSC_SOCKETS_H #define XMMSC_SOCKETS_H #include <xmmsc/xmmsc_stdbool.h> /* Windows */ #ifdef _MSC_VER #include <Winsock2.h> #include <Ws2tcpip.h> typedef SOCKET xmms_socket_t; typedef int socklen_t; #define XMMS_EINTR WSAEINTR #define XMMS_EAGAIN WSAEWOULDBLOCK /* UNIX */ #else #define SOCKET_ERROR (-1) #define XMMS_EINTR EINTR #define XMMS_EAGAIN EWOULDBLOCK #include <sys/socket.h> #include <sys/select.h> #include <sys/types.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> typedef int xmms_socket_t; #endif int xmms_sockets_initialize(); int xmms_socket_set_nonblock(xmms_socket_t socket); int xmms_socket_valid(xmms_socket_t socket); void xmms_socket_close(xmms_socket_t socket); int xmms_socket_errno(); bool xmms_socket_error_recoverable(); #endif
--- +++ @@ -18,9 +18,9 @@ #define SOCKET_ERROR (-1) #define XMMS_EINTR EINTR #define XMMS_EAGAIN EWOULDBLOCK +#include <sys/types.h> #include <sys/socket.h> #include <sys/select.h> -#include <sys/types.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h>
BUG(501): Fix compilation on OpenBSD (from Bernhard Leiner)
lgpl-2.1
theefer/xmms2,oneman/xmms2-oneman-old,theeternalsw0rd/xmms2,oneman/xmms2-oneman-old,mantaraya36/xmms2-mantaraya36,krad-radio/xmms2-krad,theefer/xmms2,krad-radio/xmms2-krad,dreamerc/xmms2,chrippa/xmms2,mantaraya36/xmms2-mantaraya36,chrippa/xmms2,theefer/xmms2,oneman/xmms2-oneman-old,six600110/xmms2,six600110/xmms2,oneman/xmms2-oneman-old,chrippa/xmms2,chrippa/xmms2,oneman/xmms2-oneman-old,krad-radio/xmms2-krad,xmms2/xmms2-stable,theeternalsw0rd/xmms2,six600110/xmms2,dreamerc/xmms2,oneman/xmms2-oneman,mantaraya36/xmms2-mantaraya36,mantaraya36/xmms2-mantaraya36,chrippa/xmms2,theefer/xmms2,oneman/xmms2-oneman,mantaraya36/xmms2-mantaraya36,oneman/xmms2-oneman,theeternalsw0rd/xmms2,six600110/xmms2,mantaraya36/xmms2-mantaraya36,theeternalsw0rd/xmms2,oneman/xmms2-oneman,dreamerc/xmms2,oneman/xmms2-oneman,dreamerc/xmms2,mantaraya36/xmms2-mantaraya36,oneman/xmms2-oneman,xmms2/xmms2-stable,dreamerc/xmms2,theefer/xmms2,xmms2/xmms2-stable,krad-radio/xmms2-krad,oneman/xmms2-oneman,xmms2/xmms2-stable,theeternalsw0rd/xmms2,six600110/xmms2,theefer/xmms2,krad-radio/xmms2-krad,chrippa/xmms2,six600110/xmms2,xmms2/xmms2-stable,theefer/xmms2,xmms2/xmms2-stable,krad-radio/xmms2-krad,theeternalsw0rd/xmms2
c033df3aeef588c2faf3cce3066b091980be0083
/* * Copyright (c) 2019 Oticon A/S * * SPDX-License-Identifier: Apache-2.0 */ /** * This header exists solely to allow drivers meant for the native_posix board * to be used directly in the nrf52_bsim board. * Note that such reuse should be done with great care. * * The command line arguments parsing logic from native_posix was born as a copy * of the one from the BabbleSim's libUtil library * They are therefore mostly equal except for types and functions names. * * This header converts these so the native_posix call to dynamically register * command line arguments is passed to the nrf52_bsim one */ #ifndef BOARDS_POSIX_NRF52_BSIM_CMDLINE_H #define BOARDS_POSIX_NRF52_BSIM_CMDLINE_H #include "../native_posix/cmdline_common.h" #ifdef __cplusplus extern "C" { #endif static inline void native_add_command_line_opts(struct args_struct_t *args) { void bs_add_extra_dynargs(struct args_struct_t *args); bs_add_extra_dynargs(args); } #ifdef __cplusplus } #endif #endif /* BOARDS_POSIX_NRF52_BSIM_CMDLINE_H */
/* * Copyright (c) 2019 Oticon A/S * * SPDX-License-Identifier: Apache-2.0 */ /** * This header exists solely to allow drivers meant for the native_posix board * to be used directly in the nrf52_bsim board. * Note that such reuse should be done with great care. * * The command line arguments parsing logic from native_posix was born as a copy * of the one from the BabbleSim's libUtil library * They are therefore mostly equal except for types and functions names. * * This header converts these so the native_posix call to dynamically register * command line arguments is passed to the nrf52_bsim one */ #include "../native_posix/cmdline_common.h" static inline void native_add_command_line_opts(struct args_struct_t *args) { void bs_add_extra_dynargs(struct args_struct_t *args); bs_add_extra_dynargs(args); }
--- +++ @@ -17,10 +17,23 @@ * command line arguments is passed to the nrf52_bsim one */ +#ifndef BOARDS_POSIX_NRF52_BSIM_CMDLINE_H +#define BOARDS_POSIX_NRF52_BSIM_CMDLINE_H + #include "../native_posix/cmdline_common.h" + +#ifdef __cplusplus +extern "C" { +#endif static inline void native_add_command_line_opts(struct args_struct_t *args) { void bs_add_extra_dynargs(struct args_struct_t *args); bs_add_extra_dynargs(args); } + +#ifdef __cplusplus +} +#endif + +#endif /* BOARDS_POSIX_NRF52_BSIM_CMDLINE_H */
nrf52_bsim: Add missing header guard and extern C block Add a missing header guard and an extern "C" block in one of the nrf52_bsim headers Signed-off-by: Alberto Escolar Piedras <52be3174920ed06cbdfbcf9622a1a6c68e942617@oticon.com>
apache-2.0
nashif/zephyr,nashif/zephyr,nashif/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,Vudentz/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,galak/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,galak/zephyr
18ea3bfa8059ab859a758a65fd006327f1da31fd
#include <avr/io.h> #include <avr/wdt.h> #include <avr/interrupt.h> int main ( void ) { //Disable interrupts and reset WDT timer cli(); wdt_reset(); //Reset MCU status register MCUSR &= ~(1<<WDRF); //Disable watchdog WDTCR |= (1<<WDCE) | (1<<WDE); WDTCR = 0; //Enable LED DDRB = 1<<DDB3; PORTB = 1<<PORTB3; //Start watchdog WDTCR |= (1<<WDCE) | (1<<WDE); WDTCR = (1<<WDTIE) | (1<<WDP2) | (1<<WDP1); //Enable interrupts sei(); while(1); } //Catching WatchDog interrupts ISR ( WDT_vect ) { PORTB ^= 1<<PORTB3; }
#include <avr/io.h> int main (void) { //Set pin 3 as output to source current? PORTB = 1<<PORTB3; DDRB = 1<<DDB3; }
--- +++ @@ -1,9 +1,38 @@ #include <avr/io.h> +#include <avr/wdt.h> +#include <avr/interrupt.h> -int main (void) { +int main ( void ) { - //Set pin 3 as output to source current? + //Disable interrupts and reset WDT timer + cli(); + wdt_reset(); + + //Reset MCU status register + MCUSR &= ~(1<<WDRF); + + //Disable watchdog + WDTCR |= (1<<WDCE) | (1<<WDE); + WDTCR = 0; + + //Enable LED + DDRB = 1<<DDB3; PORTB = 1<<PORTB3; - DDRB = 1<<DDB3; + + //Start watchdog + WDTCR |= (1<<WDCE) | (1<<WDE); + WDTCR = (1<<WDTIE) | (1<<WDP2) | (1<<WDP1); + + //Enable interrupts + sei(); + + while(1); } + +//Catching WatchDog interrupts +ISR ( WDT_vect ) { + + PORTB ^= 1<<PORTB3; + +}
Make a watchdog timer blink a LED
mit
Atom058/ArduinoLithiumCharger,Atom058/ArduinoLithiumCharger
c98e8774e1173d05e733fb02032d06e61813a6a3
#include "gc.h" #include "tree.h" #include "dict.h" #include "match.h" #include "optimize.h" /* * We recursively iterate through all * rules on all the children of the tree * until the expression is irreducible, * i.e. stops changing. * * Also, we (try to) apply the optimization * routine. */ int apply_rules_and_optimize(exp_tree_t** rules, int rc, exp_tree_t *tree) { int success = 0; while (1) { if (matchloop(rules, rc, tree)) { /* * Reduction algorithm * suceeded, print reduced tree */ #ifdef DEBUG_2 printout_tree(*tree); printf("\n"); #endif #ifdef DEBUG printout_tree_infix(*tree); printf("\n"); #endif success = 1; } /* * If optimization succeeds in * modifying the tree, try * reducing the new optimized * tree. */ if (optimize(tree)) { #ifdef DEBUG printf("[optimize] \n"); #ifdef DEBUG_2 printout_tree(*tree); printf("\n"); #endif printout_tree_infix(*tree); printf("\n"); #endif success = 1; continue; } break; } return success; }
#include "gc.h" #include "tree.h" #include "dict.h" #include "match.h" #include "optimize.h" /* We recursively iterate through all * rules on all the children of the tree * until the expression is irreducible, * i.e. stops changing. * * Also, we (try to) apply the optimization * routine. */ int apply_rules_and_optimize(exp_tree_t** rules, int rc, exp_tree_t *tree) { int success = 0; while (1) { if (matchloop(rules, rc, tree)) { /* * Reduction algorithm * suceeded, print reduced tree */ #ifdef DEBUG_2 printout_tree(*tree); printf("\n"); #endif #ifdef DEBUG printout_tree_infix(*tree); printf("\n"); #endif success = 1; } /* * If optimization succeeds in * modifying the tree, try * reducing the new optimized * tree. */ if (optimize(tree)) { #ifdef DEBUG printf("[optimize] \n"); #ifdef DEBUG_2 printout_tree(*tree); printf("\n"); #endif printout_tree_infix(*tree); printf("\n"); #endif success = 1; continue; } break; } return success; }
--- +++ @@ -5,11 +5,12 @@ #include "match.h" #include "optimize.h" -/* We recursively iterate through all +/* + * We recursively iterate through all * rules on all the children of the tree - * until the expression is irreducible, + * until the expression is irreducible, * i.e. stops changing. - * + * * Also, we (try to) apply the optimization * routine. */ @@ -23,14 +24,14 @@ * Reduction algorithm * suceeded, print reduced tree */ -#ifdef DEBUG_2 - printout_tree(*tree); - printf("\n"); -#endif -#ifdef DEBUG - printout_tree_infix(*tree); - printf("\n"); -#endif + #ifdef DEBUG_2 + printout_tree(*tree); + printf("\n"); + #endif + #ifdef DEBUG + printout_tree_infix(*tree); + printf("\n"); + #endif success = 1; } @@ -41,15 +42,15 @@ * tree. */ if (optimize(tree)) { -#ifdef DEBUG - printf("[optimize] \n"); -#ifdef DEBUG_2 - printout_tree(*tree); - printf("\n"); -#endif - printout_tree_infix(*tree); - printf("\n"); -#endif + #ifdef DEBUG + printf("[optimize] \n"); + #ifdef DEBUG_2 + printout_tree(*tree); + printf("\n"); + #endif + printout_tree_infix(*tree); + printf("\n"); + #endif success = 1; continue; }
Change indent and comments to a more readable style
mit
bl0ckeduser/symdiff,bl0ckeduser/symdiff,bl0ckeduser/symdiff
920e161a029d38c78042221415d036d7a6e631c5
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif #ifndef ELM_LIB_QUICKLAUNCH void test_carousel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg, *car; win = elm_win_add(NULL, "carousel", ELM_WIN_BASIC); elm_win_title_set(win, "Carousel"); elm_win_autodel_set(win, 1); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); car = elm_carousel_add(win); elm_win_resize_object_add(win, car); evas_object_size_hint_weight_set(car, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_carousel_item_add(car, NULL, "Item 1", NULL, NULL); elm_carousel_item_add(car, NULL, "Item 2", NULL, NULL); elm_carousel_item_add(car, NULL, "Tinga", NULL, NULL); elm_carousel_item_add(car, NULL, "Item 4", NULL, NULL); evas_object_show(car); evas_object_resize(win, 320, 240); evas_object_show(win); } #endif
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif #ifndef ELM_LIB_QUICKLAUNCH void test_carousel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg; win = elm_win_add(NULL, "carousel", ELM_WIN_BASIC); elm_win_title_set(win, "Carousel"); elm_win_autodel_set(win, 1); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); evas_object_resize(win, 320, 240); evas_object_show(win); } #endif
--- +++ @@ -6,7 +6,7 @@ void test_carousel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *win, *bg; + Evas_Object *win, *bg, *car; win = elm_win_add(NULL, "carousel", ELM_WIN_BASIC); elm_win_title_set(win, "Carousel"); @@ -17,6 +17,15 @@ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); + car = elm_carousel_add(win); + elm_win_resize_object_add(win, car); + evas_object_size_hint_weight_set(car, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_carousel_item_add(car, NULL, "Item 1", NULL, NULL); + elm_carousel_item_add(car, NULL, "Item 2", NULL, NULL); + elm_carousel_item_add(car, NULL, "Tinga", NULL, NULL); + elm_carousel_item_add(car, NULL, "Item 4", NULL, NULL); + evas_object_show(car); + evas_object_resize(win, 320, 240); evas_object_show(win); }
Add carousel to carousel test =P But it's not working anyway. SVN revision: 53684
lgpl-2.1
rvandegrift/elementary,rvandegrift/elementary,FlorentRevest/Elementary,rvandegrift/elementary,tasn/elementary,tasn/elementary,FlorentRevest/Elementary,FlorentRevest/Elementary,tasn/elementary,rvandegrift/elementary,tasn/elementary,FlorentRevest/Elementary,tasn/elementary
54993a9f4ebc279f5dac6754e61f2c6ea98dbb65
#include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; write(2, "stack overflow\n", 15); longjmp(try, ++i); _exit(1); } unsigned recurse(unsigned x) { return recurse(x)+1; } int main() { char* stack; stack = malloc(sizeof(stack) * SIGSTKSZ); stack_t ss = { .ss_size = SIGSTKSZ, .ss_sp = stack, }; struct sigaction sa = { .sa_handler = handler, .sa_flags = SA_ONSTACK }; sigaltstack(&ss, 0); sigfillset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); if (setjmp(try) < 3) { recurse(0); } else { printf("caught exception!\n"); } return 0; }
#include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; write(2, "stack overflow\n", 15); longjmp(try, ++i); _exit(1); } unsigned recurse(unsigned x) { return recurse(x)+1; } int main() { static char stack[SIGSTKSZ]; stack_t ss = { .ss_size = SIGSTKSZ, .ss_sp = stack, }; struct sigaction sa = { .sa_handler = handler, .sa_flags = SA_ONSTACK }; sigaltstack(&ss, 0); sigfillset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); if (setjmp(try) < 3) { recurse(0); } else { printf("caught exception!\n"); } return 0; }
--- +++ @@ -20,7 +20,8 @@ } int main() { - static char stack[SIGSTKSZ]; + char* stack; + stack = malloc(sizeof(stack) * SIGSTKSZ); stack_t ss = { .ss_size = SIGSTKSZ, .ss_sp = stack,
Put alternate stack on heap
apache-2.0
danluu/setjmp-longjmp-ucontext-snippets,danluu/setjmp-longjmp-ucontext-snippets
03186dd5ad61d9d9bc366ec5e23e313910ddb48f
#include "Arduino.h" class MotorShield { public: MotorShield(uint8_t speedPinLeft, uint8_t dirPinLeft, uint8_t speedPinRight, uint8_t dirPinRight); void init(); void forward(); void backward(); void stop(); void fullSpeed(); void stopLeft(); void stopRight(); private: uint8_t speedPinLeft, dirPinLeft, speedPinRight, dirPinRight, maxSpeed, minSpeed; };
#include "Arduino.h" class MotorShield { public: MotorShield(uint8_t speedPinLeft, uint8_t dirPinLeft, uint8_t speedPinRight, uint8_t dirPinRight); void init(); void forward(); void backward(); void stop(); void fullSpeed(); void stopLeft(); void stopRight(); private: int speedPinLeft, dirPinLeft, speedPinRight, dirPinRight, maxSpeed, minSpeed; };
--- +++ @@ -13,10 +13,10 @@ void stopLeft(); void stopRight(); private: - int speedPinLeft, - dirPinLeft, - speedPinRight, - dirPinRight, - maxSpeed, - minSpeed; + uint8_t speedPinLeft, + dirPinLeft, + speedPinRight, + dirPinRight, + maxSpeed, + minSpeed; };
Change var types to the same type that constructor expects
mit
lenon/arduino-motorshield
c45c927b2776def13b062707fff08974ddb4c920
/* * system_log.h * * Author: Ming Tsang * Copyright (c) 2014 Ming Tsang * Refer to LICENSE for details */ #pragma once #include "libutils/misc/singleton.h" namespace libutils { namespace io { template<typename T> class Logger; } } namespace libutils { namespace io { /** * The default system logger */ template<typename CharT> class SystemLog : public misc::Singleton<Logger<CharT>, SystemLog<CharT>> {}; } } #include "libutils/io/logger.h"
/* * system_log.h * * Author: Ming Tsang * Copyright (c) 2014 Ming Tsang * Refer to LICENSE for details */ #pragma once #include "libutils/io/logger.h" #include "libutils/misc/singleton.h" namespace libutils { namespace io { /** * The default system logger */ template<typename CharT> class SystemLog : public misc::Singleton<Logger<CharT>, SystemLog<CharT>> {}; } }
--- +++ @@ -8,8 +8,17 @@ #pragma once -#include "libutils/io/logger.h" #include "libutils/misc/singleton.h" + +namespace libutils +{ +namespace io +{ + +template<typename T> class Logger; + +} +} namespace libutils { @@ -25,3 +34,5 @@ } } + +#include "libutils/io/logger.h"
Include logger.h later to prevent using SystemLog before definition
mit
nkming2/libutils,nkming2/libutils,nkming2/libutils,nkming2/libutils,nkming2/libutils,nkming2/libutils
e86ec93def569ec100bcbca7e9f1952e64a0851d
#ifndef __PTHREAD_H #define __PTHREAD_H typedef ULONG pthread_key_t; typedef HANDLE pthread_mutex_t; typedef int pthread_once_t; DWORD pthread_self(void); void pthread_setspecific(pthread_key_t, void *); void *pthread_getspecific(pthread_key_t); int pthread_mutex_init(pthread_mutex_t *, void *attr); int pthread_mutex_lock(pthread_mutex_t *); /* blocking */ int pthread_mutex_unlock(pthread_mutex_t *); #endif
#ifndef __PTHREAD_H #define __PTHREAD_H typedef ULONG pthread_key_t; typedef HANDLE pthread_mutex_t; typedef int pthread_once_t; DWORD pthread_self(void); void pthread_setspecific(pthread_key_t, void *); void *pthread_getspecific(pthread_key_t); void pthread_mutex_init(pthread_mutex_t *, void *attr); void pthread_mutex_lock(pthread_mutex_t *); /* blocking */ void pthread_mutex_unlock(pthread_mutex_t *); #endif
--- +++ @@ -10,10 +10,10 @@ void pthread_setspecific(pthread_key_t, void *); void *pthread_getspecific(pthread_key_t); -void pthread_mutex_init(pthread_mutex_t *, void *attr); -void pthread_mutex_lock(pthread_mutex_t *); +int pthread_mutex_init(pthread_mutex_t *, void *attr); +int pthread_mutex_lock(pthread_mutex_t *); /* blocking */ -void pthread_mutex_unlock(pthread_mutex_t *); +int pthread_mutex_unlock(pthread_mutex_t *); #endif
Fix declarations of pthread functions, missed in recent commit.
agpl-3.0
tpostgres-projects/tPostgres,50wu/gpdb,jmcatamney/gpdb,Chibin/gpdb,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,ovr/postgres-xl,techdragon/Postgres-XL,Chibin/gpdb,xinzweb/gpdb,adam8157/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,50wu/gpdb,ovr/postgres-xl,lisakowen/gpdb,ovr/postgres-xl,greenplum-db/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,edespino/gpdb,xinzweb/gpdb,edespino/gpdb,postmind-net/postgres-xl,techdragon/Postgres-XL,ashwinstar/gpdb,oberstet/postgres-xl,yuanzhao/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,arcivanov/postgres-xl,jmcatamney/gpdb,adam8157/gpdb,snaga/postgres-xl,50wu/gpdb,50wu/gpdb,arcivanov/postgres-xl,adam8157/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,tpostgres-projects/tPostgres,yazun/postgres-xl,kmjungersen/PostgresXL,arcivanov/postgres-xl,edespino/gpdb,Chibin/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,kmjungersen/PostgresXL,techdragon/Postgres-XL,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,postmind-net/postgres-xl,oberstet/postgres-xl,postmind-net/postgres-xl,zeroae/postgres-xl,oberstet/postgres-xl,yazun/postgres-xl,zeroae/postgres-xl,Chibin/gpdb,yazun/postgres-xl,yuanzhao/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,kmjungersen/PostgresXL,adam8157/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,pavanvd/postgres-xl,yazun/postgres-xl,snaga/postgres-xl,ashwinstar/gpdb,Chibin/gpdb,postmind-net/postgres-xl,yuanzhao/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,Postgres-XL/Postgres-XL,Chibin/gpdb,Postgres-XL/Postgres-XL,edespino/gpdb,lisakowen/gpdb,edespino/gpdb,yuanzhao/gpdb,adam8157/gpdb,jmcatamney/gpdb,lisakowen/gpdb,yuanzhao/gpdb,Chibin/gpdb,greenplum-db/gpdb,lisakowen/gpdb,50wu/gpdb,adam8157/gpdb,pavanvd/postgres-xl,Chibin/gpdb,lisakowen/gpdb,jmcatamney/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,edespino/gpdb,techdragon/Postgres-XL,kmjungersen/PostgresXL,greenplum-db/gpdb,Chibin/gpdb,postmind-net/postgres-xl,xinzweb/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,snaga/postgres-xl,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,techdragon/Postgres-XL,yazun/postgres-xl,yuanzhao/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,greenplum-db/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,oberstet/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,pavanvd/postgres-xl,zeroae/postgres-xl,greenplum-db/gpdb,snaga/postgres-xl,ovr/postgres-xl,ovr/postgres-xl,Chibin/gpdb,50wu/gpdb,snaga/postgres-xl,edespino/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,edespino/gpdb,ashwinstar/gpdb,zeroae/postgres-xl
3951fae51d776d05e871ee5a7beb62fb832985b1
/* -*- C -*- * $Id: defs.h 11708 2007-02-12 23:01:19Z shyouhei $ */ #ifndef DIGEST_DEFS_H #define DIGEST_DEFS_H #include "ruby.h" #include <sys/types.h> #include <sys/cdefs.h> /* * #if defined(HAVE_SYS_CDEFS_H) * # include <sys/cdefs.h> * #endif * #if !defined(__BEGIN_DECLS) * # define __BEGIN_DECLS * # define __END_DECLS * #endif */ #include <inttypes.h> /* * #if defined(HAVE_INTTYPES_H) * # include <inttypes.h> * #elif !defined __CYGWIN__ || !defined __uint8_t_defined * typedef unsigned char uint8_t; * typedef unsigned int uint32_t; * # if SIZEOF_LONG == 8 * typedef unsigned long uint64_t; * # elif SIZEOF_LONG_LONG == 8 * typedef unsigned LONG_LONG uint64_t; * # else * # define NO_UINT64_T * # endif * #endif */ /* Define if processor uses big-endian word */ /* #ifdef __BIG_ENDIAN__ #define WORDS_BIGENDIAN #else */ /* !__BIG_ENDIAN__ */ /* #undef WORDS_BIGENDIAN */ /* #endif */ /* __BIG_ENDIAN__ */ #endif /* DIGEST_DEFS_H */
/* -*- C -*- * $Id: defs.h 11708 2007-02-12 23:01:19Z shyouhei $ */ #ifndef DIGEST_DEFS_H #define DIGEST_DEFS_H #include "ruby.h" #include <sys/types.h> #include <sys/cdefs.h> /* * #if defined(HAVE_SYS_CDEFS_H) * # include <sys/cdefs.h> * #endif * #if !defined(__BEGIN_DECLS) * # define __BEGIN_DECLS * # define __END_DECLS * #endif */ #include <inttypes.h> /* * #if defined(HAVE_INTTYPES_H) * # include <inttypes.h> * #elif !defined __CYGWIN__ || !defined __uint8_t_defined * typedef unsigned char uint8_t; * typedef unsigned int uint32_t; * # if SIZEOF_LONG == 8 * typedef unsigned long uint64_t; * # elif SIZEOF_LONG_LONG == 8 * typedef unsigned LONG_LONG uint64_t; * # else * # define NO_UINT64_T * # endif * #endif */ #endif /* DIGEST_DEFS_H */
--- +++ @@ -36,4 +36,12 @@ * #endif */ +/* Define if processor uses big-endian word */ +/* +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN +#else */ /* !__BIG_ENDIAN__ */ +/* #undef WORDS_BIGENDIAN */ +/* #endif */ /* __BIG_ENDIAN__ */ + #endif /* DIGEST_DEFS_H */
Fix Digest failures on OSX PPC (big endian) systems - add some tests to defs.h to check for the existence of the __BIG_ENDIAN__ macro which is available on POSIX systems. If it is defined, we define the WORDS_BIGENDIAN macro which is tested by the digest/**/*.c files to activate special code for byte reordering Signed-off-by: Brian Ford <31227094f3baea959abbdb82d34f0bc93c1f3b36@engineyard.com>
bsd-3-clause
heftig/rubinius,mlarraz/rubinius,sferik/rubinius,lgierth/rubinius,jemc/rubinius,kachick/rubinius,travis-repos/rubinius,pH14/rubinius,jemc/rubinius,Wirachmat/rubinius,ngpestelos/rubinius,slawosz/rubinius,Azizou/rubinius,travis-repos/rubinius,pH14/rubinius,digitalextremist/rubinius,digitalextremist/rubinius,jemc/rubinius,jsyeo/rubinius,pH14/rubinius,chad/rubinius,sferik/rubinius,Wirachmat/rubinius,heftig/rubinius,benlovell/rubinius,Wirachmat/rubinius,pH14/rubinius,chad/rubinius,benlovell/rubinius,benlovell/rubinius,Wirachmat/rubinius,heftig/rubinius,ruipserra/rubinius,ngpestelos/rubinius,kachick/rubinius,dblock/rubinius,kachick/rubinius,chad/rubinius,jemc/rubinius,mlarraz/rubinius,lgierth/rubinius,kachick/rubinius,slawosz/rubinius,Wirachmat/rubinius,sferik/rubinius,slawosz/rubinius,Azizou/rubinius,ngpestelos/rubinius,heftig/rubinius,ngpestelos/rubinius,sferik/rubinius,benlovell/rubinius,kachick/rubinius,mlarraz/rubinius,digitalextremist/rubinius,chad/rubinius,slawosz/rubinius,dblock/rubinius,ruipserra/rubinius,slawosz/rubinius,kachick/rubinius,ruipserra/rubinius,kachick/rubinius,jsyeo/rubinius,benlovell/rubinius,dblock/rubinius,dblock/rubinius,digitalextremist/rubinius,chad/rubinius,lgierth/rubinius,pH14/rubinius,dblock/rubinius,chad/rubinius,chad/rubinius,mlarraz/rubinius,lgierth/rubinius,lgierth/rubinius,digitalextremist/rubinius,travis-repos/rubinius,Wirachmat/rubinius,benlovell/rubinius,jemc/rubinius,jsyeo/rubinius,jemc/rubinius,lgierth/rubinius,heftig/rubinius,sferik/rubinius,jemc/rubinius,chad/rubinius,travis-repos/rubinius,Azizou/rubinius,jsyeo/rubinius,dblock/rubinius,mlarraz/rubinius,jsyeo/rubinius,Azizou/rubinius,ruipserra/rubinius,chad/rubinius,lgierth/rubinius,slawosz/rubinius,sferik/rubinius,mlarraz/rubinius,ngpestelos/rubinius,travis-repos/rubinius,ruipserra/rubinius,Azizou/rubinius,Azizou/rubinius,benlovell/rubinius,digitalextremist/rubinius,ngpestelos/rubinius,sferik/rubinius,ruipserra/rubinius,travis-repos/rubinius,ruipserra/rubinius,Azizou/rubinius,heftig/rubinius,slawosz/rubinius,mlarraz/rubinius,travis-repos/rubinius,heftig/rubinius,kachick/rubinius,digitalextremist/rubinius,jsyeo/rubinius,dblock/rubinius,ngpestelos/rubinius,pH14/rubinius,jsyeo/rubinius,chad/rubinius,pH14/rubinius,Wirachmat/rubinius
42f453c38a1dd6c14aaf9cd655034d258c9ae931
// The following macros should be defined on entry to this file: // __COMPDB_ENTRY: // The contents of this compilation database entry. Should be a string // literal. // __COMPDB_SYMNAME: // ATM I can't think of a way to generate a unique symbol name, so just // force it to be passed in. __attribute__((section(".llvm.compdb"))) extern const char __COMPDB_SYMNAME[] = "<<<COMPDB:" __COMPDB_ENTRY ">>>";
// __COMPDB_ENTRY: The contents of this compilation database entry. // Should be a string literal. // __COMPDB_SYMNAME: ATM I can't think of a way to generate a unique symbol // name, so just force the TU to provide it. __attribute__((section(".llvm.compdb"))) extern const char __COMPDB_SYMNAME[] = "<<<COMPDB:" __COMPDB_ENTRY ">>>";
--- +++ @@ -1,6 +1,9 @@ -// __COMPDB_ENTRY: The contents of this compilation database entry. -// Should be a string literal. -// __COMPDB_SYMNAME: ATM I can't think of a way to generate a unique symbol -// name, so just force the TU to provide it. +// The following macros should be defined on entry to this file: +// __COMPDB_ENTRY: +// The contents of this compilation database entry. Should be a string +// literal. +// __COMPDB_SYMNAME: +// ATM I can't think of a way to generate a unique symbol name, so just +// force it to be passed in. __attribute__((section(".llvm.compdb"))) extern const char __COMPDB_SYMNAME[] = "<<<COMPDB:" __COMPDB_ENTRY ">>>";
Make this file a bit prettier.
mit
chisophugis/clang-compdb-in-object-file,chisophugis/clang-compdb-in-object-file
6562bb5c59335458afc804997116ba8c432c0785
/* * Copyright (C) 2007 The Android Open Source Project * * 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 MINZIP_INLINE_MAGIC_H_ #define MINZIP_INLINE_MAGIC_H_ #ifndef MINZIP_GENERATE_INLINES #define INLINE extern inline __attribute((__gnu_inline__)) #else #define INLINE #endif #endif // MINZIP_INLINE_MAGIC_H_
/* * Copyright (C) 2007 The Android Open Source Project * * 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 MINZIP_INLINE_MAGIC_H_ #define MINZIP_INLINE_MAGIC_H_ #ifndef MINZIP_GENERATE_INLINES #define INLINE extern __inline__ #else #define INLINE #endif #endif // MINZIP_INLINE_MAGIC_H_
--- +++ @@ -18,7 +18,7 @@ #define MINZIP_INLINE_MAGIC_H_ #ifndef MINZIP_GENERATE_INLINES -#define INLINE extern __inline__ +#define INLINE extern inline __attribute((__gnu_inline__)) #else #define INLINE #endif
Fix multiple defined symbol errors Use of __inline__ by projects in bootable/* was causing problems with clang. Following the BKM and replaced use of __inline__ with __attribute((__gnu_inline)). Change-Id: If4ccfded685bb2c9d9c23c9b92ee052208399ef0 Author: Edwin Vane <7f62528bc61ebf7c7c86be496bd30af8ee2167eb@intel.com> Reviewed-by: Kevin P Schoedel <cdf9367a449e45c006fd634227f1832949f6c2a4@intel.com>
apache-2.0
M1cha/libaroma,M1cha/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,amarullz/libaroma,amarullz/libaroma,M1cha/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,ProjectOpenCannibal/libaroma,amarullz/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,amarullz/libaroma,amarullz/libaroma
e95f31e37ff53c7030e335d58c484e30514a4805
/** * MDx Hash Function * (C) 1999-2008 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_MDX_BASE_H__ #define BOTAN_MDX_BASE_H__ #include <botan/hash.h> namespace Botan { /** * MDx Hash Function Base Class */ class BOTAN_DLL MDx_HashFunction : public HashFunction { public: MDx_HashFunction(u32bit, u32bit, bool, bool, u32bit = 8); virtual ~MDx_HashFunction() {} protected: void add_data(const byte[], u32bit); void final_result(byte output[]); virtual void compress_n(const byte block[], u32bit block_n) = 0; void clear() throw(); virtual void copy_out(byte[]) = 0; virtual void write_count(byte[]); private: SecureVector<byte> buffer; u64bit count; u32bit position; const bool BIG_BYTE_ENDIAN, BIG_BIT_ENDIAN; const u32bit COUNT_SIZE; }; } #endif
/** * MDx Hash Function * (C) 1999-2008 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_MDX_BASE_H__ #define BOTAN_MDX_BASE_H__ #include <botan/hash.h> namespace Botan { /** * MDx Hash Function Base Class */ class BOTAN_DLL MDx_HashFunction : public HashFunction { public: MDx_HashFunction(u32bit, u32bit, bool, bool, u32bit = 8); virtual ~MDx_HashFunction() {} protected: void clear() throw(); SecureVector<byte> buffer; u64bit count; u32bit position; private: void add_data(const byte[], u32bit); void final_result(byte output[]); virtual void compress_n(const byte block[], u32bit block_n) = 0; virtual void copy_out(byte[]) = 0; virtual void write_count(byte[]); const bool BIG_BYTE_ENDIAN, BIG_BIT_ENDIAN; const u32bit COUNT_SIZE; }; } #endif
--- +++ @@ -21,18 +21,17 @@ MDx_HashFunction(u32bit, u32bit, bool, bool, u32bit = 8); virtual ~MDx_HashFunction() {} protected: + void add_data(const byte[], u32bit); + void final_result(byte output[]); + virtual void compress_n(const byte block[], u32bit block_n) = 0; + void clear() throw(); + virtual void copy_out(byte[]) = 0; + virtual void write_count(byte[]); + private: SecureVector<byte> buffer; u64bit count; u32bit position; - private: - void add_data(const byte[], u32bit); - void final_result(byte output[]); - - virtual void compress_n(const byte block[], u32bit block_n) = 0; - - virtual void copy_out(byte[]) = 0; - virtual void write_count(byte[]); const bool BIG_BYTE_ENDIAN, BIG_BIT_ENDIAN; const u32bit COUNT_SIZE;
Make the member variables of MDx_HashFunction private instead of protected - no subclass needs access to any of these variables.
bsd-2-clause
Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,randombit/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan
bbef5652aa760beb83ef3116ecec3bd5eb76af35
#ifndef OOC_ARRAY_H_ #define OOC_ARRAY_H_ #define array_malloc(size) calloc(1, (size)) #define array_free free #include <stdint.h> #define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc((size) * sizeof(type)) }); #if defined(safe) #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index] = value) #else #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[index] = value) #endif #define _lang_array__Array_free(array) { array_free(array.data); } typedef struct { size_t length; void* data; } _lang_array__Array; #endif
#ifndef OOC_ARRAY_H_ #define OOC_ARRAY_H_ #define array_malloc(size) calloc(1, (size)) #define array_free free #include <stdint.h> #define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc((size) * sizeof(type)) }); #if defined(safe) #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index] = value) #else #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[index] = value) #endif #define _lang_array__Array_free(array) { array_free(array.data); array.data = NULL; array.length = 0; } typedef struct { size_t length; void* data; } _lang_array__Array; #endif
--- +++ @@ -20,7 +20,7 @@ (((type*) array.data)[index] = value) #endif -#define _lang_array__Array_free(array) { array_free(array.data); array.data = NULL; array.length = 0; } +#define _lang_array__Array_free(array) { array_free(array.data); } typedef struct { size_t length;
Revert "Set pointer to array data to null after free"
mit
firog/ooc-kean,sebastianbaginski/ooc-kean,magic-lang/ooc-kean,fredrikbryntesson/ooc-kean,thomasfanell/ooc-kean,firog/ooc-kean,simonmika/ooc-kean,simonmika/ooc-kean,magic-lang/ooc-kean,thomasfanell/ooc-kean,fredrikbryntesson/ooc-kean,sebastianbaginski/ooc-kean
36a864d477bf010819748d50f8be13b0497c1c7f
#ifdef LOVR_WEBGL #include <GLES3/gl3.h> #include <GLES2/gl2ext.h> #include <GL/gl.h> #include <GL/glext.h> #else #include "lib/glad/glad.h" #endif #include <stdint.h> #pragma once #define GPU_BUFFER_FIELDS \ uint32_t id; \ uint8_t incoherent; #define GPU_CANVAS_FIELDS \ uint32_t framebuffer; \ uint32_t resolveBuffer; \ uint32_t depthBuffer; \ bool immortal; #define GPU_MESH_FIELDS \ uint32_t vao; \ uint32_t ibo; #define GPU_SHADER_FIELDS \ uint32_t program; #define GPU_TEXTURE_FIELDS \ uint8_t incoherent; \ GLuint id; \ GLuint msaaId; \ GLenum target;
#ifdef LOVR_WEBGL #include <GLES3/gl3.h> #include <GLES2/gl2ext.h> #include <GL/gl.h> #include <GL/glext.h> #else #include "lib/glad/glad.h" #endif #include <stdint.h> #pragma once #define GPU_BUFFER_FIELDS \ uint32_t id; \ uint8_t incoherent; #define GPU_CANVAS_FIELDS \ uint32_t framebuffer; \ uint32_t resolveBuffer; \ uint32_t depthBuffer; \ bool immortal; #define GPU_MESH_FIELDS \ uint32_t vao; \ uint32_t ibo; #define GPU_SHADER_FIELDS \ uint32_t program; #define GPU_TEXTURE_FIELDS \ GLuint id; \ GLuint msaaId; \ GLenum target; \ uint8_t incoherent;
--- +++ @@ -29,7 +29,7 @@ uint32_t program; #define GPU_TEXTURE_FIELDS \ + uint8_t incoherent; \ GLuint id; \ GLuint msaaId; \ - GLenum target; \ - uint8_t incoherent; + GLenum target;
Adjust Texture padding so it's 64 bytes;
mit
bjornbytes/lovr,bjornbytes/lovr,bjornbytes/lovr,bjornbytes/lovr,bjornbytes/lovr
8d8f4eef73993a3ea51b47c2d7a7c238b627369a
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.06.00.08-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 6 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.05.00.03-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 5 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
--- +++ @@ -7,9 +7,9 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.05.00.03-k" +#define QLA2XXX_VERSION "8.06.00.08-k" #define QLA_DRIVER_MAJOR_VER 8 -#define QLA_DRIVER_MINOR_VER 5 +#define QLA_DRIVER_MINOR_VER 6 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
[SCSI] qla2xxx: Update the driver version to 8.06.00.08-k. Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com> Signed-off-by: Saurav Kashyap <88d6fd94e71a9ac276fc44f696256f466171a3c0@qlogic.com> Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
e03d1b21d1f8482072ff3a9db12197b401b3bc56
// RUN: %clang-cc1 -fsyntax-only %s 2>&1 | FileCheck %s // IMPORTANT: This test case intentionally DOES NOT use --disable-free. It // tests that we are properly reclaiming the ASTs and we do not have a double free. // Previously we tried to free the size expression of the VLA twice. int foo(int x) { int y[x * 3]; help }; // CHECK: 9:3: error: use of undeclared identifier 'help' // CHECK: help // CHECK: 14:102: error: expected '}'
// RUN: c-index-test -test-load-source local %s 2>&1 | FileCheck %s // This is invalid source. Previously a double-free caused this // example to crash c-index-test. int foo(int x) { int y[x * 3]; help }; // CHECK: 8:3: error: use of undeclared identifier 'help' // CHECK: help // CHECK: 12:102: error: expected '}'
--- +++ @@ -1,13 +1,14 @@ -// RUN: c-index-test -test-load-source local %s 2>&1 | FileCheck %s +// RUN: %clang-cc1 -fsyntax-only %s 2>&1 | FileCheck %s -// This is invalid source. Previously a double-free caused this -// example to crash c-index-test. +// IMPORTANT: This test case intentionally DOES NOT use --disable-free. It +// tests that we are properly reclaiming the ASTs and we do not have a double free. +// Previously we tried to free the size expression of the VLA twice. int foo(int x) { int y[x * 3]; help }; -// CHECK: 8:3: error: use of undeclared identifier 'help' +// CHECK: 9:3: error: use of undeclared identifier 'help' // CHECK: help -// CHECK: 12:102: error: expected '}' +// CHECK: 14:102: error: expected '}'
Change test case to use 'clang -cc1' (without --disable-free) instead of c-index-test (whose memory management behavior may change in the future). git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@92043 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-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,llvm-mirror/clang
29b6f3869ed2b4ee706b604dbd563a302d4bbba9
#ifndef MAPPER_1_H #define MAPPER_1_H #include <Mapper.h> enum PrgMode { PRG_32KB, FIX_FIRST_16KB, FIX_LAST_16KB, }; enum ChrMode { CHR_8KB, CHR_4KB, }; class Mapper1: public Mapper { public: uint8_t readPrg(uint16_t addr); void writePrg(uint16_t addr, uint8_t value); uint8_t readChr(uint16_t addr); void writeChr(uint16_t addr, uint8_t value); private: void loadRegister(uint16_t addr, uint8_t value); void updateBankAddresses(); int decodePrgRomAddress(uint16_t addr); int decodeChrRomAddress(uint16_t addr); int shiftRegister = 0x10; int prgRomBank = 0; bool prgRamDisable = false; int chrRomBank0 = 0; int chrRomBank1 = 0; PrgMode prgMode = PrgMode::FIX_LAST_16KB; ChrMode chrMode = ChrMode::CHR_8KB; int prg16kBankAddresses[2]; int chr4kBankAddresses[2]; }; #endif
#ifndef MAPPER_1_H #define MAPPER_1_H #include <Mapper.h> enum PrgMode { PRG_32KB, FIX_FIRST_16KB, FIX_LAST_16KB, }; enum ChrMode { CHR_8KB, CHR_4KB, }; class Mapper1: public Mapper { public: uint8_t readPrg(uint16_t addr); void writePrg(uint16_t addr, uint8_t value); uint8_t readChr(uint16_t addr); void writeChr(uint16_t addr, uint8_t value); private: void loadRegister(uint16_t addr, uint8_t value); void updateBankAddresses(); int decodePrgRomAddress(uint16_t addr); int decodeChrRomAddress(uint16_t addr); int shiftRegister = 0x10; int prgRomBank = 0; bool prgRamDisable = false; int chrRomBank0 = 0; int chrRomBank1 = 0; PrgMode prgMode = PrgMode::PRG_32KB; ChrMode chrMode = ChrMode::CHR_8KB; int prg16kBankAddresses[2]; int chr4kBankAddresses[2]; }; #endif
--- +++ @@ -34,7 +34,7 @@ int chrRomBank0 = 0; int chrRomBank1 = 0; - PrgMode prgMode = PrgMode::PRG_32KB; + PrgMode prgMode = PrgMode::FIX_LAST_16KB; ChrMode chrMode = ChrMode::CHR_8KB; int prg16kBankAddresses[2];
Update mapper 1 default mapping on boot
mit
scottjcrouch/ScootNES,scottjcrouch/ScootNES,scottjcrouch/ScootNES
a615df7468af8315894a91bd5758699abbfcc97c
// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s // rdar://10033986 typedef void (^BLOCK)(void); int main () { _Complex double c; BLOCK b = ^() { _Complex double z; z = z + c; }; b(); } // CHECK: define internal void @__main_block_invoke_0 // CHECK: [[C1:%.*]] = alloca { double, double }, align 8 // CHECK: [[RP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0 // CHECK-NEXT: [[R:%.*]] = load double* [[RP]] // CHECK-NEXT: [[IP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1 // CHECK-NEXT: [[I:%.*]] = load double* [[IP]]
// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s // rdar://10033986 typedef void (^BLOCK)(void); int main () { _Complex double c; BLOCK b = ^() { _Complex double z; z = z + c; }; b(); } // CHECK: define internal void @__main_block_invoke_0 // CHECK: [[C1:%.*]] = alloca { double, double }, align 8 // CHECK: [[C1]].realp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0 // CHECK-NEXT: [[C1]].real = load double* [[C1]].realp // CHECK-NEXT: [[C1]].imagp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1 // CHECK-NEXT: [[C1]].imag = load double* [[C1]].imagp
--- +++ @@ -14,7 +14,7 @@ // CHECK: define internal void @__main_block_invoke_0 // CHECK: [[C1:%.*]] = alloca { double, double }, align 8 -// CHECK: [[C1]].realp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0 -// CHECK-NEXT: [[C1]].real = load double* [[C1]].realp -// CHECK-NEXT: [[C1]].imagp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1 -// CHECK-NEXT: [[C1]].imag = load double* [[C1]].imagp +// CHECK: [[RP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0 +// CHECK-NEXT: [[R:%.*]] = load double* [[RP]] +// CHECK-NEXT: [[IP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1 +// CHECK-NEXT: [[I:%.*]] = load double* [[IP]]
Revise test and see if it passes with a release-built clang. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@139043 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
0f2c1ce4661a6d767441b74f0c71f8bf93db91d6
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s // RUN: grep 'declare i32 @f0() readnone ;' %t // RUN: grep 'declare i32 @f1() readonly ;' %t // RUN: grep 'declare void @f2(.* sret) ;' %t // RUN: grep 'declare void @f3(.* sret) ;' %t // RUN: grep 'declare void @f4(.* byval) ;' %t // RUN: grep 'declare void @f5(.* byval) ;' %t // PR3835 typedef int T0; typedef struct { int a[16]; } T1; T0 __attribute__((const)) f0(void); T0 __attribute__((pure)) f1(void); T1 __attribute__((const)) f2(void); T1 __attribute__((pure)) f3(void); void __attribute__((const)) f4(T1 a); void __attribute__((pure)) f5(T1 a); void *ps[] = { f0, f1, f2, f3, f4, f5 };
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s // RUN: grep 'declare i32 @f0() readnone$' %t // RUN: grep 'declare i32 @f1() readonly$' %t // RUN: grep 'declare void @f2(.* sret)$' %t // RUN: grep 'declare void @f3(.* sret)$' %t // RUN: grep 'declare void @f4(.* byval)$' %t // RUN: grep 'declare void @f5(.* byval)$' %t // PR3835 typedef int T0; typedef struct { int a[16]; } T1; T0 __attribute__((const)) f0(void); T0 __attribute__((pure)) f1(void); T1 __attribute__((const)) f2(void); T1 __attribute__((pure)) f3(void); void __attribute__((const)) f4(T1 a); void __attribute__((pure)) f5(T1 a); void *ps[] = { f0, f1, f2, f3, f4, f5 };
--- +++ @@ -1,10 +1,10 @@ // RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s -// RUN: grep 'declare i32 @f0() readnone$' %t -// RUN: grep 'declare i32 @f1() readonly$' %t -// RUN: grep 'declare void @f2(.* sret)$' %t -// RUN: grep 'declare void @f3(.* sret)$' %t -// RUN: grep 'declare void @f4(.* byval)$' %t -// RUN: grep 'declare void @f5(.* byval)$' %t +// RUN: grep 'declare i32 @f0() readnone ;' %t +// RUN: grep 'declare i32 @f1() readonly ;' %t +// RUN: grep 'declare void @f2(.* sret) ;' %t +// RUN: grep 'declare void @f3(.* sret) ;' %t +// RUN: grep 'declare void @f4(.* byval) ;' %t +// RUN: grep 'declare void @f5(.* byval) ;' %t // PR3835 typedef int T0;
Correct this test for the fact that the number of uses is now printed in a comment. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@112813 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
cd4c34d2a078b78ca31fd3bc5cbb210123dce89d
//===--- UIKitOverlayShims.h ---===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===--------------------===// #ifndef SWIFT_STDLIB_SHIMS_UIKIT_OVERLAY_H #define SWIFT_STDLIB_SHIMS_UIKIT_OVERLAY_H @import UIKit; #if __has_feature(nullability) #pragma clang assume_nonnull begin #endif #if TARGET_OS_TV || TARGET_OS_IOS static inline BOOL _swift_UIKit_UIFocusEnvironmentContainsEnvironment( id<UIFocusEnvironment> environment, id<UIFocusEnvironment> otherEnvironment ) API_AVAILABLE(ios(11.0), tvos(11.0)) { return [UIFocusSystem environment:environment containsEnvironment:otherEnvironment]; } #endif // TARGET_OS_TV || TARGET_OS_IOS #if __has_feature(nullability) #pragma clang assume_nonnull end #endif #endif // SWIFT_STDLIB_SHIMS_UIKIT_OVERLAY_H
//===--- UIKitOverlayShims.h ---===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===--------------------===// #ifndef SWIFT_STDLIB_SHIMS_UIKIT_OVERLAY_H #define SWIFT_STDLIB_SHIMS_UIKIT_OVERLAY_H @import UIKit; #if __has_feature(nullability) #pragma clang assume_nonnull begin #endif #if TARGET_OS_TV || TARGET_OS_IOS static inline BOOL _swift_UIKit_UIFocusEnvironmentContainsEnvironment(id<UIFocusEnvironment> environment, id<UIFocusEnvironment> otherEnvironment) { return [UIFocusSystem environment:environment containsEnvironment:otherEnvironment]; } #endif // TARGET_OS_TV || TARGET_OS_IOS #if __has_feature(nullability) #pragma clang assume_nonnull end #endif #endif // SWIFT_STDLIB_SHIMS_UIKIT_OVERLAY_H
--- +++ @@ -20,7 +20,10 @@ #endif #if TARGET_OS_TV || TARGET_OS_IOS -static inline BOOL _swift_UIKit_UIFocusEnvironmentContainsEnvironment(id<UIFocusEnvironment> environment, id<UIFocusEnvironment> otherEnvironment) { +static inline BOOL _swift_UIKit_UIFocusEnvironmentContainsEnvironment( + id<UIFocusEnvironment> environment, + id<UIFocusEnvironment> otherEnvironment +) API_AVAILABLE(ios(11.0), tvos(11.0)) { return [UIFocusSystem environment:environment containsEnvironment:otherEnvironment]; } #endif // TARGET_OS_TV || TARGET_OS_IOS
[overlay] Make the UIKit shim function properly available <rdar://problem/33789760>
apache-2.0
xwu/swift,lorentey/swift,swiftix/swift,practicalswift/swift,jckarter/swift,apple/swift,parkera/swift,shajrawi/swift,allevato/swift,harlanhaskins/swift,aschwaighofer/swift,gregomni/swift,shajrawi/swift,CodaFi/swift,lorentey/swift,xedin/swift,gregomni/swift,gregomni/swift,airspeedswift/swift,shajrawi/swift,practicalswift/swift,devincoughlin/swift,gregomni/swift,uasys/swift,apple/swift,roambotics/swift,xwu/swift,brentdax/swift,lorentey/swift,airspeedswift/swift,atrick/swift,aschwaighofer/swift,uasys/swift,frootloops/swift,allevato/swift,huonw/swift,swiftix/swift,ahoppen/swift,glessard/swift,tjw/swift,zisko/swift,natecook1000/swift,JGiola/swift,tjw/swift,danielmartin/swift,austinzheng/swift,practicalswift/swift,glessard/swift,austinzheng/swift,alblue/swift,gregomni/swift,xedin/swift,shajrawi/swift,benlangmuir/swift,devincoughlin/swift,zisko/swift,rudkx/swift,ahoppen/swift,JGiola/swift,CodaFi/swift,huonw/swift,gribozavr/swift,karwa/swift,aschwaighofer/swift,sschiau/swift,parkera/swift,rudkx/swift,jopamer/swift,gribozavr/swift,nathawes/swift,stephentyrone/swift,hooman/swift,alblue/swift,gregomni/swift,karwa/swift,stephentyrone/swift,amraboelela/swift,CodaFi/swift,alblue/swift,devincoughlin/swift,rudkx/swift,zisko/swift,aschwaighofer/swift,roambotics/swift,stephentyrone/swift,roambotics/swift,JGiola/swift,apple/swift,jopamer/swift,shahmishal/swift,lorentey/swift,frootloops/swift,devincoughlin/swift,airspeedswift/swift,uasys/swift,jckarter/swift,hooman/swift,frootloops/swift,danielmartin/swift,nathawes/swift,jmgc/swift,brentdax/swift,tkremenek/swift,amraboelela/swift,OscarSwanros/swift,swiftix/swift,uasys/swift,benlangmuir/swift,glessard/swift,danielmartin/swift,shahmishal/swift,harlanhaskins/swift,frootloops/swift,OscarSwanros/swift,gribozavr/swift,rudkx/swift,nathawes/swift,jopamer/swift,gribozavr/swift,frootloops/swift,huonw/swift,OscarSwanros/swift,sschiau/swift,rudkx/swift,harlanhaskins/swift,stephentyrone/swift,roambotics/swift,ahoppen/swift,alblue/swift,tkremenek/swift,aschwaighofer/swift,austinzheng/swift,danielmartin/swift,sschiau/swift,harlanhaskins/swift,xedin/swift,stephentyrone/swift,ahoppen/swift,lorentey/swift,airspeedswift/swift,allevato/swift,brentdax/swift,shajrawi/swift,CodaFi/swift,ahoppen/swift,austinzheng/swift,shajrawi/swift,sschiau/swift,JGiola/swift,airspeedswift/swift,xwu/swift,nathawes/swift,xedin/swift,practicalswift/swift,xedin/swift,stephentyrone/swift,tkremenek/swift,shahmishal/swift,practicalswift/swift,jopamer/swift,sschiau/swift,jmgc/swift,airspeedswift/swift,rudkx/swift,karwa/swift,gribozavr/swift,jmgc/swift,natecook1000/swift,lorentey/swift,parkera/swift,allevato/swift,shahmishal/swift,jckarter/swift,alblue/swift,uasys/swift,tjw/swift,tkremenek/swift,hooman/swift,gribozavr/swift,benlangmuir/swift,apple/swift,uasys/swift,huonw/swift,apple/swift,tkremenek/swift,jmgc/swift,CodaFi/swift,stephentyrone/swift,atrick/swift,amraboelela/swift,lorentey/swift,tjw/swift,huonw/swift,zisko/swift,tkremenek/swift,practicalswift/swift,shahmishal/swift,jckarter/swift,huonw/swift,practicalswift/swift,jckarter/swift,devincoughlin/swift,natecook1000/swift,xwu/swift,atrick/swift,swiftix/swift,hooman/swift,zisko/swift,nathawes/swift,brentdax/swift,alblue/swift,huonw/swift,benlangmuir/swift,roambotics/swift,hooman/swift,amraboelela/swift,OscarSwanros/swift,benlangmuir/swift,gribozavr/swift,glessard/swift,xwu/swift,hooman/swift,xedin/swift,brentdax/swift,harlanhaskins/swift,atrick/swift,jmgc/swift,allevato/swift,lorentey/swift,parkera/swift,danielmartin/swift,devincoughlin/swift,CodaFi/swift,tkremenek/swift,jmgc/swift,karwa/swift,parkera/swift,alblue/swift,roambotics/swift,natecook1000/swift,zisko/swift,amraboelela/swift,tjw/swift,uasys/swift,parkera/swift,shahmishal/swift,austinzheng/swift,danielmartin/swift,swiftix/swift,apple/swift,swiftix/swift,frootloops/swift,gribozavr/swift,karwa/swift,nathawes/swift,benlangmuir/swift,ahoppen/swift,shahmishal/swift,karwa/swift,atrick/swift,sschiau/swift,jopamer/swift,natecook1000/swift,nathawes/swift,OscarSwanros/swift,airspeedswift/swift,xedin/swift,xwu/swift,JGiola/swift,glessard/swift,allevato/swift,JGiola/swift,brentdax/swift,jckarter/swift,austinzheng/swift,xwu/swift,tjw/swift,xedin/swift,harlanhaskins/swift,harlanhaskins/swift,parkera/swift,atrick/swift,natecook1000/swift,jopamer/swift,jckarter/swift,jopamer/swift,OscarSwanros/swift,sschiau/swift,aschwaighofer/swift,danielmartin/swift,parkera/swift,devincoughlin/swift,devincoughlin/swift,shajrawi/swift,tjw/swift,jmgc/swift,aschwaighofer/swift,allevato/swift,sschiau/swift,OscarSwanros/swift,glessard/swift,karwa/swift,swiftix/swift,brentdax/swift,shahmishal/swift,zisko/swift,frootloops/swift,shajrawi/swift,amraboelela/swift,natecook1000/swift,austinzheng/swift,CodaFi/swift,hooman/swift,amraboelela/swift,karwa/swift,practicalswift/swift
f1b1720769e346cc2a619f80191e380619421669
#include <stdio.h> #include <cs50.h> #include <string.h> #define ALPHA_NUM 26 int main(int argc, char *argv[]) { // check argument number and argument key to be greater than -1 if (argc != 2 || atoi(argv[1]) < 0) { printf("Usage (k >= 0):\n./caesar k \n"); return 1; } int key = atoi(argv[1]) % ALPHA_NUM; // get plaintext from user printf("plaintext: "); string plaintext = get_string(); printf("\n"); string ciphertext = ""; // encode plaintext size_t text_len = strlen(plaintext); for (int i = 0; i < text_len; ++i) { } return 0; }
#include <stdio.h> #include <cs50.h> int main(int argc, char *argv[]) { // check entered key if (argc != 2 || atoi(argv[1]) < 0) { printf("Usage: ./caesar k\nWhere k is a non negative integer.\n"); return 1; } int key = atoi(argv[1]); return 0; }
--- +++ @@ -1,15 +1,30 @@ #include <stdio.h> #include <cs50.h> +#include <string.h> +#define ALPHA_NUM 26 int main(int argc, char *argv[]) { - // check entered key + // check argument number and argument key to be greater than -1 if (argc != 2 || atoi(argv[1]) < 0) { - printf("Usage: ./caesar k\nWhere k is a non negative integer.\n"); + printf("Usage (k >= 0):\n./caesar k \n"); return 1; } - int key = atoi(argv[1]); + int key = atoi(argv[1]) % ALPHA_NUM; + + // get plaintext from user + printf("plaintext: "); + string plaintext = get_string(); + printf("\n"); + + string ciphertext = ""; + + // encode plaintext + size_t text_len = strlen(plaintext); + for (int i = 0; i < text_len; ++i) { + + }
Add unfinished loop to encode message
unlicense
Implaier/CS50,Implaier/CS50,Implaier/CS50,Implaier/CS50
c343de856dbe3f7049ad0193911216b3e7acdc54
/* * File: dump.h * Author: Scott Bennett */ #ifndef DUMP_H #define DUMP_H void dumpMemory(); void dumpProgramRegisters(); void dumpProcessorRegisters(); #endif /* DUMP_H */
/** * File: dump.h * Author: Scott Bennett */ #ifndef DUMP_H #define DUMP_H void dumpMemory(); void dumpProgramRegisters(); void dumpProcessorRegisters(); #endif /* DUMP_H */
--- +++ @@ -1,12 +1,13 @@ -/** +/* * File: dump.h * Author: Scott Bennett */ #ifndef DUMP_H #define DUMP_H + void dumpMemory(); void dumpProgramRegisters(); void dumpProcessorRegisters(); + #endif /* DUMP_H */ -
Change header to C style.
isc
sbennett1990/YESS,sbennett1990/YESS,sbennett1990/YESS
9f0a75104da58dd1c8a88e825ff3a7815d8ca7f8
#ifndef PATH_INTEGRATOR_H #define PATH_INTEGRATOR_H #include "surface_integrator.h" #include "renderer/renderer.h" /* * Surface integrator that uses Path tracing for computing illumination at a point on the surface */ class PathIntegrator : public SurfaceIntegrator { const int min_depth, max_depth; public: /* * Create the path tracing integrator and set the min and max depth for paths * rays are randomly stopped by Russian roulette after reaching min_depth and are stopped * at max_depth */ PathIntegrator(int min_depth, int max_depth); /* * Compute the illumination at a point on a surface in the scene */ Colorf illumination(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool) const override; }; #endif
#ifndef PATH_INTEGRATOR_H #define PATH_INTEGRATOR_H #include "surface_integrator.h" #include "renderer/renderer.h" /* * Surface integrator that uses Path tracing for computing illumination at a point on the surface */ class PathIntegrator : public SurfaceIntegrator { const int min_depth, max_depth; public: /* * Create the path tracing integrator and set the min and max depth for paths * rays are randomly stopped by Russian roulette after reaching min_depth and are stopped * at max_depth */ PathIntegrator(int min_depth, int max_depth); /* * Compute the illumination at a point on a surface in the scene */ Colorf illumination(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool) const override; private: /* * Trace a camera path starting from the first hit at dg returning the throughput of the * path and the BSDF of the last object hit and the direction we hit it from so that we * can connect the path to a light path */ Colorf trace_camera(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool, BSDF *&bsdf, Vector &w_o) const; /* * Trace a light path returning the illumination along the path and the BSDF of * of the last object hit and the direction we hit it from so that we */ Colorf trace_light(const Scene &scene, const Renderer &renderer, Sampler &sampler, MemoryPool &pool, BSDF *&bsdf, Vector &w_o) const; }; #endif
--- +++ @@ -22,21 +22,6 @@ */ Colorf illumination(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool) const override; - -private: - /* - * Trace a camera path starting from the first hit at dg returning the throughput of the - * path and the BSDF of the last object hit and the direction we hit it from so that we - * can connect the path to a light path - */ - Colorf trace_camera(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, - DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool, BSDF *&bsdf, Vector &w_o) const; - /* - * Trace a light path returning the illumination along the path and the BSDF of - * of the last object hit and the direction we hit it from so that we - */ - Colorf trace_light(const Scene &scene, const Renderer &renderer, Sampler &sampler, - MemoryPool &pool, BSDF *&bsdf, Vector &w_o) const; }; #endif
Remove the unused bidir functions from path tracer
mit
Twinklebear/tray,Twinklebear/tray
125eec8781231cf21041b742dccd906ef1c55738
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some log library? enum class ReturnCode { Stop = 0, Return = 1, Suicide = 2, BadJumpDestination = 101, OutOfGas = 102, StackTooSmall = 103, BadInstruction = 104, LLVMConfigError = 201, LLVMCompileError = 202, LLVMLinkError = 203, }; /// Representation of 256-bit value binary compatible with LLVM i256 // TODO: Replace with h256 struct i256 { uint64_t a = 0; uint64_t b = 0; uint64_t c = 0; uint64_t d = 0; }; static_assert(sizeof(i256) == 32, "Wrong i265 size"); #define UNTESTED assert(false) } } }
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some log library? enum class ReturnCode { Stop = 0, Return = 1, Suicide = 2, BadJumpDestination = 101, OutOfGas = 102, StackTooSmall = 103, BadInstruction = 104, LLVMConfigError = 201, LLVMCompileError = 202, LLVMLinkError = 203, }; /// Representation of 256-bit value binary compatible with LLVM i256 // TODO: Replace with h256 struct i256 { uint64_t a; uint64_t b; uint64_t c; uint64_t d; }; static_assert(sizeof(i256) == 32, "Wrong i265 size"); #define UNTESTED assert(false) } } }
--- +++ @@ -37,10 +37,10 @@ // TODO: Replace with h256 struct i256 { - uint64_t a; - uint64_t b; - uint64_t c; - uint64_t d; + uint64_t a = 0; + uint64_t b = 0; + uint64_t c = 0; + uint64_t d = 0; }; static_assert(sizeof(i256) == 32, "Wrong i265 size");
Fix some GCC initialization warnings
mit
ethereum/evmjit,ethereum/evmjit,ethereum/evmjit
d9ace0273fba4d7da6da20f36183c2b9bf1ad305
/* * Copyright 2011-2013 Blender 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 */ #if defined(__x86_64__) || defined(_M_X64) /* no SSE2 kernel on x86-64, part of regular kernel */ #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 /* VC2008 is not ready for sse41, probably broken blendv intrinsic... */ #if defined(_MSC_VER) && (_MSC_VER < 1700) #undef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 #endif #endif #if defined(i386) || defined(_M_IX86) #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 #endif
/* * Copyright 2011-2013 Blender 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 */ #if defined(__x86_64__) || defined(_M_X64) /* no SSE2 kernel on x86-64, part of regular kernel */ #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 #endif #if defined(i386) || defined(_M_IX86) #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 #endif
--- +++ @@ -20,12 +20,16 @@ #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 +/* VC2008 is not ready for sse41, probably broken blendv intrinsic... */ +#if defined(_MSC_VER) && (_MSC_VER < 1700) +#undef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 +#endif + #endif #if defined(i386) || defined(_M_IX86) #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 #define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 -#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 #endif
Cycles: Disable SSE41 kernel on 32bit, we don't use intrinsics here anyway. Also disable it for Visual Studio < 2012, broken blendv instruction.
apache-2.0
pyrochlore/cycles,tangent-opensource/coreBlackbird,pyrochlore/cycles,tangent-opensource/coreBlackbird,pyrochlore/cycles,tangent-opensource/coreBlackbird
ef1774c5b7f39291692a42b4aeced11abf8e7ace
/* Copyright(C) 2014 Brazil 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 */ #ifndef GROONGA_H #define GROONGA_H #include "groonga/groonga.h" #include "groonga/ii.h" #include "groonga/expr.h" #include "groonga/util.h" #endif /* GROONGA_H */
/* Copyright(C) 2014 Brazil 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 */ #ifndef GROONGA_H #define GROONGA_H #include <groonga/groonga.h> #include <groonga/ii.h> #include <groonga/expr.h> #include <groonga/util.h> #endif /* GROONGA_H */
--- +++ @@ -18,9 +18,9 @@ #ifndef GROONGA_H #define GROONGA_H -#include <groonga/groonga.h> -#include <groonga/ii.h> -#include <groonga/expr.h> -#include <groonga/util.h> +#include "groonga/groonga.h" +#include "groonga/ii.h" +#include "groonga/expr.h" +#include "groonga/util.h" #endif /* GROONGA_H */
Use "..." for ensure including header files in sub directory
lgpl-2.1
kenhys/groonga,naoa/groonga,hiroyuki-sato/groonga,groonga/groonga,hiroyuki-sato/groonga,hiroyuki-sato/groonga,hiroyuki-sato/groonga,kenhys/groonga,redfigure/groonga,naoa/groonga,redfigure/groonga,kenhys/groonga,komainu8/groonga,hiroyuki-sato/groonga,cosmo0920/groonga,cosmo0920/groonga,redfigure/groonga,naoa/groonga,naoa/groonga,komainu8/groonga,naoa/groonga,komainu8/groonga,naoa/groonga,redfigure/groonga,groonga/groonga,cosmo0920/groonga,groonga/groonga,komainu8/groonga,komainu8/groonga,groonga/groonga,komainu8/groonga,groonga/groonga,kenhys/groonga,cosmo0920/groonga,kenhys/groonga,groonga/groonga,redfigure/groonga,cosmo0920/groonga,cosmo0920/groonga,redfigure/groonga,komainu8/groonga,cosmo0920/groonga,hiroyuki-sato/groonga,kenhys/groonga,groonga/groonga,kenhys/groonga,naoa/groonga,kenhys/groonga,cosmo0920/groonga,redfigure/groonga,redfigure/groonga,groonga/groonga,hiroyuki-sato/groonga,hiroyuki-sato/groonga,naoa/groonga,komainu8/groonga
9f2e996500ef58f5ddadfab9ec7e882b9a201933
/* * Copyright (C) 2014 Freie Universität Berlin * Copyright (C) 2014 PHYTEC Messtechnik GmbH * Copyright (C) 2017 Eistec AB * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @ingroup boards_frdm-k22f * @{ * * @file * @brief Board specific implementations for the FRDM-K22F * * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> * * @} */ #include "board.h" #include "periph/gpio.h" void board_init(void) { /* initialize the CPU core */ cpu_init(); /* initialize and turn off the on-board RGB-LED */ gpio_init(LED0_PIN, GPIO_OUT); gpio_set(LED0_PIN); gpio_init(LED1_PIN, GPIO_OUT); gpio_set(LED1_PIN); gpio_init(LED2_PIN, GPIO_OUT); gpio_set(LED2_PIN); }
/* * Copyright (C) 2014 Freie Universität Berlin * Copyright (C) 2014 PHYTEC Messtechnik GmbH * Copyright (C) 2017 Eistec AB * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @ingroup boards_frdm-k64f * @{ * * @file * @brief Board specific implementations for the FRDM-K22F * * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> * * @} */ #include <stdint.h> #include "board.h" #include "mcg.h" #include "periph/gpio.h" void board_init(void) { /* initialize the CPU core */ cpu_init(); /* initialize and turn off the on-board RGB-LED */ gpio_init(LED0_PIN, GPIO_OUT); gpio_init(LED1_PIN, GPIO_OUT); gpio_init(LED2_PIN, GPIO_OUT); gpio_set(LED0_PIN); gpio_set(LED1_PIN); gpio_set(LED2_PIN); }
--- +++ @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_frdm-k64f + * @ingroup boards_frdm-k22f * @{ * * @file @@ -20,9 +20,7 @@ * @} */ -#include <stdint.h> #include "board.h" -#include "mcg.h" #include "periph/gpio.h" void board_init(void) @@ -32,9 +30,9 @@ /* initialize and turn off the on-board RGB-LED */ gpio_init(LED0_PIN, GPIO_OUT); + gpio_set(LED0_PIN); gpio_init(LED1_PIN, GPIO_OUT); + gpio_set(LED1_PIN); gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_set(LED1_PIN); gpio_set(LED2_PIN); }
frdm-k22f: Fix typos and remove unused includes
lgpl-2.1
kbumsik/RIOT,mfrey/RIOT,A-Paul/RIOT,OTAkeys/RIOT,smlng/RIOT,rfuentess/RIOT,mtausig/RIOT,jasonatran/RIOT,jasonatran/RIOT,rfuentess/RIOT,miri64/RIOT,authmillenon/RIOT,neiljay/RIOT,smlng/RIOT,kaspar030/RIOT,RIOT-OS/RIOT,gebart/RIOT,yogo1212/RIOT,kaspar030/RIOT,authmillenon/RIOT,BytesGalore/RIOT,kYc0o/RIOT,x3ro/RIOT,authmillenon/RIOT,basilfx/RIOT,authmillenon/RIOT,kbumsik/RIOT,x3ro/RIOT,lazytech-org/RIOT,avmelnikoff/RIOT,mfrey/RIOT,miri64/RIOT,gebart/RIOT,mtausig/RIOT,aeneby/RIOT,OTAkeys/RIOT,ant9000/RIOT,rfuentess/RIOT,yogo1212/RIOT,biboc/RIOT,josephnoir/RIOT,BytesGalore/RIOT,basilfx/RIOT,yogo1212/RIOT,ant9000/RIOT,RIOT-OS/RIOT,gebart/RIOT,biboc/RIOT,BytesGalore/RIOT,OlegHahm/RIOT,biboc/RIOT,lazytech-org/RIOT,smlng/RIOT,basilfx/RIOT,BytesGalore/RIOT,neiljay/RIOT,miri64/RIOT,authmillenon/RIOT,ant9000/RIOT,josephnoir/RIOT,basilfx/RIOT,josephnoir/RIOT,jasonatran/RIOT,cladmi/RIOT,yogo1212/RIOT,toonst/RIOT,kYc0o/RIOT,lazytech-org/RIOT,basilfx/RIOT,aeneby/RIOT,kaspar030/RIOT,authmillenon/RIOT,RIOT-OS/RIOT,aeneby/RIOT,toonst/RIOT,aeneby/RIOT,RIOT-OS/RIOT,aeneby/RIOT,biboc/RIOT,OTAkeys/RIOT,neiljay/RIOT,lazytech-org/RIOT,mfrey/RIOT,smlng/RIOT,jasonatran/RIOT,kbumsik/RIOT,josephnoir/RIOT,ant9000/RIOT,x3ro/RIOT,miri64/RIOT,rfuentess/RIOT,A-Paul/RIOT,gebart/RIOT,cladmi/RIOT,josephnoir/RIOT,OlegHahm/RIOT,OlegHahm/RIOT,x3ro/RIOT,cladmi/RIOT,yogo1212/RIOT,avmelnikoff/RIOT,miri64/RIOT,kbumsik/RIOT,yogo1212/RIOT,rfuentess/RIOT,toonst/RIOT,avmelnikoff/RIOT,OTAkeys/RIOT,neiljay/RIOT,toonst/RIOT,kYc0o/RIOT,kaspar030/RIOT,biboc/RIOT,avmelnikoff/RIOT,RIOT-OS/RIOT,OlegHahm/RIOT,neiljay/RIOT,smlng/RIOT,x3ro/RIOT,ant9000/RIOT,toonst/RIOT,lazytech-org/RIOT,kYc0o/RIOT,avmelnikoff/RIOT,BytesGalore/RIOT,mtausig/RIOT,gebart/RIOT,mfrey/RIOT,OlegHahm/RIOT,mtausig/RIOT,OTAkeys/RIOT,mtausig/RIOT,A-Paul/RIOT,A-Paul/RIOT,jasonatran/RIOT,A-Paul/RIOT,kYc0o/RIOT,kbumsik/RIOT,cladmi/RIOT,cladmi/RIOT,mfrey/RIOT,kaspar030/RIOT
b87325fe34c477f7786e791805bf692dbe79676b
/* ---------------------------------------------------------------- */ #define PY_SSIZE_T_CLEAN #include <Python.h> #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #endif /* ---------------------------------------------------------------- */ #define MPICH_SKIP_MPICXX 1 #define OMPI_SKIP_MPICXX 1 #include <petsc.h> /* ---------------------------------------------------------------- */ #include "python_core.h" #define PETSCMAT_DLL #include "python_mat.c" #undef PETSCMAT_DLL #define PETSCKSP_DLL #include "python_ksp.c" #undef PETSCKSP_DLL #define PETSCKSP_DLL #include "python_pc.c" #undef PETSCKSP_DLL #define PETSCSNES_DLL #include "python_snes.c" #undef PETSCSNES_DLL #define PETSCTS_DLL #include "python_ts.c" #undef PETSCTS_DLL /* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */ #include <Python.h> /* ---------------------------------------------------------------- */ #define MPICH_SKIP_MPICXX 1 #define OMPI_SKIP_MPICXX 1 #include <petsc.h> /* ---------------------------------------------------------------- */ #include "python_core.h" #define PETSCMAT_DLL #include "python_mat.c" #undef PETSCMAT_DLL #define PETSCKSP_DLL #include "python_ksp.c" #undef PETSCKSP_DLL #define PETSCKSP_DLL #include "python_pc.c" #undef PETSCKSP_DLL #define PETSCSNES_DLL #include "python_snes.c" #undef PETSCSNES_DLL #define PETSCTS_DLL #include "python_ts.c" #undef PETSCTS_DLL /* ---------------------------------------------------------------- */
--- +++ @@ -1,6 +1,10 @@ /* ---------------------------------------------------------------- */ +#define PY_SSIZE_T_CLEAN #include <Python.h> +#if PY_VERSION_HEX < 0x02050000 +typedef int Py_ssize_t; +#endif /* ---------------------------------------------------------------- */
Fix build failure with Python<=2.4 and PETSc<=3.1
bsd-2-clause
zonca/petsc4py,zonca/petsc4py,zonca/petsc4py,zonca/petsc4py
38310122f3a4d99326320da14638ff9088a33b56
/** * \file string_hash.c * \brief Computes a hash value for a string. * \author Copyright (c) 2012-2014 Jason Perkins and the Premake project */ #include "premake.h" #include <string.h> int string_hash(lua_State* L) { const char* str = luaL_checkstring(L, 1); unsigned long seed = luaL_optint(L, 2, 0); lua_pushnumber(L, (lua_Number)do_hash(str, seed)); return 1; } unsigned long do_hash(const char* str, int seed) { /* DJB2 hashing; see http://www.cse.yorku.ca/~oz/hash.html */ unsigned long hash = 5381; if (seed != 0) { hash = hash * 33 + seed; } while (*str) { hash = hash * 33 + (*str); str++; } return hash; }
/** * \file string_hash.c * \brief Computes a hash value for a string. * \author Copyright (c) 2012-2014 Jason Perkins and the Premake project */ #include "premake.h" #include <string.h> int string_hash(lua_State* L) { const char* str = luaL_checkstring(L, 1); unsigned long seed = luaL_optint(L, 2, 0); lua_pushnumber(L, do_hash(str, seed)); return 1; } unsigned long do_hash(const char* str, int seed) { /* DJB2 hashing; see http://www.cse.yorku.ca/~oz/hash.html */ unsigned long hash = 5381; if (seed != 0) { hash = hash * 33 + seed; } while (*str) { hash = hash * 33 + (*str); str++; } return hash; }
--- +++ @@ -12,7 +12,7 @@ { const char* str = luaL_checkstring(L, 1); unsigned long seed = luaL_optint(L, 2, 0); - lua_pushnumber(L, do_hash(str, seed)); + lua_pushnumber(L, (lua_Number)do_hash(str, seed)); return 1; }
Fix implicit conversion warning when building with floating point Lua
bsd-3-clause
bravnsgaard/premake-core,noresources/premake-core,starkos/premake-core,noresources/premake-core,premake/premake-core,tvandijck/premake-core,Yhgenomics/premake-core,felipeprov/premake-core,jstewart-amd/premake-core,Meoo/premake-core,TurkeyMan/premake-core,martin-traverse/premake-core,jstewart-amd/premake-core,jstewart-amd/premake-core,noresources/premake-core,grbd/premake-core,felipeprov/premake-core,dcourtois/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,CodeAnxiety/premake-core,jsfdez/premake-core,kankaristo/premake-core,mandersan/premake-core,PlexChat/premake-core,xriss/premake-core,aleksijuvani/premake-core,sleepingwit/premake-core,Zefiros-Software/premake-core,prapin/premake-core,noresources/premake-core,dcourtois/premake-core,mendsley/premake-core,kankaristo/premake-core,xriss/premake-core,lizh06/premake-core,Blizzard/premake-core,starkos/premake-core,Blizzard/premake-core,saberhawk/premake-core,resetnow/premake-core,felipeprov/premake-core,premake/premake-core,noresources/premake-core,LORgames/premake-core,soundsrc/premake-core,felipeprov/premake-core,martin-traverse/premake-core,Meoo/premake-core,jstewart-amd/premake-core,martin-traverse/premake-core,Blizzard/premake-core,dcourtois/premake-core,martin-traverse/premake-core,lizh06/premake-core,Yhgenomics/premake-core,TurkeyMan/premake-core,PlexChat/premake-core,aleksijuvani/premake-core,Tiger66639/premake-core,starkos/premake-core,tritao/premake-core,resetnow/premake-core,premake/premake-core,alarouche/premake-core,jstewart-amd/premake-core,Meoo/premake-core,tritao/premake-core,LORgames/premake-core,xriss/premake-core,tvandijck/premake-core,alarouche/premake-core,akaStiX/premake-core,tritao/premake-core,soundsrc/premake-core,Tiger66639/premake-core,sleepingwit/premake-core,saberhawk/premake-core,akaStiX/premake-core,alarouche/premake-core,aleksijuvani/premake-core,grbd/premake-core,starkos/premake-core,LORgames/premake-core,LORgames/premake-core,sleepingwit/premake-core,mendsley/premake-core,xriss/premake-core,premake/premake-core,aleksijuvani/premake-core,lizh06/premake-core,akaStiX/premake-core,resetnow/premake-core,lizh06/premake-core,Tiger66639/premake-core,tritao/premake-core,CodeAnxiety/premake-core,mendsley/premake-core,bravnsgaard/premake-core,CodeAnxiety/premake-core,kankaristo/premake-core,tvandijck/premake-core,Blizzard/premake-core,dcourtois/premake-core,mandersan/premake-core,Yhgenomics/premake-core,PlexChat/premake-core,prapin/premake-core,CodeAnxiety/premake-core,bravnsgaard/premake-core,grbd/premake-core,noresources/premake-core,prapin/premake-core,LORgames/premake-core,premake/premake-core,tvandijck/premake-core,mandersan/premake-core,premake/premake-core,CodeAnxiety/premake-core,saberhawk/premake-core,jsfdez/premake-core,Zefiros-Software/premake-core,akaStiX/premake-core,noresources/premake-core,saberhawk/premake-core,dcourtois/premake-core,soundsrc/premake-core,soundsrc/premake-core,starkos/premake-core,Blizzard/premake-core,dcourtois/premake-core,aleksijuvani/premake-core,grbd/premake-core,soundsrc/premake-core,tvandijck/premake-core,PlexChat/premake-core,resetnow/premake-core,Blizzard/premake-core,TurkeyMan/premake-core,Meoo/premake-core,premake/premake-core,prapin/premake-core,alarouche/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,xriss/premake-core,mandersan/premake-core,starkos/premake-core,starkos/premake-core,sleepingwit/premake-core,bravnsgaard/premake-core,dcourtois/premake-core,resetnow/premake-core,Zefiros-Software/premake-core,bravnsgaard/premake-core,kankaristo/premake-core,sleepingwit/premake-core,mendsley/premake-core,mandersan/premake-core,jsfdez/premake-core,Tiger66639/premake-core,jsfdez/premake-core,Yhgenomics/premake-core,mendsley/premake-core
ef460ae7e5836154d5e8e811af87491126de5487
#ifndef QCDEVICE_H #define QCDEVICE_H /* QuickCross Project * License: APACHE-2.0 * Author: Ben Lau * Project Site: https://github.com/benlau/quickcross * */ #include <QObject> class QCDevice : public QObject { Q_OBJECT Q_PROPERTY(QString os READ os) Q_PROPERTY(bool isAndroid READ isAndroid NOTIFY neverEmitChanged) Q_PROPERTY(bool isLinux READ isLinux NOTIFY neverEmitChanged) Q_PROPERTY(bool isMac READ isMac NOTIFY neverEmitChanged) Q_PROPERTY(bool isIOS READ isIOS NOTIFY neverEmitChanged) Q_PROPERTY(bool isWindows READ isWindows NOTIFY neverEmitChanged) Q_PROPERTY(qreal dp READ dp NOTIFY neverEmitChanged) public: explicit QCDevice(QObject *parent = 0); QString os() const; bool isAndroid() const; bool isLinux() const; bool isIOS() const; bool isMac() const; bool isWindows() const; qreal dp() const; signals: void neverEmitChanged(); public slots: }; #endif // QCDEVICE_H
#ifndef QCDEVICE_H #define QCDEVICE_H /* QuickCross Project * License: APACHE-2.0 * Author: Ben Lau * Project Site: https://github.com/benlau/quickcross * */ #include <QObject> class QCDevice : public QObject { Q_OBJECT Q_PROPERTY(QString os READ os) Q_PROPERTY(bool isAndroid READ isAndroid) Q_PROPERTY(bool isLinux READ isLinux) Q_PROPERTY(bool isMac READ isMac) Q_PROPERTY(bool isIOS READ isIOS) Q_PROPERTY(bool isWindows READ isWindows) Q_PROPERTY(qreal dp READ dp) public: explicit QCDevice(QObject *parent = 0); QString os() const; bool isAndroid() const; bool isLinux() const; bool isIOS() const; bool isMac() const; bool isWindows() const; qreal dp() const; signals: public slots: }; #endif // QCDEVICE_H
--- +++ @@ -14,12 +14,12 @@ { Q_OBJECT Q_PROPERTY(QString os READ os) - Q_PROPERTY(bool isAndroid READ isAndroid) - Q_PROPERTY(bool isLinux READ isLinux) - Q_PROPERTY(bool isMac READ isMac) - Q_PROPERTY(bool isIOS READ isIOS) - Q_PROPERTY(bool isWindows READ isWindows) - Q_PROPERTY(qreal dp READ dp) + Q_PROPERTY(bool isAndroid READ isAndroid NOTIFY neverEmitChanged) + Q_PROPERTY(bool isLinux READ isLinux NOTIFY neverEmitChanged) + Q_PROPERTY(bool isMac READ isMac NOTIFY neverEmitChanged) + Q_PROPERTY(bool isIOS READ isIOS NOTIFY neverEmitChanged) + Q_PROPERTY(bool isWindows READ isWindows NOTIFY neverEmitChanged) + Q_PROPERTY(qreal dp READ dp NOTIFY neverEmitChanged) public: explicit QCDevice(QObject *parent = 0); @@ -39,6 +39,7 @@ qreal dp() const; signals: + void neverEmitChanged(); public slots: };
QCDevice: Add a never emit signal on properties.
apache-2.0
benlau/quickcross,benlau/quickcross,benlau/quickcross
f381f9302f7b97246101165938b101c3d7050e56
// // PMPinboardService.h // Pinmarker // // Created by Kyle Stevens on 9/24/14. // Copyright (c) 2014 kilovolt42. All rights reserved. // @interface PMPinboardService : NSObject + (void)requestAPITokenForAPIToken:(NSString *)token success:(void (^)(NSString *))success failure:(void (^)(NSError *))failure; + (void)requestAPITokenForUsername:(NSString *)username password:(NSString *)password success:(void (^)(NSString *))success failure:(void (^)(NSError *))failure; + (void)requestTagsForAPIToken:(NSString *)token success:(void (^)(NSDictionary *))success failure:(void (^)(NSError *))failure; + (void)requestPostForURL:(NSString *)url APIToken:(NSString *)token success:(void (^)(NSDictionary *))success failure:(void (^)(NSError *))failure; + (void)postBookmarkParameters:(NSDictionary *)parameters APIToken:(NSString *)token success:(void (^)(id))success failure:(void (^)(NSError *, id))failure; @end
// // PMPinboardService.h // Pinmarker // // Created by Kyle Stevens on 9/24/14. // Copyright (c) 2014 kilovolt42. All rights reserved. // @class PMBookmark; @interface PMPinboardService : NSObject + (void)requestAPITokenForAPIToken:(NSString *)token success:(void (^)(NSString *))success failure:(void (^)(NSError *))failure; + (void)requestAPITokenForUsername:(NSString *)username password:(NSString *)password success:(void (^)(NSString *))success failure:(void (^)(NSError *))failure; + (void)requestTagsForAPIToken:(NSString *)token success:(void (^)(NSDictionary *))success failure:(void (^)(NSError *))failure; + (void)requestPostForURL:(NSString *)url APIToken:(NSString *)token success:(void (^)(NSDictionary *))success failure:(void (^)(NSError *))failure; + (void)postBookmarkParameters:(NSDictionary *)parameters APIToken:(NSString *)token success:(void (^)(id))success failure:(void (^)(NSError *, id))failure; @end
--- +++ @@ -5,8 +5,6 @@ // Created by Kyle Stevens on 9/24/14. // Copyright (c) 2014 kilovolt42. All rights reserved. // - -@class PMBookmark; @interface PMPinboardService : NSObject
Remove unnecessary forward class declaration
mit
kilovolt42/Pinmarker,kilovolt42/Pinmarker,kilovolt42/Pinmarker
9e7a287e2d334dbfecd3b8ed1c07b2c84ad9a085
#pragma once #include "Tab.h" class Display : public Tab { public: virtual void SaveSettings(); private: virtual DLGPROC Command(unsigned short nCode, unsigned short ctrlId); virtual DLGPROC Notification(NMHDR *nHdr); virtual void Initialize(); virtual void LoadSettings(); void OnPositionChanged(); void OnCustomCheckChanged(); void OnAnimationChanged(); private: /* Controls: */ Checkbox _onTop; Checkbox _hideFullscreen; ComboBox _position; Label _customX; EditBox _positionX; Label _customY; EditBox _positionY; Checkbox _customDistance; Spinner _edgeSpinner; Label _displayDevLabel; ComboBox _displayDevice; ComboBox _animation; Label _hideDelayLabel; Spinner _hideDelay; Label _hideSpeedLabel; Spinner _hideSpeed; private: /* Strings: */ std::wstring primaryMonitorStr = L"Primary Monitor"; std::wstring allMonitorStr = L"All Monitors"; std::wstring customPositionStr = L"Custom"; std::wstring noAnimStr = L"None"; private: /* Constants: */ const int MIN_EDGE = -65535; const int MAX_EDGE = 65535; const int MIN_MS = USER_TIMER_MINIMUM; const int MAX_MS = 60000; };
#pragma once #include "Tab.h" class Display : public Tab { public: virtual void SaveSettings(); private: virtual DLGPROC Command(unsigned short nCode, unsigned short ctrlId); virtual DLGPROC Notification(NMHDR *nHdr); virtual void Initialize(); virtual void LoadSettings(); void OnPositionChanged(); void OnCustomCheckChanged(); void OnAnimationChanged(); private: /* Controls: */ Checkbox _onTop; Checkbox _hideFullscreen; ComboBox _position; Label _customX; EditBox _positionX; Label _customY; EditBox _positionY; Checkbox _customDistance; Spinner _edgeSpinner; Label _displayDevLabel; ComboBox _displayDevice; ComboBox _animation; Label _hideDelayLabel; Spinner _hideDelay; Label _hideSpeedLabel; Spinner _hideSpeed; private: /* Constants: */ const int MIN_EDGE = -65535; const int MAX_EDGE = 65535; const int MIN_MS = USER_TIMER_MINIMUM; const int MAX_MS = 60000; };
--- +++ @@ -38,6 +38,12 @@ Label _hideSpeedLabel; Spinner _hideSpeed; +private: + /* Strings: */ + std::wstring primaryMonitorStr = L"Primary Monitor"; + std::wstring allMonitorStr = L"All Monitors"; + std::wstring customPositionStr = L"Custom"; + std::wstring noAnimStr = L"None"; private: /* Constants: */
Add strings (will be used for translation)
bsd-2-clause
Soulflare3/3RVX,malensek/3RVX,malensek/3RVX,malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX
169dc7b8de2f347edb54ce9007cfbf1c551be33a
/* * Copyright (c) 2013 Jeremy Yallop. * * This file is distributed under the terms of the MIT License. * See the file LICENSE for details. */ #ifndef TYPE_INFO_STUBS_H #define TYPE_INFO_STUBS_H #include <caml/mlvalues.h> /* Read a C value from a block of memory */ /* read : 'a prim -> offset:int -> raw_pointer -> 'a */ extern value ctypes_read(value ctype, value offset, value buffer); /* Write a C value to a block of memory */ /* write : 'a prim -> offset:int -> 'a -> raw_pointer -> unit */ extern value ctypes_write(value ctype, value offset, value v, value buffer); #endif /* TYPE_INFO_STUBS_H */
/* * Copyright (c) 2013 Jeremy Yallop. * * This file is distributed under the terms of the MIT License. * See the file LICENSE for details. */ #ifndef TYPE_INFO_STUBS_H #define TYPE_INFO_STUBS_H #include <caml/mlvalues.h> #include <caml/fail.h> #include <caml/callback.h> /* allocate_unpassable_struct_type_info : (size, alignment) -> _ ctype */ value ctypes_allocate_unpassable_struct_type_info(int size, int alignment); /* Read a C value from a block of memory */ /* read : 'a prim -> offset:int -> raw_pointer -> 'a */ extern value ctypes_read(value ctype, value offset, value buffer); /* Write a C value to a block of memory */ /* write : 'a prim -> offset:int -> 'a -> raw_pointer -> unit */ extern value ctypes_write(value ctype, value offset, value v, value buffer); #endif /* TYPE_INFO_STUBS_H */
--- +++ @@ -9,11 +9,6 @@ #define TYPE_INFO_STUBS_H #include <caml/mlvalues.h> -#include <caml/fail.h> -#include <caml/callback.h> - -/* allocate_unpassable_struct_type_info : (size, alignment) -> _ ctype */ -value ctypes_allocate_unpassable_struct_type_info(int size, int alignment); /* Read a C value from a block of memory */ /* read : 'a prim -> offset:int -> raw_pointer -> 'a */
Remove another obsolete function declaration.
mit
yallop/ocaml-ctypes,fdopen/ocaml-ctypes,dsheets/ocaml-ctypes,sjfloat/ocaml-ctypes,yallop/ocaml-ctypes,whitequark/ocaml-ctypes,whitequark/ocaml-ctypes,sjfloat/ocaml-ctypes,sjfloat/ocaml-ctypes,dsheets/ocaml-ctypes,fdopen/ocaml-ctypes,fdopen/ocaml-ctypes,whitequark/ocaml-ctypes,dsheets/ocaml-ctypes,ocamllabs/ocaml-ctypes,ocamllabs/ocaml-ctypes
79ad033eb47e12d5ea50015d10855c6ff3bc535b
#include "log.h" #include <stdio.h> #include <stdarg.h> void debug(const char* format, ...) { #ifdef __DEBUG__ va_list args; va_start(args, format); vprintf(format, args); va_end(args); #endif // __DEBUG__ } void initializeLogging() { }
#include "log.h" #include <stdio.h> void debug(const char* format, ...) { #ifdef __DEBUG__ vprintf(format, args); #endif // __DEBUG__ } void initializeLogging() { }
--- +++ @@ -1,9 +1,13 @@ #include "log.h" #include <stdio.h> +#include <stdarg.h> void debug(const char* format, ...) { #ifdef __DEBUG__ + va_list args; + va_start(args, format); vprintf(format, args); + va_end(args); #endif // __DEBUG__ }
Fix debugging printouts when running tests.
bsd-3-clause
openxc/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware
b0cc4feff6ca7ac2015a44dd36506de77023b798
#include "src/math/reinterpret.h" #include <math.h> #include <stdint.h> #include <assert.h> int main(void) { const __int128 delta = (__int128)0x17E93193 << 64 | 0xC0605887B0E6B634; for (__int128 i = reinterpret(__int128, 0.9L); i < reinterpret(__int128, 0x1p64L); i += delta) { long double x = reinterpret(long double, i); assert((uint64_t)x == truncl(x)); } }
#include "src/math/reinterpret.h" #include <math.h> #include <stdint.h> #include <assert.h> static _Bool run(uint64_t a) { return a == truncl(a); } int main(void) { const uint64_t delta = 0x0008D46BA87B5A22; for (uint64_t i = 0x3FFFFFFFFFFFFFFF; i < 0x4340000000000000; i += delta) assert(run(reinterpret(double, i))); for (uint64_t i = 0; i <= UINT64_MAX / delta; ++i) assert(run(i * delta)); }
--- +++ @@ -3,18 +3,12 @@ #include <stdint.h> #include <assert.h> -static _Bool run(uint64_t a) -{ - return a == truncl(a); -} - int main(void) { - const uint64_t delta = 0x0008D46BA87B5A22; + const __int128 delta = (__int128)0x17E93193 << 64 | 0xC0605887B0E6B634; - for (uint64_t i = 0x3FFFFFFFFFFFFFFF; i < 0x4340000000000000; i += delta) - assert(run(reinterpret(double, i))); - - for (uint64_t i = 0; i <= UINT64_MAX / delta; ++i) - assert(run(i * delta)); + for (__int128 i = reinterpret(__int128, 0.9L); i < reinterpret(__int128, 0x1p64L); i += delta) { + long double x = reinterpret(long double, i); + assert((uint64_t)x == truncl(x)); + } }
Test truncation of long double -> uint64_t
mit
jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic
27390e0138f13a06c5d52054510e7a979e900f97
/* * Copyright 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ #include <stdlib.h> #include <stdio.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" #include "native_client/src/trusted/service_runtime/nacl_signal.h" void NaClAbort(void) { NaClExit(-SIGABRT); } void NaClExit(int err_code) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit(err_code); #else /* If the process is scheduled for termination, wait for it.*/ if (TerminateProcess(GetCurrentProcess(), err_code)) { printf("Terminate passed, but returned.\n"); while(1); } printf("Terminate failed with %d.\n", GetLastError()); /* Otherwise use the standard C process exit to bybass destructors. */ ExitProcess(err_code); #endif }
/* * Copyright 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ #include <stdlib.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" #include "native_client/src/trusted/service_runtime/nacl_signal.h" void NaClAbort(void) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit((-SIGABRT) & 0xFF); #else /* Return an 8 bit value for SIGABRT */ TerminateProcess(GetCurrentProcess(),(-SIGABRT) & 0xFF); #endif } void NaClExit(int err_code) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit(err_code); #else TerminateProcess(GetCurrentProcess(), err_code); #endif }
--- +++ @@ -5,6 +5,7 @@ */ #include <stdlib.h> +#include <stdio.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" @@ -12,13 +13,7 @@ void NaClAbort(void) { -#ifdef COVERAGE - /* Give coverage runs a chance to flush coverage data */ - exit((-SIGABRT) & 0xFF); -#else - /* Return an 8 bit value for SIGABRT */ - TerminateProcess(GetCurrentProcess(),(-SIGABRT) & 0xFF); -#endif + NaClExit(-SIGABRT); } void NaClExit(int err_code) { @@ -26,7 +21,15 @@ /* Give coverage runs a chance to flush coverage data */ exit(err_code); #else - TerminateProcess(GetCurrentProcess(), err_code); + /* If the process is scheduled for termination, wait for it.*/ + if (TerminateProcess(GetCurrentProcess(), err_code)) { + printf("Terminate passed, but returned.\n"); + while(1); + } + printf("Terminate failed with %d.\n", GetLastError()); + + /* Otherwise use the standard C process exit to bybass destructors. */ + ExitProcess(err_code); #endif }
Fix exit issue on Vista/Win7Atom TerminateProcess returns causing "exit" to fall through. This is causing the buildbots to go red. To fix this, We must add a check to verify termination was scheduled, then loop. As a seperate CL we should find a way to do this without allowing a return on an untrusted stack. BUG= nacl1618 TEST= buildbot Review URL: http://codereview.chromium.org/6804029 git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@4774 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
bsd-3-clause
nacl-webkit/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client
c43332e636fb372919959d58e25554dcb52148ba
/* Copyright (c) 2004 Timo Sirainen */ #include "lib.h" #include "str.h" #include "str-sanitize.h" void str_sanitize_append(string_t *dest, const char *src, size_t max_len) { const char *p; for (p = src; *p != '\0'; p++) { if (((unsigned char)*p & 0x7f) < 32) break; } str_append_n(dest, src, (size_t)(p - src)); for (; *p != '\0' && max_len > 0; p++, max_len--) { if (((unsigned char)*p & 0x7f) < 32) str_append_c(dest, '?'); else str_append_c(dest, *p); } if (*p != '\0') { str_truncate(dest, str_len(dest)-3); str_append(dest, "..."); } } const char *str_sanitize(const char *src, size_t max_len) { string_t *str; str = t_str_new(I_MIN(max_len, 256)); str_sanitize_append(str, src, max_len); return str_c(str); }
/* Copyright (c) 2004 Timo Sirainen */ #include "lib.h" #include "str.h" #include "str-sanitize.h" void str_sanitize_append(string_t *dest, const char *src, size_t max_len) { const char *p; for (p = src; *p != '\0'; p++) { if ((unsigned char)*p < 32) break; } str_append_n(dest, src, (size_t)(p - src)); for (; *p != '\0' && max_len > 0; p++, max_len--) { if ((unsigned char)*p < 32) str_append_c(dest, '?'); else str_append_c(dest, *p); } if (*p != '\0') { str_truncate(dest, str_len(dest)-3); str_append(dest, "..."); } } const char *str_sanitize(const char *src, size_t max_len) { string_t *str; str = t_str_new(I_MIN(max_len, 256)); str_sanitize_append(str, src, max_len); return str_c(str); }
--- +++ @@ -9,13 +9,13 @@ const char *p; for (p = src; *p != '\0'; p++) { - if ((unsigned char)*p < 32) + if (((unsigned char)*p & 0x7f) < 32) break; } str_append_n(dest, src, (size_t)(p - src)); for (; *p != '\0' && max_len > 0; p++, max_len--) { - if ((unsigned char)*p < 32) + if (((unsigned char)*p & 0x7f) < 32) str_append_c(dest, '?'); else str_append_c(dest, *p);
Convert also 0x80..0x9f characters to '?' --HG-- branch : HEAD
mit
jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jkerihuel/dovecot,jwm/dovecot-notmuch
37a5cee2b4362014d6c0f81c82b2f75d7a5204f6
/* * Copyright © 2009 CNRS, INRIA, Université Bordeaux 1 * Copyright © 2009 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <hwloc.h> #include <stdio.h> int main(int argc, char *argv[]) { mytest_hwloc_topology_t topology; unsigned depth; hwloc_cpuset_t cpu_set; /* Just call a bunch of functions to see if we can link and run */ printf("*** Test 1: cpuset alloc\n"); cpu_set = mytest_hwloc_cpuset_alloc(); printf("*** Test 2: topology init\n"); mytest_hwloc_topology_init(&topology); printf("*** Test 3: topology load\n"); mytest_hwloc_topology_load(topology); printf("*** Test 4: topology get depth\n"); depth = mytest_hwloc_topology_get_depth(topology); printf(" Max depth: %u\n", depth); printf("*** Test 5: topology destroy\n"); mytest_hwloc_topology_destroy(topology); printf("*** Test 6: cpuset free\n"); mytest_hwloc_cpuset_free(cpu_set); return 0; }
/* * Copyright © 2009 CNRS, INRIA, Université Bordeaux 1 * Copyright © 2009 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <hwloc.h> #include <stdio.h> int main(int argc, char *argv[]) { mytest_hwloc_topology_t topology; unsigned depth; hwloc_cpuset_t cpu_set; /* Just call a bunch of functions to see if we can link and run */ cpu_set = mytest_hwloc_cpuset_alloc(); mytest_hwloc_topology_init(&topology); mytest_hwloc_topology_load(topology); depth = mytest_hwloc_topology_get_depth(topology); printf("Max depth: %u\n", depth); mytest_hwloc_topology_destroy(topology); mytest_hwloc_cpuset_free(cpu_set); return 0; }
--- +++ @@ -15,12 +15,18 @@ /* Just call a bunch of functions to see if we can link and run */ + printf("*** Test 1: cpuset alloc\n"); cpu_set = mytest_hwloc_cpuset_alloc(); + printf("*** Test 2: topology init\n"); mytest_hwloc_topology_init(&topology); + printf("*** Test 3: topology load\n"); mytest_hwloc_topology_load(topology); + printf("*** Test 4: topology get depth\n"); depth = mytest_hwloc_topology_get_depth(topology); - printf("Max depth: %u\n", depth); + printf(" Max depth: %u\n", depth); + printf("*** Test 5: topology destroy\n"); mytest_hwloc_topology_destroy(topology); + printf("*** Test 6: cpuset free\n"); mytest_hwloc_cpuset_free(cpu_set); return 0;
Add some more print statements to this test, ju... Add some more print statements to this test, just to help differentiate the output when debugging is enabled This commit was SVN r1752.
bsd-3-clause
ggouaillardet/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc
fadc5f679f9aae27b623c95f91208b2f139e089e
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.03.01-k9" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 3 #define QLA_DRIVER_PATCH_VER 1 #define QLA_DRIVER_BETA_VER 0
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.03.01-k8" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 3 #define QLA_DRIVER_PATCH_VER 1 #define QLA_DRIVER_BETA_VER 0
--- +++ @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.03.01-k8" +#define QLA2XXX_VERSION "8.03.01-k9" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 3
[SCSI] qla2xxx: Update version number to 8.03.01-k9. Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com> Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
3b9c212a5cbb1e13ced92639ce83f7a48b8b2331
#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
#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
--- +++ @@ -3,7 +3,7 @@ #if defined(_MSC_VER) && (_MSC_VER <= 1300) typedef unsigned __int32 uint32_t; -#elif defined(__linux__) || defined(__GLIBC__) || defined(__WIN32__) +#elif defined(__linux__) || defined(__GLIBC__) || defined(__WIN32__) || defined(__APPLE__) #include <stdint.h> #elif defined(__osf__) #include <inttypes.h>
Fix OS X build failure
bsd-3-clause
amenonsen/Math-Random-MT,amenonsen/Math-Random-MT
78a7a88da94ee3e6972485ceca00be8519212025
#include <stdlib.h> #include <stdio.h> struct llnode; struct symbol; struct function; union value; struct variable; struct statement; struct call; struct llnode { struct variable* car; struct llnode* cdr; }; struct call { char* name; struct function func; struct symbol* arguments; int numargs; } struct symbol {//I guess this is analogous to a symbol in lisp. char* name; //It has a name, which we use to keep track of it. struct variable* referant; //And an actual value in memory. }; struct function { struct symbol* args; //these are the symbols that the function takes as arguments char* definition; // this is the function's actual definition, left in text form until parsing. int numargs; }; union value { //we have three primitive types, so every variable's value is one of those types char bit; struct llnode list; struct function func; }; struct variable { //this is essentially an in-program variable union value val; //it has a value, i.e. what it equals char typeid; //and a type id that allows us to correctly extract the value from the union value. };
#include <stdlib.h> #include <stdio.h> struct llnode; struct symbol; struct function; union value; struct variable; struct statement; struct call; struct llnode { struct type* car; struct llnode* cdr; }; struct call { char* name; struct function func; struct symbol* arguments; int numargs; } struct symbol {//I guess this is analogous to a symbol in lisp. char* name; //It has a name, which we use to keep track of it. struct variable* referant; //And an actual value in memory. }; struct function { struct symbol* args; //these are the symbols that the function takes as arguments char* definition; // this is the function's actual definition, left in text form until parsing. }; union value { //we have three primitive types, so every variable's value is one of those types char bit; struct llnode list; struct function func; }; struct variable { //this is essentially an in-program variable union value val; //it has a value, i.e. what it equals char typeid; //and a type id that allows us to correctly extract the value from the union value. };
--- +++ @@ -12,7 +12,7 @@ struct llnode { - struct type* car; + struct variable* car; struct llnode* cdr; }; @@ -31,6 +31,7 @@ struct function { struct symbol* args; //these are the symbols that the function takes as arguments char* definition; // this is the function's actual definition, left in text form until parsing. + int numargs; }; union value { //we have three primitive types, so every variable's value is one of those types
Add a numargs field to struct function, which refers to the number of arguments the function takes.
mit
aacoppa/final,aacoppa/final
cf1943751de987986a59a5a458070a7bf4548fee
//===- PPCTargetStreamer.h - PPC Target Streamer ----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H #define LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H #include "llvm/ADT/StringRef.h" #include "llvm/MC/MCStreamer.h" namespace llvm { class MCExpr; class MCSymbol; class MCSymbolELF; class PPCTargetStreamer : public MCTargetStreamer { public: PPCTargetStreamer(MCStreamer &S); ~PPCTargetStreamer() override; virtual void emitTCEntry(const MCSymbol &S) = 0; virtual void emitMachine(StringRef CPU) = 0; virtual void emitAbiVersion(int AbiVersion) = 0; virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) = 0; }; } // end namespace llvm #endif // LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H
//===-- PPCTargetStreamer.h - PPC Target Streamer --s-----------*- C++ -*--===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H #define LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H #include "llvm/MC/MCStreamer.h" namespace llvm { class PPCTargetStreamer : public MCTargetStreamer { public: PPCTargetStreamer(MCStreamer &S); ~PPCTargetStreamer() override; virtual void emitTCEntry(const MCSymbol &S) = 0; virtual void emitMachine(StringRef CPU) = 0; virtual void emitAbiVersion(int AbiVersion) = 0; virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) = 0; }; } #endif
--- +++ @@ -1,4 +1,4 @@ -//===-- PPCTargetStreamer.h - PPC Target Streamer --s-----------*- C++ -*--===// +//===- PPCTargetStreamer.h - PPC Target Streamer ----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,18 +10,26 @@ #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H #define LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H +#include "llvm/ADT/StringRef.h" #include "llvm/MC/MCStreamer.h" namespace llvm { + +class MCExpr; +class MCSymbol; +class MCSymbolELF; + class PPCTargetStreamer : public MCTargetStreamer { public: PPCTargetStreamer(MCStreamer &S); ~PPCTargetStreamer() override; + virtual void emitTCEntry(const MCSymbol &S) = 0; virtual void emitMachine(StringRef CPU) = 0; virtual void emitAbiVersion(int AbiVersion) = 0; virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) = 0; }; -} -#endif +} // end namespace llvm + +#endif // LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H
[PowerPC] Fix some Include What You Use warnings; other minor fixes (NFC). This is preparation to reduce MC headers dependencies. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@294368 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm
e22b221f8f12b2ec8348745d91836c236b206738
// Copyright 2012-2014 UX Productivity Pty Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef DocFormats_DFTypes_h #define DocFormats_DFTypes_h #ifdef _MSC_VER #define ATTRIBUTE_ALIGNED(n) #define ATTRIBUTE_FORMAT(archetype,index,first) #else #define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n))) #define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first))) #endif #ifdef WIN32 #define _CRT_SECURE_NO_WARNINGS #endif #include <sys/types.h> #include <stdint.h> #include <stdarg.h> #endif
// Copyright 2012-2014 UX Productivity Pty Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef DocFormats_DFTypes_h #define DocFormats_DFTypes_h #ifdef _MSC_VER #define ATTRIBUTE_ALIGNED(n) #define ATTRIBUTE_FORMAT(archetype,index,first) #else #define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n))) #define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first))) #endif #include <sys/types.h> #include <stdint.h> #include <stdarg.h> #endif
--- +++ @@ -23,6 +23,10 @@ #define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first))) #endif +#ifdef WIN32 +#define _CRT_SECURE_NO_WARNINGS +#endif + #include <sys/types.h> #include <stdint.h> #include <stdarg.h>
Win32: Disable warnings about insecure functions Set the _CRT_SECURE_NO_WARNINGS macro so that VC++ doesn't complain about commonly-used functions like open and vsnprintf that it considers "unsafe". The alternatives it suggests are not available on Unix-based platforms, and they're used extensively throughout the codebase.
apache-2.0
apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,corinthia/corinthia-docformats,corinthia/corinthia-docformats,corinthia/corinthia-docformats,apache/incubator-corinthia
af533b7e864c9a3790abe2095110924cc374af3c
// This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // #if !defined(__COREFOUNDATION_CFASMMACROS__) #define __COREFOUNDATION_CFASMMACROS__ 1 #define CONCAT(a,b) a##b #define CONCAT_EXPANDED(a,b) CONCAT(a,b) #define _C_LABEL(name) CONCAT_EXPANDED(__USER_LABEL_PREFIX__,name) #if defined(__GNU__) || defined(__GNUC__) || defined(__ANDROID__) || defined(__FreeBSD__) #define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits #else #define NO_EXEC_STACK_DIRECTIVE #endif #endif
// This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // #if !defined(__COREFOUNDATION_CFASMMACROS__) #define __COREFOUNDATION_CFASMMACROS__ 1 #define CONCAT(a,b) a##b #define CONCAT_EXPANDED(a,b) CONCAT(a,b) #define _C_LABEL(name) CONCAT_EXPANDED(__USER_LABEL_PREFIX__,name) #if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__) #define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits #else #define NO_EXEC_STACK_DIRECTIVE #endif #endif
--- +++ @@ -14,7 +14,7 @@ #define CONCAT_EXPANDED(a,b) CONCAT(a,b) #define _C_LABEL(name) CONCAT_EXPANDED(__USER_LABEL_PREFIX__,name) -#if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__) +#if defined(__GNU__) || defined(__GNUC__) || defined(__ANDROID__) || defined(__FreeBSD__) #define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits #else #define NO_EXEC_STACK_DIRECTIVE
Fix libFoundation.so being flagged as requiring executable stack libFoundation.so is flagged as requiring an executable stack on Linux, although it does not. This is due to GNU as behavior. Please see discussion at https://bugs.swift.org/browse/SR-2700?jql=text%20~%20%22executable%20stack%22 This was already intended to be solved by https://github.com/apple/swift-corelibs-foundation/pull/649/, but did not work as intended in Ubuntu. Checking for __GNUC__ in addition resolves the issue.
apache-2.0
ikesyo/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,parkera/swift-corelibs-foundation,alblue/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,apple/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,e78l/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,alblue/swift-corelibs-foundation,alblue/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,apple/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,e78l/swift-corelibs-foundation,parkera/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,apple/swift-corelibs-foundation,alblue/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,e78l/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,e78l/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,alblue/swift-corelibs-foundation,e78l/swift-corelibs-foundation,parkera/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,parkera/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,parkera/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation
dcc7db1fa3167c6dca1fef18dd38b820952faa49
#ifndef OPTHELPERS_H #define OPTHELPERS_H #ifdef __has_builtin #define HAS_BUILTIN __has_builtin #else #define HAS_BUILTIN(x) (0) #endif #ifdef __GNUC__ /* LIKELY optimizes the case where the condition is true. The condition is not * required to be true, but it can result in more optimal code for the true * path at the expense of a less optimal false path. */ #define LIKELY(x) __builtin_expect(!!(x), !false) /* The opposite of LIKELY, optimizing the case where the condition is false. */ #define UNLIKELY(x) __builtin_expect(!!(x), false) /* Unlike LIKELY, ASSUME requires the condition to be true or else it invokes * undefined behavior. It's essentially an assert without actually checking the * condition at run-time, allowing for stronger optimizations than LIKELY. */ #if HAS_BUILTIN(__builtin_assume) #define ASSUME __builtin_assume #else #define ASSUME(x) do { if(!(x)) __builtin_unreachable(); } while(0) #endif #else /* __GNUC__ */ #define LIKELY(x) (!!(x)) #define UNLIKELY(x) (!!(x)) #ifdef _MSC_VER #define ASSUME __assume #else #define ASSUME(x) ((void)0) #endif /* _MSC_VER */ #endif /* __GNUC__ */ #endif /* OPTHELPERS_H */
#ifndef OPTHELPERS_H #define OPTHELPERS_H #ifdef __has_builtin #define HAS_BUILTIN __has_builtin #else #define HAS_BUILTIN(x) (0) #endif #ifdef __GNUC__ /* LIKELY optimizes the case where the condition is true. The condition is not * required to be true, but it can result in more optimal code for the true * path at the expense of a less optimal false path. */ #define LIKELY(x) __builtin_expect(!!(x), !0) /* The opposite of LIKELY, optimizing the case where the condition is false. */ #define UNLIKELY(x) __builtin_expect(!!(x), 0) /* Unlike LIKELY, ASSUME requires the condition to be true or else it invokes * undefined behavior. It's essentially an assert without actually checking the * condition at run-time, allowing for stronger optimizations than LIKELY. */ #if HAS_BUILTIN(__builtin_assume) #define ASSUME __builtin_assume #else #define ASSUME(x) do { if(!(x)) __builtin_unreachable(); } while(0) #endif #else /* __GNUC__ */ #define LIKELY(x) (!!(x)) #define UNLIKELY(x) (!!(x)) #ifdef _MSC_VER #define ASSUME __assume #else #define ASSUME(x) ((void)0) #endif /* _MSC_VER */ #endif /* __GNUC__ */ #endif /* OPTHELPERS_H */
--- +++ @@ -12,9 +12,9 @@ * required to be true, but it can result in more optimal code for the true * path at the expense of a less optimal false path. */ -#define LIKELY(x) __builtin_expect(!!(x), !0) +#define LIKELY(x) __builtin_expect(!!(x), !false) /* The opposite of LIKELY, optimizing the case where the condition is false. */ -#define UNLIKELY(x) __builtin_expect(!!(x), 0) +#define UNLIKELY(x) __builtin_expect(!!(x), false) /* Unlike LIKELY, ASSUME requires the condition to be true or else it invokes * undefined behavior. It's essentially an assert without actually checking the * condition at run-time, allowing for stronger optimizations than LIKELY.
Use false instead of 0 for a boolean
lgpl-2.1
aaronmjacobs/openal-soft,aaronmjacobs/openal-soft
c8e8ac42abb9225c3abfac036340548cfaaa0e92
/* mbed Microcontroller Library - cmsis_nvic for STM32F4 * Copyright (c) 2009-2011 ARM Limited. All rights reserved. * * CMSIS-style functionality to support dynamic vectors */ #include "cmsis_nvic.h" #define NVIC_RAM_VECTOR_ADDRESS (0x20000000) // Location of vectors in RAM static unsigned char vtor_relocated; void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { uint32_t *vectors = (uint32_t*)SCB->VTOR; uint32_t i; // Copy and switch to dynamic vectors if the first time called if (!vtor_relocated) { uint32_t *old_vectors = vectors; vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS; for (i=0; i<NVIC_NUM_VECTORS; i++) { vectors[i] = old_vectors[i]; } SCB->VTOR = (uint32_t)NVIC_RAM_VECTOR_ADDRESS; vtor_relocated = 1; } vectors[IRQn + 16] = vector; } uint32_t NVIC_GetVector(IRQn_Type IRQn) { uint32_t *vectors = (uint32_t*)SCB->VTOR; return vectors[IRQn + 16]; }
/* mbed Microcontroller Library - cmsis_nvic for STM32F4 * Copyright (c) 2009-2011 ARM Limited. All rights reserved. * * CMSIS-style functionality to support dynamic vectors */ #include "cmsis_nvic.h" #define NVIC_RAM_VECTOR_ADDRESS (0x20000000) // Location of vectors in RAM #define NVIC_FLASH_VECTOR_ADDRESS (0x0) // Initial vector position in flash void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { uint32_t *vectors = (uint32_t*)SCB->VTOR; uint32_t i; // Copy and switch to dynamic vectors if the first time called if (SCB->VTOR == NVIC_FLASH_VECTOR_ADDRESS) { uint32_t *old_vectors = vectors; vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS; for (i=0; i<NVIC_NUM_VECTORS; i++) { vectors[i] = old_vectors[i]; } SCB->VTOR = (uint32_t)NVIC_RAM_VECTOR_ADDRESS; } vectors[IRQn + 16] = vector; } uint32_t NVIC_GetVector(IRQn_Type IRQn) { uint32_t *vectors = (uint32_t*)SCB->VTOR; return vectors[IRQn + 16]; }
--- +++ @@ -6,20 +6,22 @@ #include "cmsis_nvic.h" #define NVIC_RAM_VECTOR_ADDRESS (0x20000000) // Location of vectors in RAM -#define NVIC_FLASH_VECTOR_ADDRESS (0x0) // Initial vector position in flash + +static unsigned char vtor_relocated; void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { uint32_t *vectors = (uint32_t*)SCB->VTOR; uint32_t i; // Copy and switch to dynamic vectors if the first time called - if (SCB->VTOR == NVIC_FLASH_VECTOR_ADDRESS) { + if (!vtor_relocated) { uint32_t *old_vectors = vectors; vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS; for (i=0; i<NVIC_NUM_VECTORS; i++) { vectors[i] = old_vectors[i]; } SCB->VTOR = (uint32_t)NVIC_RAM_VECTOR_ADDRESS; + vtor_relocated = 1; } vectors[IRQn + 16] = vector; }
Fix relocation of vector on STM32.
apache-2.0
Psykar/kubos,Psykar/kubos,Psykar/kubos,kubostech/KubOS,Psykar/kubos,Psykar/kubos,Psykar/kubos,Psykar/kubos,kubostech/KubOS
1f9749452f0d1c50eb920c5df7b026542d07eab8
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else { x = 1; y = 0; } // if (!(x + y == 1)) if (x + y != 1) __VERIFIER_error(); return 0; }
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else { x = 1; y = 0; } // if (!(x + y == 1)) if (x + y != 1) __VERIFIER_error(); return 0; }
--- +++ @@ -1,11 +1,5 @@ extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); -void __VERIFIER_assert(int cond) { - if (!(cond)) { - ERROR: __VERIFIER_error(); - } - return; -} int main() {
Remove unused __VERIFIER_assert definition from nofun test
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
f9167849b8c24cd4689aedd6c9a1c43719091d8f
#include <stdio.h> #include <stdlib.h> #include "arch.h" #include "../../cc2.h" #include "../../../inc/sizes.h" /* * : is for user-defined Aggregate Types * $ is for globals (represented by a pointer) * % is for function-scope temporaries * @ is for block labels */ static char sigil(Symbol *sym) { switch (sym->kind) { case EXTRN: case GLOB: case PRIVAT: case LOCAL: return '$'; case AUTO: case REG: return '%'; default: abort(); } } static void size2asm(Type *tp) { char *s; if (tp->flags & STRF) { abort(); } else { switch (tp->size) { case 1: s = "b\t"; break; case 2: s = "h\t"; break; case 4: s = "w\t"; break; case 8: s = "q\t"; break; default: s = "z\t%llu\t"; break; } } printf(s, (unsigned long long) tp->size); } void defsym(Symbol *sym, int alloc) { if (!alloc) return; if (sym->kind == GLOB) fputs("export ", stdout); printf("data %c%s = {\n", sigil(sym), sym->name); if (sym->type.flags & INITF) return; putchar('\t'); size2asm(&sym->type); puts("0\n}"); } void data(Node *np) { } void writeout(void) { }
#include <stdio.h> #include <stdlib.h> #include "arch.h" #include "../../cc2.h" #include "../../../inc/sizes.h" void defsym(Symbol *sym, int alloc) { } void data(Node *np) { } void writeout(void) { }
--- +++ @@ -6,10 +6,71 @@ #include "../../cc2.h" #include "../../../inc/sizes.h" +/* + * : is for user-defined Aggregate Types + * $ is for globals (represented by a pointer) + * % is for function-scope temporaries + * @ is for block labels + */ +static char +sigil(Symbol *sym) +{ + switch (sym->kind) { + case EXTRN: + case GLOB: + case PRIVAT: + case LOCAL: + return '$'; + case AUTO: + case REG: + return '%'; + default: + abort(); + } +} + +static void +size2asm(Type *tp) +{ + char *s; + + if (tp->flags & STRF) { + abort(); + } else { + switch (tp->size) { + case 1: + s = "b\t"; + break; + case 2: + s = "h\t"; + break; + case 4: + s = "w\t"; + break; + case 8: + s = "q\t"; + break; + default: + s = "z\t%llu\t"; + break; + } + } + printf(s, (unsigned long long) tp->size); +} void defsym(Symbol *sym, int alloc) { + if (!alloc) + return; + if (sym->kind == GLOB) + fputs("export ", stdout); + printf("data %c%s = {\n", sigil(sym), sym->name); + if (sym->type.flags & INITF) + return; + putchar('\t'); + size2asm(&sym->type); + puts("0\n}"); } void
[cc2] Add basic implementation of defsym() This is a first implementation which a limited implementation of sigil() and of size2asm() that, for instance, does not support strings.
isc
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
70a260148ff33185ce8e70b3dbd46a15c0ff5aaf
/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2015 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ #ifndef XENIA_BASE_PLATFORM_X11_H_ #define XENIA_BASE_PLATFORM_X11_H_ // NOTE: if you're including this file it means you are explicitly depending // on Linux headers. Including this file outside of linux platform specific // source code will break portability #include "xenia/base/platform.h" // Xlib/Xcb is used only for GLX/Vulkan interaction, the window management // and input events are done with gtk/gdk #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> #include <xcb/xcb.h> //Used for window management. Gtk is for GUI and wigets, gdk is for lower //level events like key presses, mouse events, etc #include <gtk/gtk.h> #include <gdk/gdk.h> #endif // XENIA_BASE_PLATFORM_X11_H_
/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2015 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ #ifndef XENIA_BASE_PLATFORM_X11_H_ #define XENIA_BASE_PLATFORM_X11_H_ // NOTE: if you're including this file it means you are explicitly depending // on Linux headers. Including this file outside of linux platform specific // source code will break portability #include "xenia/base/platform.h" // Xlib is used only for GLX interaction, the window management and input // events are done with gtk/gdk #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> //Used for window management. Gtk is for GUI and wigets, gdk is for lower //level events like key presses, mouse events, etc #include <gtk/gtk.h> #include <gdk/gdk.h> #endif // XENIA_BASE_PLATFORM_X11_H_
--- +++ @@ -16,11 +16,12 @@ #include "xenia/base/platform.h" -// Xlib is used only for GLX interaction, the window management and input -// events are done with gtk/gdk +// Xlib/Xcb is used only for GLX/Vulkan interaction, the window management +// and input events are done with gtk/gdk #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> +#include <xcb/xcb.h> //Used for window management. Gtk is for GUI and wigets, gdk is for lower //level events like key presses, mouse events, etc
Add xcb headers to linux platform, needed for vulkan
bsd-3-clause
sephiroth99/xenia,sephiroth99/xenia,sephiroth99/xenia
a8053f72e54e41011cad782cb37801dc26af6251
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2005 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.01.05-k3" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 #define QLA_DRIVER_PATCH_VER 5 #define QLA_DRIVER_BETA_VER 0
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2005 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.01.05-k2" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 #define QLA_DRIVER_PATCH_VER 5 #define QLA_DRIVER_BETA_VER 0
--- +++ @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.01.05-k2" +#define QLA2XXX_VERSION "8.01.05-k3" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1
[SCSI] qla2xxx: Update version number to 8.01.05-k3. Signed-off-by: Andrew Vasquez <67840a4977006af7f584bdc4c86d7243c1629cad@qlogic.com> Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@SteelEye.com>
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
76c1534e0bd78e9a7662edcf5c994bac63d939fd
#pragma once #include <pthread.h> #include <stdint.h> namespace neosmart { //Type declarations struct neosmart_event_t_; typedef neosmart_event_t_ * neosmart_event_t; //WIN32-style pevent functions neosmart_event_t CreateEvent(bool manualReset = false, bool initialState = false); int DestroyEvent(neosmart_event_t event); int WaitForEvent(neosmart_event_t event, uint32_t milliseconds = -1); int SetEvent(neosmart_event_t event); int ResetEvent(neosmart_event_t event); //posix-style functions //TBD }
#pragma once #include <pthread.h> #include <stdint.h> namespace neosmart { struct neosmart_event_t_; typedef neosmart_event_t_ * neosmart_event_t; neosmart_event_t CreateEvent(bool manualReset = false, bool initialState = false); int DestroyEvent(neosmart_event_t event); int WaitForEvent(neosmart_event_t event, uint32_t milliseconds = -1); int SetEvent(neosmart_event_t event); int ResetEvent(neosmart_event_t event); }
--- +++ @@ -5,12 +5,17 @@ namespace neosmart { + //Type declarations struct neosmart_event_t_; typedef neosmart_event_t_ * neosmart_event_t; + //WIN32-style pevent functions neosmart_event_t CreateEvent(bool manualReset = false, bool initialState = false); int DestroyEvent(neosmart_event_t event); int WaitForEvent(neosmart_event_t event, uint32_t milliseconds = -1); int SetEvent(neosmart_event_t event); int ResetEvent(neosmart_event_t event); + + //posix-style functions + //TBD }
TBD: Add posix-styled functions for using neosmart_event_t objects
mit
neosmart/pevents,neosmart/pevents
e4edb986c6acfb48e0d95b845bcdca75595f5308
/** * \file inet_ntop * inet_ntop emulation based on inet_ntoa. * \author Matthias Andree * */ #include "config.h" #if !HAVE_INET_NTOP #include "leafnode.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> #include <string.h> const char * inet_ntop(int af, const void *s, char *dst, int x) { switch (af) { case AF_INET: strncpy(dst, inet_ntoa(*(const struct in_addr *)s), x); if (x) dst[x-1] = '\0'; return dst; break; default: errno = EINVAL; return 0; break; } } #endif
/** * \file inet_ntop * inet_ntop emulation based on inet_ntoa. * \author Matthias Andree * */ #include "config.h" #ifndef HAVE_INET_NTOP #include "leafnode.h" #include "mastring.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> #ifdef WITH_DMALLOC #include <dmalloc.h> #endif #include <string.h> const char * inet_ntop(int af, const void *s, char *dst, int x) { switch (af) { case AF_INET: mastrncpy(dst, inet_ntoa(*(const struct in_addr *)s), x); return dst; break; default: errno = EINVAL; return 0; break; } } #endif
--- +++ @@ -5,18 +5,13 @@ * */ #include "config.h" -#ifndef HAVE_INET_NTOP +#if !HAVE_INET_NTOP #include "leafnode.h" -#include "mastring.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> - -#ifdef WITH_DMALLOC -#include <dmalloc.h> -#endif #include <string.h> @@ -25,7 +20,8 @@ { switch (af) { case AF_INET: - mastrncpy(dst, inet_ntoa(*(const struct in_addr *)s), x); + strncpy(dst, inet_ntoa(*(const struct in_addr *)s), x); + if (x) dst[x-1] = '\0'; return dst; break; default:
Drop dmalloc.h, not needed. Drop dmalloc.h, not needed. Use strncpy for portability, we do not want this function to rely on mastring.
lgpl-2.1
BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode
b502a1ea2f1c9735c7af7d67e275532437eb539f
#ifndef BS_CONFIG_PARSER_H #define BS_CONFIG_PARSER_H #include "bs_common.h" #include <map> #include <string> #include <vector> namespace blue_sky { struct wcfg; class BS_API bs_cfg_p { public: friend struct wcfg; typedef std::vector<std::string> vstr_t; typedef std::map<std::string,vstr_t> map_t; void parse_strings (const std::string &str, bool append = false); void read_file (const char *filename); void clear_env_map (); const map_t &env() const; vstr_t getenv(const char *e); vstr_t operator[] (const char *e) { return getenv (e); } private: bs_cfg_p (); map_t env_mp; }; typedef singleton< bs_cfg_p > cfg; struct bs_config { bs_cfg_p::vstr_t operator [] (const char *e) { return cfg::Instance ()[e]; } }; } #endif // BS_CONFIG_PARSER_H
#ifndef BS_CONFIG_PARSER_H #define BS_CONFIG_PARSER_H #include "bs_common.h" #include <map> #include <string> #include <vector> namespace blue_sky { struct wcfg; class BS_API bs_cfg_p { public: friend struct wcfg; typedef std::vector<std::string> vstr_t; typedef std::map<std::string,vstr_t> map_t; void parse_strings (const std::string &str, bool append = false); void read_file (const char *filename); void clear_env_map (); const map_t &env() const; vstr_t getenv(const char *e); private: bs_cfg_p (); map_t env_mp; }; typedef singleton< bs_cfg_p > cfg; } #endif // BS_CONFIG_PARSER_H
--- +++ @@ -24,6 +24,11 @@ const map_t &env() const; vstr_t getenv(const char *e); + vstr_t operator[] (const char *e) + { + return getenv (e); + } + private: bs_cfg_p (); @@ -32,6 +37,14 @@ typedef singleton< bs_cfg_p > cfg; + struct bs_config + { + bs_cfg_p::vstr_t + operator [] (const char *e) + { + return cfg::Instance ()[e]; + } + }; } #endif // BS_CONFIG_PARSER_H
Add bs_config for hide bs_cfg_p::Instance () usage And add operator[] to getenv
mpl-2.0
uentity/bluesky,uentity/bluesky,uentity/bluesky,uentity/bluesky,uentity/bluesky
1a387a296e9988792baa730fd2b0972d98158a68
#include <gtk/gtk.h> static void test_type (GType t) { GtkWidget *w; AtkObject *a; if (g_type_is_a (t, GTK_TYPE_WIDGET)) { w = (GtkWidget *)g_object_new (t, NULL); a = gtk_widget_get_accessible (w); g_assert (GTK_IS_ACCESSIBLE (a)); g_assert (gtk_accessible_get_widget (GTK_ACCESSIBLE (a)) == w); g_object_unref (w); } } int main (int argc, char *argv[]) { const GType *tp; guint i, n; gtk_init (&argc, &argv); tp = gtk_test_list_all_types (&n); for (i = 0; i < n; n++) test_type (tp[i]); return 0; }
#include <gtk/gtk.h> static void test_type (GType t) { GtkWidget *w; AtkObject *a; if (g_type_is_a (t, GTK_TYPE_WIDGET)) { w = (GtkWidget *)g_object_new (t, NULL); a = gtk_widget_get_accessible (w); g_assert (GTK_IS_ACCESSIBLE (a)); g_assert (gtk_accessible_get_widget (GTK_ACCESSIBLE (a)) == w); g_object_unref (w); } } int main (int argc, char *argv[]) { GType *tp; gint i; gtk_init (&argc, &argv); tp = g_new0 (GType, 1000); #undef GDK_WINDOWING_X11 #include "../gtktypefuncs.c" *tp = 0; for (i = 0; tp[i]; i++) test_type (tp[i]); return 0; }
--- +++ @@ -21,17 +21,14 @@ int main (int argc, char *argv[]) { - GType *tp; - gint i; + const GType *tp; + guint i, n; gtk_init (&argc, &argv); - tp = g_new0 (GType, 1000); -#undef GDK_WINDOWING_X11 -#include "../gtktypefuncs.c" - *tp = 0; + tp = gtk_test_list_all_types (&n); - for (i = 0; tp[i]; i++) + for (i = 0; i < n; n++) test_type (tp[i]); return 0;
tests: Use testing API instead of duplicating it
lgpl-2.1
ebassi/gtk,ebassi/gtk,jigpu/gtk,chergert/gtk,ahodesuka/gtk,msteinert/gtk,Lyude/gtk-,bratsche/gtk-,Adamovskiy/gtk,davidgumberg/gtk,davidgumberg/gtk,alexlarsson/gtk,ahodesuka/gtk,msteinert/gtk,bratsche/gtk-,chergert/gtk,Sidnioulz/SandboxGtk,ahodesuka/gtk,jadahl/gtk,Lyude/gtk-,bratsche/gtk-,chergert/gtk,Sidnioulz/SandboxGtk,alexlarsson/gtk,jadahl/gtk,Distrotech/gtk2,jigpu/gtk,jessevdk/gtk,Distrotech/gtk2,Lyude/gtk-,grubersjoe/adwaita,grubersjoe/adwaita,jigpu/gtk,bratsche/gtk-,jadahl/gtk,alexlarsson/gtk,grubersjoe/adwaita,Sidnioulz/SandboxGtk,Adamovskiy/gtk,davidgumberg/gtk,alexlarsson/gtk,Lyude/gtk-,jigpu/gtk,davidgumberg/gtk,Sidnioulz/SandboxGtk,jessevdk/gtk,ahodesuka/gtk,jessevdk/gtk,grubersjoe/adwaita,alexlarsson/gtk,Lyude/gtk-,jigpu/gtk,ebassi/gtk,bratsche/gtk-,ebassi/gtk,Sidnioulz/SandboxGtk,chergert/gtk,jessevdk/gtk,chergert/gtk,chergert/gtk,jessevdk/gtk,jigpu/gtk,jadahl/gtk,alexlarsson/gtk,Adamovskiy/gtk,Sidnioulz/SandboxGtk,Distrotech/gtk2,chergert/gtk,msteinert/gtk,grubersjoe/adwaita,ebassi/gtk,Lyude/gtk-,Adamovskiy/gtk,Distrotech/gtk2,ebassi/gtk,Lyude/gtk-,jadahl/gtk,Distrotech/gtk2,Adamovskiy/gtk,msteinert/gtk,jigpu/gtk,davidgumberg/gtk,bratsche/gtk-,Adamovskiy/gtk,jessevdk/gtk,ahodesuka/gtk,msteinert/gtk,grubersjoe/adwaita,ahodesuka/gtk,alexlarsson/gtk,alexlarsson/gtk,jadahl/gtk,Lyude/gtk-,grubersjoe/adwaita,davidgumberg/gtk,jadahl/gtk,Distrotech/gtk2,msteinert/gtk,Adamovskiy/gtk,jigpu/gtk,jadahl/gtk,davidgumberg/gtk,grubersjoe/adwaita,davidgumberg/gtk,ahodesuka/gtk,chergert/gtk,jessevdk/gtk,Adamovskiy/gtk,ahodesuka/gtk
06a8fac3e909e7df4bd888cbb76964479ae80abc
/* * This file is part of the FreeStreamer project, * (C)Copyright 2011-2015 Matias Muhonen <mmu@iki.fi> * See the file ''LICENSE'' for using the code. * * https://github.com/muhku/FreeStreamer */ #import <UIKit/UIKit.h> #include "FSFrequencyDomainAnalyzer.h" #define kFSFrequencyPlotViewMaxCount 64 @interface FSFrequencyPlotView : UIView <FSFrequencyDomainAnalyzerDelegate> { float _levels[kFSFrequencyPlotViewMaxCount]; NSUInteger _count; BOOL _drawing; } - (void)frequenceAnalyzer:(FSFrequencyDomainAnalyzer *)analyzer levelsAvailable:(float *)levels count:(NSUInteger)count; - (void)reset; @end
/* * This file is part of the FreeStreamer project, * (C)Copyright 2011-2015 Matias Muhonen <mmu@iki.fi> * See the file ''LICENSE'' for using the code. * * https://github.com/muhku/FreeStreamer */ #include "FSFrequencyDomainAnalyzer.h" #define kFSFrequencyPlotViewMaxCount 64 @interface FSFrequencyPlotView : UIView <FSFrequencyDomainAnalyzerDelegate> { float _levels[kFSFrequencyPlotViewMaxCount]; NSUInteger _count; BOOL _drawing; } - (void)frequenceAnalyzer:(FSFrequencyDomainAnalyzer *)analyzer levelsAvailable:(float *)levels count:(NSUInteger)count; - (void)reset; @end
--- +++ @@ -5,6 +5,8 @@ * * https://github.com/muhku/FreeStreamer */ + +#import <UIKit/UIKit.h> #include "FSFrequencyDomainAnalyzer.h"
Add a missing UIKit import.
bsd-3-clause
mjasa/FreeStreamer,christophercotton/FreeStreamer,alecgorge/FreeStreamer,alecgorge/FreeStreamer,mjasa/FreeStreamer,christophercotton/FreeStreamer,ren6/FreeStreamer,zdw19840929/FreeStreamer,christophercotton/FreeStreamer,zdw19840929/FreeStreamer,zdw19840929/FreeStreamer,ren6/FreeStreamer,mjasa/FreeStreamer,nKey/FreeStreamer,nKey/FreeStreamer,nKey/FreeStreamer,alecgorge/FreeStreamer,ren6/FreeStreamer
bb7aa6ace39ad6ce1e71f9f177441a6744814855
#include "kremlib.h" #include "kremstr.h" /******************************************************************************/ /* Implementation of FStar.String and FStar.HyperIO */ /******************************************************************************/ /* FStar.h is generally kept for the program we wish to compile, meaning that * FStar.h contains extern declarations for the functions below. This provides * their implementation, and since the function prototypes are already in * FStar.h, we don't need to put these in the header, they will be resolved at * link-time. */ Prims_nat FStar_String_strlen(Prims_string s) { return strlen(s); } Prims_string FStar_String_strcat(Prims_string s0, Prims_string s1) { char *dest = calloc(strlen(s0) + strlen(s1) + 1, 1); strcat(dest, s0); strcat(dest, s1); return (Prims_string)dest; } Prims_string Prims_strcat(Prims_string s0, Prims_string s1) { return FStar_String_strcat(s0, s1); } void FStar_HyperStack_IO_print_string(Prims_string s) { printf("%s", s); } void FStar_IO_debug_print_string(Prims_string s) { printf("%s", s); } bool __eq__Prims_string(Prims_string s1, Prims_string s2) { return (strcmp(s1, s2) == 0); }
#include "kremlib.h" #include "kremstr.h" /******************************************************************************/ /* Implementation of FStar.String and FStar.HyperIO */ /******************************************************************************/ /* FStar.h is generally kept for the program we wish to compile, meaning that * FStar.h contains extern declarations for the functions below. This provides * their implementation, and since the function prototypes are already in * FStar.h, we don't need to put these in the header, they will be resolved at * link-time. */ Prims_nat FStar_String_strlen(Prims_string s) { return strlen(s); } Prims_string FStar_String_strcat(Prims_string s0, Prims_string s1) { char *dest = calloc(strlen(s0) + strlen(s1) + 1, 1); strcat(dest, s0); strcat(dest, s1); return (Prims_string)dest; } Prims_string Prims_strcat(Prims_string s0, Prims_string s1) { return FStar_String_strcat(s0, s1); } void FStar_IO_debug_print_string(Prims_string s) { printf("%s", s); } bool __eq__Prims_string(Prims_string s1, Prims_string s2) { return (strcmp(s1, s2) == 0); }
--- +++ @@ -26,6 +26,10 @@ return FStar_String_strcat(s0, s1); } +void FStar_HyperStack_IO_print_string(Prims_string s) { + printf("%s", s); +} + void FStar_IO_debug_print_string(Prims_string s) { printf("%s", s); }
Revert "Try to catch up on upstream F* changes" This reverts commit 5b09f1f43b155df40caa8d8716075ccd7d08af26.
apache-2.0
FStarLang/kremlin,FStarLang/kremlin,FStarLang/kremlin,FStarLang/kremlin
2d6cf0686fb211408a6f5ed96ac5341f1c486aaa