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
#include "syshead.h" #include "skbuff.h" struct sk_buff *alloc_skb(unsigned int size) { struct sk_buff *skb = malloc(sizeof(struct sk_buff)); memset(skb, 0, sizeof(struct sk_buff)); skb->data = malloc(size); memset(skb->data, 0, size); skb->head = skb->data; skb->tail = skb->data; skb->end = skb->tail + size; return skb; } void free_skb(struct sk_buff *skb) { free(skb->head); free(skb); } void *skb_reserve(struct sk_buff *skb, unsigned int len) { skb->data += len; skb->tail += len; return skb->data; } uint8_t *skb_push(struct sk_buff *skb, unsigned int len) { skb->data -= len; skb->len += len; return skb->data; } void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) { skb->dst = dst; } uint8_t *skb_head(struct sk_buff *skb) { return skb->head; }
#include "syshead.h" #include "skbuff.h" struct sk_buff *alloc_skb(unsigned int size) { struct sk_buff *skb = malloc(sizeof(struct sk_buff)); memset(skb, 0, sizeof(struct sk_buff)); skb->data = malloc(size); memset(skb->data, 0, size); skb->head = skb->data; skb->tail = skb->data; skb->end = skb->tail + size; return skb; } void free_skb(struct sk_buff *skb) { free(skb->data); free(skb); } void *skb_reserve(struct sk_buff *skb, unsigned int len) { skb->data += len; skb->tail += len; return skb->data; } uint8_t *skb_push(struct sk_buff *skb, unsigned int len) { skb->data -= len; skb->len += len; return skb->data; } void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) { skb->dst = dst; } uint8_t *skb_head(struct sk_buff *skb) { return skb->head; }
--- +++ @@ -18,7 +18,7 @@ void free_skb(struct sk_buff *skb) { - free(skb->data); + free(skb->head); free(skb); }
Fix pointer in skb free routine You cannot pass a different memory location to malloc than what it was originally allocated with :p
mit
saminiir/level-ip,saminiir/level-ip
14dd5b240b3b619889aef85184704448c1b05dba
# ifndef COMMONPARAMS_H # define COMMONPARAMS_H struct CommonParams{ int nx,ny,nz; int NX,NY,NZ; int rank; int np; int nbrL; int nbrR; int xOff; int iskip; int jskip; int kskip; int nstep; int numOutputs; double dx,dy,dz; double LX,LY,LZ; double dt; }; # endif // COMMONPARAMS_H
# ifndef COMMONPARAMS_H # define COMMONPARAMS_H struct CommonParams{ int nx,ny,nz; int NX,NY,NZ; int rank; int np; int xOff; int iskip; int jskip; int kskip; int nstep; int numOutputs; double dx,dy,dz; double LX,LY,LZ; double dt; }; # endif // COMMONPARAMS_H
--- +++ @@ -8,6 +8,8 @@ int NX,NY,NZ; int rank; int np; + int nbrL; + int nbrR; int xOff; int iskip; int jskip;
Add SfieldFD class and TIPS3 and TIPS4 classes to phase_field app
mit
paulmillett/meso
dae8629cff132d3abd5ae83852380b568fbf654a
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H /* Numeric release version identifier: * MMNNFFRBB: major minor fix final beta/patch * For example: * 0.9.3-dev 0x00903000 * 0.9.3beta1 0x00903001 * 0.9.3 0x00903100 * 0.9.3a 0x00903101 * 1.2.3z 0x1020311a */ #define OPENSSL_VERSION_NUMBER 0x00903000L #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.3-dev 19 May 1999" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H #define OPENSSL_VERSION_NUMBER 0x0923 /* Version 0.9.1c is 0913 */ #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.2c 01 Apr 1999" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
--- +++ @@ -1,8 +1,17 @@ #ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H -#define OPENSSL_VERSION_NUMBER 0x0923 /* Version 0.9.1c is 0913 */ -#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.2c 01 Apr 1999" +/* Numeric release version identifier: + * MMNNFFRBB: major minor fix final beta/patch + * For example: + * 0.9.3-dev 0x00903000 + * 0.9.3beta1 0x00903001 + * 0.9.3 0x00903100 + * 0.9.3a 0x00903101 + * 1.2.3z 0x1020311a + */ +#define OPENSSL_VERSION_NUMBER 0x00903000L +#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.3-dev 19 May 1999" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
Switch to new version numbering scheme.
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
e90c7729467108ffd6f813ade011c7ec5ced9680
#include <stdlib.h> #include <mqtt3.h> mqtt3_context *mqtt3_context_init(int sock) { mqtt3_context *context; context = malloc(sizeof(mqtt3_context)); if(!context) return NULL; context->next = NULL; context->sock = sock; context->last_msg_in = time(NULL); context->last_msg_out = time(NULL); context->keepalive = 60; /* Default to 60s */ context->last_mid = 0; context->id = NULL; context->messages = NULL; return context; } void mqtt3_context_cleanup(mqtt3_context *context) { if(!context) return; if(context->sock != -1){ mqtt3_socket_close(context); } if(context->clean_start){ mqtt3_db_subs_clean_start(context); mqtt3_db_client_delete(context); } if(context->id) free(context->id); /* FIXME - clean messages and subscriptions */ free(context); }
#include <stdlib.h> #include <mqtt3.h> mqtt3_context *mqtt3_context_init(int sock) { mqtt3_context *context; context = malloc(sizeof(mqtt3_context)); if(!context) return NULL; context->next = NULL; context->sock = sock; context->last_msg_in = time(NULL); context->last_msg_out = time(NULL); context->keepalive = 60; /* Default to 60s */ context->last_mid = 0; context->id = NULL; context->messages = NULL; return context; } void mqtt3_context_cleanup(mqtt3_context *context) { if(!context) return; if(context->sock != -1){ mqtt3_socket_close(context); } if(context->id) free(context->id); /* FIXME - clean messages and subscriptions */ free(context); }
--- +++ @@ -28,6 +28,10 @@ if(context->sock != -1){ mqtt3_socket_close(context); } + if(context->clean_start){ + mqtt3_db_subs_clean_start(context); + mqtt3_db_client_delete(context); + } if(context->id) free(context->id); /* FIXME - clean messages and subscriptions */ free(context);
Delete client info / subscription info on disconnect for clean_start == true.
bsd-3-clause
zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto
5d55abcfb068c87366329eae8f0502781145b57d
/* * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #import <UIKit/UIKit.h> #import <ComponentKit/CKComponentRootView.h> typedef UIView *(^CKComponentRootViewHitTestHook)(UIView *rootView, CGPoint point, UIEvent *event); @interface CKComponentRootView () /** Exposes the ability to supplement the hitTest for the root view used in each CKComponentHostingView or UICollectionViewCell within a CKCollectionViewDataSource. Each hook will be called in the order they were registered. If any hook returns a view, that will override the return value of the view's -hitTest:withEvent:. If no hook returns a view, then the super implementation will be invoked. */ + (void)addHitTestHook:(CKComponentRootViewHitTestHook)hook; /** Returns an array of all registered hit test hooks. */ + (NSArray *)hitTestHooks; @end
/* * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #import <UIKit/UIKit.h> typedef UIView *(^CKComponentRootViewHitTestHook)(CKComponentRootView *rootView, CGPoint point, UIEvent *event); @interface CKComponentRootView () /** Exposes the ability to supplement the hitTest for the root view used in each CKComponentHostingView or UICollectionViewCell within a CKCollectionViewDataSource. Each hook will be called in the order they were registered. If any hook returns a view, that will override the return value of the view's -hitTest:withEvent:. If no hook returns a view, then the super implementation will be invoked. */ + (void)addHitTestHook:(CKComponentRootViewHitTestHook)hook; /** Returns an array of all registered hit test hooks. */ + (NSArray *)hitTestHooks; @end
--- +++ @@ -10,7 +10,9 @@ #import <UIKit/UIKit.h> -typedef UIView *(^CKComponentRootViewHitTestHook)(CKComponentRootView *rootView, CGPoint point, UIEvent *event); +#import <ComponentKit/CKComponentRootView.h> + +typedef UIView *(^CKComponentRootViewHitTestHook)(UIView *rootView, CGPoint point, UIEvent *event); @interface CKComponentRootView ()
Change type of view passed to hit test hooks If we want to support non-CKComponentRootViews that use these hooks, it has to be a generic UIView.
bsd-3-clause
ezc/componentkit,dshahidehpour/componentkit,avnerbarr/componentkit,dstnbrkr/componentkit,SummerHanada/componentkit,mcohnen/componentkit,adamdahan/componentkit,pairyo/componentkit,mcohnen/componentkit,stevielu/componentkit,avnerbarr/componentkit,inbilin-inc/componentkit,lydonchandra/componentkit,liyong03/componentkit,adamdahan/componentkit,inbilin-inc/componentkit,Jericho25/componentkit_JeckoHero,claricetechnologies/componentkit,adamjernst/componentkit,claricetechnologies/componentkit,mcohnen/componentkit,yiding/componentkit,stevielu/componentkit,eczarny/componentkit,IveWong/componentkit,aaronschubert0/componentkit,modocache/componentkit,21451061/componentkit,ezc/componentkit,TribeMedia/componentkit,MDSilber/componentkit,wee/componentkit,MDSilber/componentkit,stevielu/componentkit,IveWong/componentkit,Eric-LeiYang/componentkit,eczarny/componentkit,ezc/componentkit,yiding/componentkit,ezc/componentkit,dstnbrkr/componentkit,TribeMedia/componentkit,leoschweizer/componentkit,dshahidehpour/componentkit,Eric-LeiYang/componentkit,Jericho25/componentkit_JeckoHero,yiding/componentkit,pairyo/componentkit,darknoon/componentkitx,21451061/componentkit,darknoon/componentkitx,wee/componentkit,modocache/componentkit,modocache/componentkit,smalllixin/componentkit,modocache/componentkit,eczarny/componentkit,stevielu/componentkit,TribeMedia/componentkit,aaronschubert0/componentkit,pairyo/componentkit,yiding/componentkit,dshahidehpour/componentkit,leoschweizer/componentkit,MDSilber/componentkit,aaronschubert0/componentkit,darknoon/componentkitx,21451061/componentkit,dstnbrkr/componentkit,Jericho25/componentkit_JeckoHero,lydonchandra/componentkit,claricetechnologies/componentkit,MDSilber/componentkit,lydonchandra/componentkit,SummerHanada/componentkit,liyong03/componentkit,leoschweizer/componentkit,bricooke/componentkit,inbilin-inc/componentkit,bricooke/componentkit,liyong03/componentkit,IveWong/componentkit,adamdahan/componentkit,avnerbarr/componentkit,SummerHanada/componentkit,Jericho25/componentkit_JeckoHero,pairyo/componentkit,lydonchandra/componentkit,21451061/componentkit,ernestopino/componentkit,ernestopino/componentkit,aaronschubert0/componentkit,wee/componentkit,dstnbrkr/componentkit,mcohnen/componentkit,SummerHanada/componentkit,ernestopino/componentkit,smalllixin/componentkit,leoschweizer/componentkit,adamdahan/componentkit,smalllixin/componentkit,ernestopino/componentkit,liyong03/componentkit,claricetechnologies/componentkit,Eric-LeiYang/componentkit,bricooke/componentkit,adamjernst/componentkit,smalllixin/componentkit,IveWong/componentkit,avnerbarr/componentkit,adamjernst/componentkit,wee/componentkit,inbilin-inc/componentkit,darknoon/componentkitx,adamjernst/componentkit,TribeMedia/componentkit,bricooke/componentkit,Eric-LeiYang/componentkit
1e8ee5c91c4f254e5247f1c50bc4eb5e0edb09a6
// PARAM: --enable ana.int.interval #include <stdlib.h> #include <assert.h> int main() { unsigned long ul; if (ul <= 0UL) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } if (ul > 0UL) { __goblint_check(ul != 0UL); } else { __goblint_check(ul == 0UL); } if (! (ul > 0UL)) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } unsigned int iu; if (iu <= 0UL) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } if (iu > 0UL) { __goblint_check(iu != 0UL); } else { __goblint_check(iu == 0UL); } if (! (iu > 0UL)) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } int i; if (! (i > 0)) { } else { __goblint_check(i != 0); } return 0; }
// PARAM: --enable ana.int.interval #include <stdlib.h> #include <assert.h> int main() { unsigned long ul; if (ul <= 0UL) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } if (ul > 0UL) { __goblint_check(ul != 0UL); } else { __goblint_check(ul == 0UL); } if (! (ul > 0UL)) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } unsigned int iu; if (iu <= 0UL) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } if (iu > 0UL) { __goblint_check(iu != 0UL); } else { __goblint_check(iu == 0UL); } if (! (iu > 0UL)) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } int i; if (! (i > 0)) { } else { __goblint_check(i != 0); } return 0; }
--- +++ @@ -22,7 +22,7 @@ } else { __goblint_check(ul != 0UL); } - + unsigned int iu; if (iu <= 0UL) { __goblint_check(iu == 0UL); @@ -45,7 +45,7 @@ int i; if (! (i > 0)) { - + } else { __goblint_check(i != 0); }
Remove trailing spaces in test case.
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
732d189a86d86f281a8b779dce4e28365624f918
/** * @file * * @date Jul 18, 2013 * @author: Anton Bondarev */ #include <kernel/task.h> #include <kernel/thread.h> #include <err.h> #include <kernel/thread/thread_alloc.h> #include <hal/arch.h> /*only for arch_idle */ #include <hal/cpu.h> #include <kernel/cpu/cpu.h> /* * Function, which does nothing. For idle_thread. */ static void *idle_run(void *arg) { while (true) { arch_idle(); } return NULL; } struct thread *idle_thread_create(void) { struct thread *t; t = thread_create(THREAD_FLAG_NOTASK | THREAD_FLAG_SUSPENDED, idle_run, NULL); if(err(t)) { return NULL; } t->task = task_kernel_task(); t->task->main_thread = t; thread_priority_init(t, SCHED_PRIORITY_MIN); cpu_init(cpu_get_id(), t); return t; }
/** * @file * * @date Jul 18, 2013 * @author: Anton Bondarev */ #include <kernel/task.h> #include <kernel/thread.h> #include <kernel/thread/thread_alloc.h> #include <hal/arch.h> /*only for arch_idle */ #include <hal/cpu.h> #include <kernel/cpu/cpu.h> /* * Function, which does nothing. For idle_thread. */ static void *idle_run(void *arg) { while (true) { arch_idle(); } return NULL; } struct thread *idle_thread_create(void) { struct thread *t; sched_priority_t prior; if (!(t = thread_alloc())) { return NULL; } thread_init(t, THREAD_FLAG_NOTASK | THREAD_FLAG_SUSPENDED, idle_run, NULL); t->task = task_kernel_task(); t->task->main_thread = t; prior = sched_priority_full(t->task->priority, THREAD_PRIORITY_MIN); thread_priority_set(t, prior); cpu_init(cpu_get_id(), t); return t; }
--- +++ @@ -7,6 +7,7 @@ #include <kernel/task.h> #include <kernel/thread.h> +#include <err.h> #include <kernel/thread/thread_alloc.h> #include <hal/arch.h> /*only for arch_idle */ @@ -27,20 +28,18 @@ struct thread *idle_thread_create(void) { struct thread *t; - sched_priority_t prior; - if (!(t = thread_alloc())) { + t = thread_create(THREAD_FLAG_NOTASK | THREAD_FLAG_SUSPENDED, idle_run, + NULL); + + if(err(t)) { return NULL; } - - thread_init(t, THREAD_FLAG_NOTASK | THREAD_FLAG_SUSPENDED, idle_run, NULL); t->task = task_kernel_task(); t->task->main_thread = t; - prior = sched_priority_full(t->task->priority, THREAD_PRIORITY_MIN); - - thread_priority_set(t, prior); + thread_priority_init(t, SCHED_PRIORITY_MIN); cpu_init(cpu_get_id(), t);
thread: Rework idle thread a little
bsd-2-clause
embox/embox,Kefir0192/embox,Kefir0192/embox,abusalimov/embox,Kefir0192/embox,Kakadu/embox,Kakadu/embox,mike2390/embox,Kakadu/embox,mike2390/embox,embox/embox,embox/embox,embox/embox,vrxfile/embox-trik,Kefir0192/embox,mike2390/embox,abusalimov/embox,embox/embox,gzoom13/embox,Kefir0192/embox,vrxfile/embox-trik,mike2390/embox,vrxfile/embox-trik,embox/embox,Kefir0192/embox,Kakadu/embox,abusalimov/embox,Kakadu/embox,gzoom13/embox,mike2390/embox,vrxfile/embox-trik,gzoom13/embox,gzoom13/embox,vrxfile/embox-trik,Kefir0192/embox,abusalimov/embox,gzoom13/embox,gzoom13/embox,Kakadu/embox,vrxfile/embox-trik,mike2390/embox,gzoom13/embox,vrxfile/embox-trik,Kakadu/embox,abusalimov/embox,abusalimov/embox,mike2390/embox
c06d2e9315ecd8c1cda65aab7a2f024fd540c8ae
#ifndef ENGPAR_SIDES_H #define ENGPAR_SIDES_H #include <ngraph.h> #include <PCU.h> #include "engpar_container.h" #include <engpar_metrics.h> #include "engpar_diffusive_input.h" namespace engpar { class Sides : public Container<int> { public: Sides(agi::Ngraph* g, agi::etype t) { agi::Ngraph* graph = g; agi::GraphEdge* edge; agi::EdgeIterator* eitr = graph->begin(t); while ((edge = graph->iterate(eitr))) { agi::Peers res; g->getResidence(edge,res); if (res.size()>1) { agi::Peers::iterator itr; for (itr=res.begin();itr!=res.end();itr++) { if (*itr != PCU_Comm_Self()) { (*this)[*itr]+=g->weight(edge); } } my_total+= g->weight(edge); } } g->destroy(eitr); } }; Sides* makeSides(DiffusiveInput* in); Sides* makeSides(agi::Ngraph* g, agi::etype t); } #endif
#ifndef ENGPAR_SIDES_H #define ENGPAR_SIDES_H #include <ngraph.h> #include <PCU.h> #include "engpar_container.h" #include <engpar_metrics.h> #include "engpar_diffusive_input.h" namespace engpar { class Sides : public Container<int> { public: Sides(agi::Ngraph* g, agi::etype t) { agi::Ngraph* graph = g; agi::GraphEdge* edge; agi::EdgeIterator* eitr = graph->begin(t); while ((edge = graph->iterate(eitr))) { agi::Peers res; g->getResidence(edge,res); if (res.size()>1) { agi::Peers::iterator itr; for (itr=res.begin();itr!=res.end();itr++) { if (*itr!=PCU_Comm_Self()) { increment2(*itr); } } my_total++; } } g->destroy(eitr); } }; Sides* makeSides(DiffusiveInput* in); Sides* makeSides(agi::Ngraph* g, agi::etype t); } #endif
--- +++ @@ -20,11 +20,11 @@ if (res.size()>1) { agi::Peers::iterator itr; for (itr=res.begin();itr!=res.end();itr++) { - if (*itr!=PCU_Comm_Self()) { - increment2(*itr); + if (*itr != PCU_Comm_Self()) { + (*this)[*itr]+=g->weight(edge); } } - my_total++; + my_total+= g->weight(edge); } } g->destroy(eitr);
Add edge weights to side calculations
bsd-3-clause
SCOREC/EnGPar,SCOREC/EnGPar,SCOREC/EnGPar
947bb5ff14287bac17e03a6de4998384a6b72afe
#include <stdio.h> #include "aes.h" static void aes_encrypt_block_openssl(const unsigned char *, unsigned char *, const AES_KEY *); static void aes_encrypt_block_aesni(const unsigned char *, unsigned char *, const AES_KEY *); int use_aesni() { return 0; } void aes_encrypt_block(const unsigned char *in, unsigned char *out, const AES_KEY *key) { static int aesni; if (aesni == 0) { aesni = use_aesni(); } if (aesni == 1) { aes_encrypt_block_aesni(in, out, key); } else { aes_encrypt_block_openssl(in, out, key); } } static void aes_encrypt_block_openssl(const unsigned char *in, unsigned char *out, const AES_KEY *key) { AES_encrypt(in, out, key); } static void aes_encrypt_block_aesni(const unsigned char *in, unsigned char *out, const AES_KEY *key) { AES_encrypt(in, out, key); }
#include <stdio.h> #include "aes.h" static void aes_encrypt_block_openssl(const unsigned char *, unsigned char *, const AES_KEY *); static void aes_encrypt_block_aesni(const unsigned char *, unsigned char *, const AES_KEY *); int use_aesni() { return 0; } void aes_encrypt_block(const unsigned char *in, unsigned char *out, const AES_KEY *key) { if (use_aesni()) { aes_encrypt_block_aesni(in, out, key); } else { aes_encrypt_block_openssl(in, out, key); } } static void aes_encrypt_block_openssl(const unsigned char *in, unsigned char *out, const AES_KEY *key) { AES_encrypt(in, out, key); } static void aes_encrypt_block_aesni(const unsigned char *in, unsigned char *out, const AES_KEY *key) { AES_encrypt(in, out, key); }
--- +++ @@ -14,7 +14,14 @@ void aes_encrypt_block(const unsigned char *in, unsigned char *out, const AES_KEY *key) { - if (use_aesni()) + static int aesni; + + if (aesni == 0) + { + aesni = use_aesni(); + } + + if (aesni == 1) { aes_encrypt_block_aesni(in, out, key); }
Use a static variable to track whether to use AES-NI
bsd-2-clause
seankelly/aesni,seankelly/aesni
f969a9b919fb9765c8f955ab2c68284c41abb097
/* * * Copyright 2017 Asylo authors * * 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 ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif inline uint16_t bswap_16(uint16_t n) { return __builtin_bswap16(n); } inline uint32_t bswap_32(uint32_t n) { return __builtin_bswap32(n); } inline uint64_t bswap_64(uint64_t n) { return __builtin_bswap64(n); } #ifdef __cplusplus } #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_
/* * * Copyright 2017 Asylo authors * * 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 ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif inline uint16_t bswap_16(const uint16_t &n) { return __builtin_bswap16(n); } inline uint32_t bswap_32(const uint32_t &n) { return __builtin_bswap32(n); } inline uint64_t bswap_64(const uint64_t &n) { return __builtin_bswap64(n); } #ifdef __cplusplus } #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_
--- +++ @@ -26,11 +26,11 @@ extern "C" { #endif -inline uint16_t bswap_16(const uint16_t &n) { return __builtin_bswap16(n); } +inline uint16_t bswap_16(uint16_t n) { return __builtin_bswap16(n); } -inline uint32_t bswap_32(const uint32_t &n) { return __builtin_bswap32(n); } +inline uint32_t bswap_32(uint32_t n) { return __builtin_bswap32(n); } -inline uint64_t bswap_64(const uint64_t &n) { return __builtin_bswap64(n); } +inline uint64_t bswap_64(uint64_t n) { return __builtin_bswap64(n); } #ifdef __cplusplus }
Remove pass by reference in bswap functions This is a simple bug fix to make these functions compatible with C instead of only with C++. PiperOrigin-RevId: 205919772
apache-2.0
google/asylo,google/asylo,google/asylo,google/asylo,google/asylo,google/asylo
fdb4244b9caf7c1d3b06912796e4a87f583ed1fa
// // BotKit.h // BotKit // // Created by Mark Adams on 9/28/12. // Copyright (c) 2012 thoughtbot. All rights reserved. // #import "BKCoreDataManager.h" #import "BKManagedViewController.h" #import "BKManagedTableViewController.h" #import "NSObject+BKCoding.h" #import "NSArray+ObjectAccess.h" #import "NSDate+RelativeDates.h" #import "UIColor+AdjustColor.h" #import "UIColor+Serialization.h" #import "NSArray+Filtering.h" /* TODOS: BKImageLoader -imageWithContentsOfURL:completionHandler: -imageWithContentsOFURLPath:completionHandler: UIImage: +imageWithContentsOfURLPath: NSArray: -filteredArrayWhereKeys:matchValue:withMethod: -filteredArrayWhereKeys:containValue:caseInsensitive:diacritical: NSURLRequest: +requestWithString: +requestWithURL: NSDate: -dateStringWithFormat: -dateStringWithStyle: */
// // BotKit.h // BotKit // // Created by Mark Adams on 9/28/12. // Copyright (c) 2012 thoughtbot. All rights reserved. // #import "BKCoreDataManager.h" #import "BKManagedViewController.h" #import "BKManagedTableViewController.h" #import "NSObject+Coding.h" #import "NSArray+ObjectAccess.h" #import "NSDate+RelativeDates.h" #import "UIColor+AdjustColor.h" #import "UIColor+Serialization.h" #import "NSArray+Filtering.h" /* TODOS: BKImageLoader -imageWithContentsOfURL:completionHandler: -imageWithContentsOFURLPath:completionHandler: UIImage: +imageWithContentsOfURLPath: NSArray: -filteredArrayWhereKeys:matchValue:withMethod: -filteredArrayWhereKeys:containValue:caseInsensitive:diacritical: NSURLRequest: +requestWithString: +requestWithURL: NSDate: -dateStringWithFormat: -dateStringWithStyle: */
--- +++ @@ -9,7 +9,7 @@ #import "BKCoreDataManager.h" #import "BKManagedViewController.h" #import "BKManagedTableViewController.h" -#import "NSObject+Coding.h" +#import "NSObject+BKCoding.h" #import "NSArray+ObjectAccess.h" #import "NSDate+RelativeDates.h" #import "UIColor+AdjustColor.h"
Fix reference to BKCoding category
mit
thoughtbot/BotKit,thoughtbot/BotKit
e6f3a0156453cfd376e90f50ee93acfda2b03e9e
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "amath.h" #define BUF_SIZE 1024 int main(int argc, char *argv[]) { char buffer[BUF_SIZE]; char *content = ""; while (fgets(buffer, BUF_SIZE, stdin)) asprintf(&content, "%s%s", content, buffer); char *result = amath_to_mathml(content); printf("<math xmlns=\"http://www.w3.org/1998/Math/MathML\">%s</math>", result); if (strlen(result) > 0) free(result); if (strlen(content) > 0) free(content); }
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "amath.h" #define BUF_SIZE 1024 int main(int argc, char *argv[]) { char buffer[BUF_SIZE]; char *content = ""; while (fgets(buffer, BUF_SIZE, stdin)) asprintf(&content, "%s%s", content, buffer); char *result = amath_to_mathml(content); printf("<math>%s</math>", result); if (strlen(result) > 0) free(result); if (strlen(content) > 0) free(content); }
--- +++ @@ -14,7 +14,7 @@ asprintf(&content, "%s%s", content, buffer); char *result = amath_to_mathml(content); - printf("<math>%s</math>", result); + printf("<math xmlns=\"http://www.w3.org/1998/Math/MathML\">%s</math>", result); if (strlen(result) > 0) free(result); if (strlen(content) > 0) free(content);
Add XML namespace to math element The MathML XML namespace isn't needed in context of HTML5 (and I find it a bit verbose), but are used in other applications, e.g. LibreOffice's "Import MathML from Clipboard". Probably should be an command line argument.
isc
camoy/amath,camoy/amath,camoy/amath
3057d837d3f50cd1651540e71ff6bbfbb06be9e2
#include "riot_arduino_uno.h" #include "utils.h" riot_arduino_uno_sinks* riot_arduino_uno_sinks_create() { riot_arduino_uno_sinks *sinks = xmalloc(sizeof(riot_arduino_uno_sinks)); return sinks; } riot_arduino_uno_sources* riot_arduino_uno_sources_create() { riot_arduino_uno_sources *sources = xmalloc(sizeof(riot_arduino_uno_sources)); return sources; }; int riot_arduino_uno_run(riot_arduino_uno_main main) { if(main == NULL) { return -1; } riot_arduino_uno_sources *sources = riot_arduino_uno_sources_create(); if(sources == NULL) { return -2; } riot_arduino_uno_sinks *sinks = main(sources); if(sinks == NULL) { return -3; } while(true) { // TODO: Read all inputs and map to sources // TODO: If all sinks/outputs have completed, break } return 0; }
#include "riot_arduino_uno.h" #include "utils.h" riot_arduino_uno_sinks* riot_arduino_uno_sinks_create() { riot_arduino_uno_sinks *sinks = xmalloc(sizeof(riot_arduino_uno_sinks)); return sinks; } riot_arduino_uno_sources* riot_arduino_uno_sources_create() { riot_arduino_uno_sources *sources = xmalloc(sizeof(riot_arduino_uno_sources)); return sources; };
--- +++ @@ -10,3 +10,22 @@ riot_arduino_uno_sources *sources = xmalloc(sizeof(riot_arduino_uno_sources)); return sources; }; + +int riot_arduino_uno_run(riot_arduino_uno_main main) { + if(main == NULL) { + return -1; + } + riot_arduino_uno_sources *sources = riot_arduino_uno_sources_create(); + if(sources == NULL) { + return -2; + } + riot_arduino_uno_sinks *sinks = main(sources); + if(sinks == NULL) { + return -3; + } + while(true) { + // TODO: Read all inputs and map to sources + // TODO: If all sinks/outputs have completed, break + } + return 0; +}
Add basic riot_run function definition
mit
artfuldev/RIoT
b70c1ec7f3a81a044b1e42c0f25b8d083810a177
// // lineart.h // LineArt // // Created by Allek Mott on 10/1/15. // Copyright © 2015 Loop404. All rights reserved. // #ifndef lineart_h #define lineart_h #include <stdio.h> #define MAX_LINE_LENGTH 200 // data structure for line // (x1, y1) = inital point // (x2, y2) = final point struct line { int x1; int y1; int x2; int y2; }; // data structure for point (x, y) struct point { int x; int y; }; // data structure for node // in linked list of lines struct node { struct line *line; struct node *next; }; // Generate displacement value for new line int genDifference(); // Easy line resetting/initialization void easyLine(struct line *l, int x1, int y1, int x2, int y2); // Calculates midpoint of line l, // stores in point p void getMidpoint(struct line *l, struct point *p); // Generate next line in sequence void genNextLine(struct line *previous, struct line *current, int lineNo); void freeLineNode(struct node *node); void freeLineList(struct node *root); #endif /* lineart_h */
// // lineart.h // LineArt // // Created by Allek Mott on 10/1/15. // Copyright © 2015 Loop404. All rights reserved. // #ifndef lineart_h #define lineart_h #include <stdio.h> #define MAX_LINE_LENGTH 200 // data structure for line // (x1, y1) = inital point // (x2, y2) = final point struct line { int x1; int y1; int x2; int y2; }; // data structure for point (x, y) struct point { int x; int y; }; // Generate displacement value for new line int genDifference(); // Easy line resetting/initialization void easyLine(struct line *l, int x1, int y1, int x2, int y2); // Calculates midpoint of line l, // stores in point p void getMidpoint(struct line *l, struct point *p); // Generate next line in sequence void genNextLine(struct line *previous, struct line *current, int lineNo); #endif /* lineart_h */
--- +++ @@ -29,6 +29,13 @@ int y; }; +// data structure for node +// in linked list of lines +struct node { + struct line *line; + struct node *next; +}; + // Generate displacement value for new line int genDifference(); @@ -43,4 +50,8 @@ // Generate next line in sequence void genNextLine(struct line *previous, struct line *current, int lineNo); +void freeLineNode(struct node *node); + +void freeLineList(struct node *root); + #endif /* lineart_h */
Add list function declarations, node structure
apache-2.0
tchieze/LineArt
51c7e9a45e870e07de66880248be05d5b73dd249
#define ACPI_MACHINE_WIDTH 64 #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_INLINE inline #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #ifdef ACPI_FULL_DEBUG #define ACPI_DEBUG_OUTPUT #define ACPI_DISASSEMBLER // Depends on threading support #define ACPI_DEBUGGER //#define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_GET_FUNCTION_NAME __FUNCTION__ #else #define ACPI_GET_FUNCTION_NAME "" #endif #define ACPI_PHYS_BASE 0x100000000 #include <stdint.h> #include <stdarg.h> #define AcpiOsPrintf printf #define AcpiOsVprintf vprintf struct acpi_table_facs; uint32_t AcpiOsReleaseGlobalLock(struct acpi_table_facs* facs); uint32_t AcpiOsAcquireGlobalLock(struct acpi_table_facs* facs); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = AcpiOsAcquireGlobalLock(GLptr) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = AcpiOsReleaseGlobalLock(GLptr)
#define ACPI_MACHINE_WIDTH 64 #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_INLINE inline #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #ifdef ACPI_FULL_DEBUG #define ACPI_DEBUG_OUTPUT #define ACPI_DISASSEMBLER // Depends on threading support #define ACPI_DEBUGGER #define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_GET_FUNCTION_NAME __FUNCTION__ #else #define ACPI_GET_FUNCTION_NAME "" #endif #define ACPI_PHYS_BASE 0x100000000 #include <stdint.h> #include <stdarg.h> #define AcpiOsPrintf printf #define AcpiOsVprintf vprintf struct acpi_table_facs; uint32_t AcpiOsReleaseGlobalLock(struct acpi_table_facs* facs); uint32_t AcpiOsAcquireGlobalLock(struct acpi_table_facs* facs); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = AcpiOsAcquireGlobalLock(GLptr) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = AcpiOsReleaseGlobalLock(GLptr)
--- +++ @@ -12,7 +12,7 @@ // Depends on threading support #define ACPI_DEBUGGER -#define ACPI_DBG_TRACK_ALLOCATIONS +//#define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_GET_FUNCTION_NAME __FUNCTION__ #else
Disable allocation tracking (it appears to be broken)
mit
olsner/os,olsner/os,olsner/os,olsner/os
7214f0aa8bfbe71e69e3340bda1f2f4411db8ff0
//===--- SymbolCollector.h ---------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "Index.h" #include "clang/Index/IndexDataConsumer.h" #include "clang/Index/IndexSymbol.h" namespace clang { namespace clangd { // Collect all symbols from an AST. // // Clients (e.g. clangd) can use SymbolCollector together with // index::indexTopLevelDecls to retrieve all symbols when the source file is // changed. class SymbolCollector : public index::IndexDataConsumer { public: SymbolCollector() = default; bool handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles, ArrayRef<index::SymbolRelation> Relations, FileID FID, unsigned Offset, index::IndexDataConsumer::ASTNodeInfo ASTNode) override; void finish() override; SymbolSlab takeSymbols() { return std::move(Symbols); } private: // All Symbols collected from the AST. SymbolSlab Symbols; }; } // namespace clangd } // namespace clang
//===--- SymbolCollector.h ---------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "Index.h" #include "clang/Index/IndexDataConsumer.h" #include "clang/Index/IndexSymbol.h" namespace clang { namespace clangd { // Collect all symbols from an AST. // // Clients (e.g. clangd) can use SymbolCollector together with // index::indexTopLevelDecls to retrieve all symbols when the source file is // changed. class SymbolCollector : public index::IndexDataConsumer { public: SymbolCollector() = default; bool handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles, ArrayRef<index::SymbolRelation> Relations, FileID FID, unsigned Offset, index::IndexDataConsumer::ASTNodeInfo ASTNode) override; void finish() override; SymbolSlab takeSymbols() const { return std::move(Symbols); } private: // All Symbols collected from the AST. SymbolSlab Symbols; }; } // namespace clangd } // namespace clang
--- +++ @@ -32,7 +32,7 @@ void finish() override; - SymbolSlab takeSymbols() const { return std::move(Symbols); } + SymbolSlab takeSymbols() { return std::move(Symbols); } private: // All Symbols collected from the AST.
[clangd] Remove the const specifier of the takeSymbol method otherwise we will copy an object. git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@320574 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra
518d3b528894007e746413079241cfba4ae5c07a
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3(int) __attribute__((availability(ios,introduced=3.0))); void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}} void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0))); void f6(int) __attribute__((availability(ios,deprecated=3.0))); void f6(int) __attribute__((availability(ios,introduced=2.0))); void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} f5(0); // expected-warning{{'f5' is deprecated: first deprecated in iOS 3.0}} f6(0); // expected-warning{{'f6' is deprecated: first deprecated in iOS 3.0}} }
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3(int) __attribute__((availability(ios,introduced=3.0))); void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}} void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} }
--- +++ @@ -6,10 +6,16 @@ void f3(int) __attribute__((availability(ios,introduced=3.0))); void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}} +void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0))); +void f6(int) __attribute__((availability(ios,deprecated=3.0))); +void f6(int) __attribute__((availability(ios,introduced=2.0))); + void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} + f5(0); // expected-warning{{'f5' is deprecated: first deprecated in iOS 3.0}} + f6(0); // expected-warning{{'f6' is deprecated: first deprecated in iOS 3.0}} }
Test attribute merging for the availability attribute. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@128334 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
6cc425e21330a5fa456077def0fc727b92e6ecde
#include <arch/x64/port.h> #include <truth/panic.h> #define TEST_RESULT_PORT_NUMBER 0xf4 void test_shutdown_status(enum status status) { logf(Log_Debug, "Test shutting down with status %s (%d)\n", status_message(status), status); write_port(status, TEST_RESULT_PORT_NUMBER); halt(); assert(Not_Reached); }
#include <arch/x64/port.h> #include <truth/panic.h> #define TEST_RESULT_PORT_NUMBER 0xf4 void test_shutdown_status(enum status status) { logf(Log_Debug, "Test shutting down with status %s (%d)\n", status_message(status), status); write_port(status, TEST_RESULT_PORT_NUMBER); //__asm__("movb $0x0, %al; outb %al, $0xf4"); __asm__("movb $0xf4, %al; outb %al, $0x0"); __asm__("movb $0x0, %al; outb %al, $0xf4"); halt(); //write_port(2, TEST_RESULT_PORT_NUMBER); assert(Not_Reached); }
--- +++ @@ -6,10 +6,6 @@ void test_shutdown_status(enum status status) { logf(Log_Debug, "Test shutting down with status %s (%d)\n", status_message(status), status); write_port(status, TEST_RESULT_PORT_NUMBER); - //__asm__("movb $0x0, %al; outb %al, $0xf4"); - __asm__("movb $0xf4, %al; outb %al, $0x0"); - __asm__("movb $0x0, %al; outb %al, $0xf4"); - halt(); - //write_port(2, TEST_RESULT_PORT_NUMBER); + halt(); assert(Not_Reached); }
Remove debug messages and duplicate code
mit
iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth
708004157299c728b304385f3f4255ffbd587f60
// RUN: %ocheck 3 %s -g // test debug emission too g() { return 3; } main() { if(0){ int i; f(); // shouldn't hit a linker error here - dead code a: i = 2; return g(i); } goto a; }
// RUN: %ocheck 3 %s g() { return 3; } main() { if(0){ f(); // shouldn't hit a linker error here - dead code a: return g(); } goto a; }
--- +++ @@ -1,4 +1,5 @@ -// RUN: %ocheck 3 %s +// RUN: %ocheck 3 %s -g +// test debug emission too g() { @@ -8,9 +9,11 @@ main() { if(0){ + int i; f(); // shouldn't hit a linker error here - dead code a: - return g(); + i = 2; + return g(i); } goto a;
Test debug label emission with local variables
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
76f394247acc79e003beeb06fa286f246ea7685a
/* * Copyright (c) 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. */ /* * gc_noinst.c : Functions that shouldn't be instrumented by the compiler */ __thread unsigned int thread_suspend_if_needed_count = 0; /* TODO(elijahtaylor): This will need to be changed * when the compiler instrumentation changes. */ volatile int __nacl_thread_suspension_needed = 1; void __nacl_suspend_thread_if_needed() { thread_suspend_if_needed_count++; }
/* * Copyright 2010 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. */ /* * gc_noinst.c : Functions that shouldn't be instrumented by the compiler */ __thread unsigned int thread_suspend_if_needed_count = 0; /* TODO(elijahtaylor): This will need to be changed * when the compiler instrumentation changes. */ void __nacl_suspend_thread_if_needed() { thread_suspend_if_needed_count++; }
--- +++ @@ -1,7 +1,7 @@ /* - * Copyright 2010 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. + * Copyright (c) 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. */ /* @@ -13,7 +13,8 @@ /* TODO(elijahtaylor): This will need to be changed * when the compiler instrumentation changes. */ +volatile int __nacl_thread_suspension_needed = 1; + void __nacl_suspend_thread_if_needed() { thread_suspend_if_needed_count++; } -
Fix the gc_instrumentation test on toolchain bots. The compiler now inserts explicit references to the suspension flag, which then fails to link when the flag is not present. BUG=none TEST=run_gc_instrumentation_test # with freshly uploaded toolchain Review URL: http://codereview.chromium.org/8336018 git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@6962 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,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client
184509531a7477bfa89bc075e3873a2a504a9448
#ifndef DISK_H #define DISK_H #include <stdint.h> #include "../process/process.h" #ifdef __i386__ #define IOPRIO_GET 290 #elif __x86_64__ #define IOPRIO_GET 252 #endif #define IOPRIO_WHO_PROCESS 1 #define IOPRIO_CLASS_SHIFT (13) #define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1) #define PRIOLEN 8 char *filesystem_type(void); int ioprio_get(int pid); char *ioprio_class(int pid); char *ioprio_class_nice(int pid); uint64_t get_process_taskstat_io(int pid, char field); #endif
#ifndef DISK_H #define DISK_H #include "../process/process.h" #ifdef __i386__ #define IOPRIO_GET 290 #elif __x86_64__ #define IOPRIO_GET 252 #endif #define IOPRIO_WHO_PROCESS 1 #define IOPRIO_CLASS_SHIFT (13) #define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1) #define PRIOLEN 8 char *filesystem_type(void); int ioprio_get(int pid); char *ioprio_class(int pid); char *ioprio_class_nice(int pid); void proc_io(proc_t *procs); #endif
--- +++ @@ -1,6 +1,7 @@ #ifndef DISK_H #define DISK_H +#include <stdint.h> #include "../process/process.h" @@ -25,6 +26,6 @@ char *ioprio_class_nice(int pid); -void proc_io(proc_t *procs); +uint64_t get_process_taskstat_io(int pid, char field); #endif
Adjust declaration for taskstats io call
mit
tijko/dashboard
909d0e643ab120ef34344d4b589408ac50d23570
#ifndef E_MOD_MAIN_H # define E_MOD_MAIN_H //# define LOGFNS 1 # ifdef LOGFNS # include <stdio.h> # define LOGFN(fl, ln, fn) printf("-CONF-RANDR: %25s: %5i - %s\n", fl, ln, fn); # else # define LOGFN(fl, ln, fn) # endif EAPI extern E_Module_Api e_modapi; EAPI void *e_modapi_init(E_Module *m); EAPI int e_modapi_shutdown(E_Module *m); EAPI int e_modapi_save(E_Module *m); /** * @addtogroup Optional_Conf * @{ * * @defgroup Module_Conf_RandR RandR (Screen Resize, Rotate and Mirror) * * Configures size, rotation and mirroring of screen. Uses the X11 * RandR protocol (does not work with NVidia proprietary drivers). * * @} */ #endif
#ifndef E_MOD_MAIN_H # define E_MOD_MAIN_H # define LOGFNS 1 # ifdef LOGFNS # include <stdio.h> # define LOGFN(fl, ln, fn) printf("-CONF-RANDR: %25s: %5i - %s\n", fl, ln, fn); # else # define LOGFN(fl, ln, fn) # endif # ifndef ECORE_X_RANDR_1_2 # define ECORE_X_RANDR_1_2 ((1 << 16) | 2) # endif # ifndef ECORE_X_RANDR_1_3 # define ECORE_X_RANDR_1_3 ((1 << 16) | 3) # endif # ifndef E_RANDR_12 # define E_RANDR_12 (e_randr_screen_info.rrvd_info.randr_info_12) # endif EAPI extern E_Module_Api e_modapi; EAPI void *e_modapi_init(E_Module *m); EAPI int e_modapi_shutdown(E_Module *m); EAPI int e_modapi_save(E_Module *m); extern const char *mod_dir; /** * @addtogroup Optional_Conf * @{ * * @defgroup Module_Conf_RandR RandR (Screen Resize, Rotate and Mirror) * * Configures size, rotation and mirroring of screen. Uses the X11 * RandR protocol (does not work with NVidia proprietary drivers). * * @} */ #endif
--- +++ @@ -1,7 +1,7 @@ #ifndef E_MOD_MAIN_H # define E_MOD_MAIN_H -# define LOGFNS 1 +//# define LOGFNS 1 # ifdef LOGFNS # include <stdio.h> @@ -10,26 +10,11 @@ # define LOGFN(fl, ln, fn) # endif - -# ifndef ECORE_X_RANDR_1_2 -# define ECORE_X_RANDR_1_2 ((1 << 16) | 2) -# endif - -# ifndef ECORE_X_RANDR_1_3 -# define ECORE_X_RANDR_1_3 ((1 << 16) | 3) -# endif - -# ifndef E_RANDR_12 -# define E_RANDR_12 (e_randr_screen_info.rrvd_info.randr_info_12) -# endif - EAPI extern E_Module_Api e_modapi; EAPI void *e_modapi_init(E_Module *m); EAPI int e_modapi_shutdown(E_Module *m); EAPI int e_modapi_save(E_Module *m); - -extern const char *mod_dir; /** * @addtogroup Optional_Conf
Remove useless defines and variables. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84200
bsd-2-clause
tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment
3f283a62a22d59028e96d39fdc35c6bd85c2129d
#ifndef RCR_LEVEL1PAYLOAD_SETUP_H_ #define RCR_LEVEL1PAYLOAD_SETUP_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { // Setup the object. Swallow any errors. template<typename T, typename TArg> inline void setup_object(T& obj, TArg arg, const char* display_name) { if (!obj.begin(arg)) { Serial.print("ERROR: "); Serial.print(display_name); Serial.println(" could not be found or setup."); // Swallow the error. Fault tolerance is required. } else { Serial.print("Success: "); Serial.print(display_name); Serial.println(" ready."); } Serial.println(); } template<typename T> inline void setup_object(T& obj, const char* display_name) { if (!obj.begin()) { Serial.print("ERROR: "); Serial.print(display_name); Serial.println(" could not be found or setup."); // Swallow the error. Fault tolerance is required. } else { Serial.print("Success: "); Serial.print(display_name); Serial.println(" ready."); } Serial.println(); } } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_SETUP_H_
#ifndef RCR_LEVEL1PAYLOAD_SETUP_H_ #define RCR_LEVEL1PAYLOAD_SETUP_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { // Setup the object. Swallow any errors. template<typename T> inline void setup_object(T& obj, const char* error_message, const char* success_message) { if (!obj.begin()) { Serial.println(error_message); // Swallow the error. Fault tolerance is required. } else { Serial.println(success_message); } Serial.println(); } } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_SETUP_H_
--- +++ @@ -11,14 +11,35 @@ namespace level1payload { // Setup the object. Swallow any errors. -template<typename T> -inline void setup_object(T& obj, const char* error_message, const char* success_message) { - if (!obj.begin()) { - Serial.println(error_message); +template<typename T, typename TArg> +inline void setup_object(T& obj, TArg arg, const char* display_name) { + if (!obj.begin(arg)) { + Serial.print("ERROR: "); + Serial.print(display_name); + Serial.println(" could not be found or setup."); + // Swallow the error. Fault tolerance is required. } else { - Serial.println(success_message); + Serial.print("Success: "); + Serial.print(display_name); + Serial.println(" ready."); + } + Serial.println(); +} +template<typename T> +inline void setup_object(T& obj, const char* display_name) { + if (!obj.begin()) { + Serial.print("ERROR: "); + Serial.print(display_name); + Serial.println(" could not be found or setup."); + + // Swallow the error. Fault tolerance is required. + } + else { + Serial.print("Success: "); + Serial.print(display_name); + Serial.println(" ready."); } Serial.println(); }
Add template overload for begin() arguments
mit
nolanholden/payload-level1-rocket,nolanholden/geovis,nolanholden/geovis,nolanholden/geovis
e1829b05d441cd768a52ceb81af3a906ee6c219c
// 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. // // Some helpers for quic #ifndef NET_QUIC_QUIC_UTILS_H_ #define NET_QUIC_QUIC_UTILS_H_ #include "net/base/int128.h" #include "net/base/net_export.h" #include "net/quic/quic_protocol.h" namespace net { class NET_EXPORT_PRIVATE QuicUtils { public: // The overhead the quic framing will add for a packet with num_frames // frames. static size_t StreamFramePacketOverhead(int num_frames); // returns the 128 bit FNV1a hash of the data. See // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param static uint128 FNV1a_128_Hash(const char* data, int len); // Returns the name of the quic error code as a char* static const char* ErrorToString(QuicErrorCode error); }; } // namespace net #endif // NET_QUIC_QUIC_UTILS_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Some helpers for quic #ifndef NET_QUIC_QUIC_UTILS_H_ #define NET_QUIC_QUIC_UTILS_H_ #include "net/base/int128.h" #include "net/base/net_export.h" #include "net/quic/quic_protocol.h" namespace gfe2 { class BalsaHeaders; } namespace net { class NET_EXPORT_PRIVATE QuicUtils { public: // The overhead the quic framing will add for a packet with num_frames // frames. static size_t StreamFramePacketOverhead(int num_frames); // returns the 128 bit FNV1a hash of the data. See // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param static uint128 FNV1a_128_Hash(const char* data, int len); // Returns the name of the quic error code as a char* static const char* ErrorToString(QuicErrorCode error); }; } // namespace net #endif // NET_QUIC_QUIC_UTILS_H_
--- +++ @@ -10,10 +10,6 @@ #include "net/base/int128.h" #include "net/base/net_export.h" #include "net/quic/quic_protocol.h" - -namespace gfe2 { - class BalsaHeaders; -} namespace net {
Remove an unused forward declaration. R=rch@chromium.org BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/11877024 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@176837 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,jaruba/chromium.src,hujiajie/pa-chromium,Jonekee/chromium.src,dednal/chromium.src,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,jaruba/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,Jonekee/chromium.src,patrickm/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,patrickm/chromium.src,dushu1203/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,littlstar/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,fujunwei/chromium-crosswalk,hujiajie/pa-chromium,patrickm/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,M4sse/chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,Chilledheart/chromium,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,anirudhSK/chromium,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,anirudhSK/chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,Just-D/chromium-1,littlstar/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,ondra-novak/chromium.src,Just-D/chromium-1,M4sse/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,dednal/chromium.src,Just-D/chromium-1,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,jaruba/chromium.src,ChromiumWebApps/chromium,littlstar/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,patrickm/chromium.src,ltilve/chromium,dushu1203/chromium.src,hujiajie/pa-chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,dednal/chromium.src,jaruba/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,jaruba/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,patrickm/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,ondra-novak/chromium.src,dushu1203/chromium.src,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,jaruba/chromium.src,ChromiumWebApps/chromium,Chilledheart/chromium,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,markYoungH/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,anirudhSK/chromium,M4sse/chromium.src,ltilve/chromium,mogoweb/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,M4sse/chromium.src,ltilve/chromium,hujiajie/pa-chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,jaruba/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,littlstar/chromium.src,timopulkkinen/BubbleFish,Chilledheart/chromium,Just-D/chromium-1,anirudhSK/chromium,markYoungH/chromium.src,Chilledheart/chromium,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,anirudhSK/chromium,dushu1203/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,timopulkkinen/BubbleFish,markYoungH/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,ChromiumWebApps/chromium,ltilve/chromium,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,dushu1203/chromium.src,ltilve/chromium,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,dushu1203/chromium.src,jaruba/chromium.src,Jonekee/chromium.src
c11130f26d609b78e88866c87275794c463171b8
#if defined(WIN32) #define NOGDI #define NOUSER #define NOSOUND #include <winsock2.h> #include <windows.h> #include "_condor_fix_nt.h" #include <stdlib.h> #else #include "_condor_fix_types.h" #include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include "condor_fix_limits.h" #include "condor_fix_string.h" #include <ctype.h> #include <fcntl.h> #include <errno.h> #include "condor_fix_signal.h" #if defined(Solaris) # define BSD_COMP #endif #include <sys/ioctl.h> #if defined(Solaris) # undef BSD_COMP #endif #endif // defined(WIN32)
#include "_condor_fix_types.h" #include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include "condor_fix_limits.h" #include "condor_fix_string.h" #include <ctype.h> #include <fcntl.h> #include <errno.h> #if !defined(SUNOS41) #include <signal.h> #endif
--- +++ @@ -1,3 +1,15 @@ +#if defined(WIN32) + +#define NOGDI +#define NOUSER +#define NOSOUND +#include <winsock2.h> +#include <windows.h> +#include "_condor_fix_nt.h" +#include <stdlib.h> + +#else + #include "_condor_fix_types.h" #include "condor_fix_stdio.h" #include <stdlib.h> @@ -7,6 +19,14 @@ #include <ctype.h> #include <fcntl.h> #include <errno.h> -#if !defined(SUNOS41) -#include <signal.h> +#include "condor_fix_signal.h" + +#if defined(Solaris) +# define BSD_COMP #endif +#include <sys/ioctl.h> +#if defined(Solaris) +# undef BSD_COMP +#endif + +#endif // defined(WIN32)
Use condor_fix_signal.h, not <signal.h>, and include <sys/ioctl.h> properly. Also, NT specific changes committed to main trunk.
apache-2.0
djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,htcondor/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/condor,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,clalancette/condor-dcloud,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,clalancette/condor-dcloud,htcondor/htcondor,djw8605/htcondor,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,djw8605/condor,djw8605/condor,djw8605/htcondor,djw8605/htcondor
fe8b37bf3b859434de2bead4cd4fb00bda48f5c9
#ifndef MEM_H__ #define MEM_H__ #include <stdlib.h> #include "ocomm/o_log.h" void *xmalloc (size_t size); void *xcalloc (size_t count, size_t size); void *xrealloc (void *ptr, size_t size); size_t xmalloc_usable_size(void *ptr); char *xstralloc (size_t len); void *xmemdupz (const void *data, size_t len); char *xstrndup (const char *str, size_t len); void xfree (void *ptr); size_t xmembytes(); size_t xmemnew(); size_t xmemfreed(); char *xmemsummary (); void xmemreport (int loglevel); /* Duplicate nil-terminated string * * \param str string to copy in the new xchunk * \return the newly allocated xchunk, or NULL * \see xstrndup * \see strndup(3), strlen(3) */ #define xstrdup(str) xstrndup((str), strlen((str))) #endif /* MEM_H__ */ /* Local Variables: mode: C tab-width: 2 indent-tabs-mode: nil End: vim: sw=2:sts=2:expandtab */
#ifndef MEM_H__ #define MEM_H__ #include <stdlib.h> #include "ocomm/o_log.h" void *xmalloc (size_t size); void *xcalloc (size_t count, size_t size); void *xrealloc (void *ptr, size_t size); size_t xmalloc_usable_size(void *ptr); char *xstralloc (size_t len); void *xmemdupz (const void *data, size_t len); char *xstrndup (const char *str, size_t len); void xfree (void *ptr); size_t xmembytes(); size_t xmemnew(); size_t xmemfreed(); char *xmemsummary (); void xmemreport (int loglevel); #endif /* MEM_H__ */ /* Local Variables: mode: C tab-width: 2 indent-tabs-mode: nil End: vim: sw=2:sts=2:expandtab */
--- +++ @@ -20,6 +20,15 @@ char *xmemsummary (); void xmemreport (int loglevel); +/* Duplicate nil-terminated string + * + * \param str string to copy in the new xchunk + * \return the newly allocated xchunk, or NULL + * \see xstrndup + * \see strndup(3), strlen(3) + */ +#define xstrdup(str) xstrndup((str), strlen((str))) + #endif /* MEM_H__ */ /*
Add xstrdup as a convenience macro around xstrndup Signed-off-by: Olivier Mehani <b6547e8761a9172c977da5c389270d45960e4aa0@ssji.net>
mit
alco90/soml,mytestbed/oml,lees0414/EUproject,mytestbed/oml,mytestbed/oml,lees0414/EUproject,lees0414/EUproject,mytestbed/oml,mytestbed/oml,alco90/soml,lees0414/EUproject,alco90/soml,lees0414/EUproject,alco90/soml,alco90/soml
1bf082ea8864b04f6bb15889fba66e092fd6b2f8
#include "lua.h" #include "lualib.h" #include "lauxlib.h" #include "lua_debug.h" static const luaL_Reg STANDARD_LIBS[] = { { "_G", luaopen_base }, { LUA_TABLIBNAME, luaopen_table }, { LUA_STRLIBNAME, luaopen_string }, { LUA_MATHLIBNAME, luaopen_math }, { LUA_DBLIBNAME, luaopen_debug }, { 0, 0 } }; int main() { lua_State * l = (lua_State *)luaL_newstate(); const luaL_Reg *lib; for (lib = STANDARD_LIBS; lib->func; ++lib) { luaL_requiref(l, lib->name, lib->func, 1); lua_pop(l, 1); } lua_debug_init(l, "/tmp/socket_lua_debug"); return 0; }
#include "lua.h" #include "lua_debug.h" int main() { return 0; }
--- +++ @@ -1,7 +1,27 @@ #include "lua.h" +#include "lualib.h" +#include "lauxlib.h" #include "lua_debug.h" +static const luaL_Reg STANDARD_LIBS[] = { + { "_G", luaopen_base }, + { LUA_TABLIBNAME, luaopen_table }, + { LUA_STRLIBNAME, luaopen_string }, + { LUA_MATHLIBNAME, luaopen_math }, + { LUA_DBLIBNAME, luaopen_debug }, + { 0, 0 } +}; + int main() { + lua_State * l = (lua_State *)luaL_newstate(); + const luaL_Reg *lib; + + for (lib = STANDARD_LIBS; lib->func; ++lib) { + luaL_requiref(l, lib->name, lib->func, 1); + lua_pop(l, 1); + } + + lua_debug_init(l, "/tmp/socket_lua_debug"); return 0; }
Add a test program with a bit more substance.
mit
laarmen/lua_debug,laarmen/lua_debug
7afb68bf3ea5c1549f10e3bdb7f25ecb51256786
//===- Config.h -------------------------------------------------*- C++ -*-===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_WASM_CONFIG_H #define LLD_WASM_CONFIG_H #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSet.h" #include "llvm/BinaryFormat/Wasm.h" #include "Symbols.h" using llvm::wasm::WasmGlobal; namespace lld { namespace wasm { struct Configuration { bool AllowUndefined; bool Demangle; bool EmitRelocs; bool ImportMemory; bool Relocatable; bool StripAll; bool StripDebug; uint32_t GlobalBase; uint32_t InitialMemory; uint32_t MaxMemory; uint32_t ZStackSize; llvm::StringRef Entry; llvm::StringRef OutputFile; llvm::StringRef Sysroot; llvm::StringSet<> AllowUndefinedSymbols; std::vector<llvm::StringRef> SearchPaths; std::vector<std::pair<Symbol *, WasmGlobal>> SyntheticGlobals; }; // The only instance of Configuration struct. extern Configuration *Config; } // namespace wasm } // namespace lld #endif
//===- Config.h -------------------------------------------------*- C++ -*-===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_WASM_CONFIG_H #define LLD_WASM_CONFIG_H #include "llvm/ADT/StringRef.h" #include "llvm/BinaryFormat/Wasm.h" #include "Symbols.h" using llvm::wasm::WasmGlobal; #include <set> namespace lld { namespace wasm { struct Configuration { bool AllowUndefined; bool Demangle; bool EmitRelocs; bool ImportMemory; bool Relocatable; bool StripAll; bool StripDebug; uint32_t GlobalBase; uint32_t InitialMemory; uint32_t MaxMemory; uint32_t ZStackSize; llvm::StringRef Entry; llvm::StringRef OutputFile; llvm::StringRef Sysroot; std::set<llvm::StringRef> AllowUndefinedSymbols; std::vector<llvm::StringRef> SearchPaths; std::vector<std::pair<Symbol *, WasmGlobal>> SyntheticGlobals; }; // The only instance of Configuration struct. extern Configuration *Config; } // namespace wasm } // namespace lld #endif
--- +++ @@ -11,13 +11,12 @@ #define LLD_WASM_CONFIG_H #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSet.h" #include "llvm/BinaryFormat/Wasm.h" #include "Symbols.h" using llvm::wasm::WasmGlobal; - -#include <set> namespace lld { namespace wasm { @@ -38,7 +37,7 @@ llvm::StringRef OutputFile; llvm::StringRef Sysroot; - std::set<llvm::StringRef> AllowUndefinedSymbols; + llvm::StringSet<> AllowUndefinedSymbols; std::vector<llvm::StringRef> SearchPaths; std::vector<std::pair<Symbol *, WasmGlobal>> SyntheticGlobals; };
Use llvm::StringSet instead of std::set. std::set is pretty slow. We generally prefer llvm::StringSet if we don't need an sorted set. Differential Revision: https://reviews.llvm.org/D40579 git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@319371 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/lld,llvm-mirror/lld
e79f9d35c3fb014b4506d6b794abaac3fcd88182
// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.memset | count 3 typedef __SIZE_TYPE__ size_t; void *memset(void*, int, size_t); void bzero(void*, size_t); void test(int* X, char *Y) { // CHECK: call i8* llvm.memset memset(X, 4, 1000); // CHECK: call void bzero bzero(Y, 100); }
// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.memset | count 3 #ifndef memset void *memset(void*, int, unsigned long); #endif #ifndef bzero void bzero(void*, unsigned long); #endif void test(int* X, char *Y) { // CHECK: call i8* llvm.memset memset(X, 4, 1000); // CHECK: call void bzero bzero(Y, 100); }
--- +++ @@ -1,11 +1,8 @@ // RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.memset | count 3 -#ifndef memset -void *memset(void*, int, unsigned long); -#endif -#ifndef bzero -void bzero(void*, unsigned long); -#endif +typedef __SIZE_TYPE__ size_t; +void *memset(void*, int, size_t); +void bzero(void*, size_t); void test(int* X, char *Y) { // CHECK: call i8* llvm.memset
Use the correct definition for memset. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136188 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
cd6ab8cc43ee0171d90bf6a0b94b19e12fb831c5
/* * Copyright 2020 Andrey Terekhov, Maxim Menshikov * * 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. */ #pragma once #include "context.h" #ifdef __cplusplus extern "C" { #endif /** * Mode table initialization * * @param context RuC context */ void init_modetab(compiler_context *context); #ifdef __cplusplus } /* extern "C" */ #endif
/* * Copyright 2020 Andrey Terekhov, Maxim Menshikov * * 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. */ #pragma once #include "context.h" #ifdef __cplusplus extern "C" { #endif /** * Save up a string array to reprtab * * @param context RuC context * @param str Target string * * @return FIXME */ int toreprtab(compiler_context *context, char str[]); /** * Mode table initialization * * @param context RuC context */ void init_modetab(compiler_context *context); #ifdef __cplusplus } /* extern "C" */ #endif
--- +++ @@ -24,16 +24,6 @@ #endif /** - * Save up a string array to reprtab - * - * @param context RuC context - * @param str Target string - * - * @return FIXME - */ -int toreprtab(compiler_context *context, char str[]); - -/** * Mode table initialization * * @param context RuC context
Remove useless interface of toreprtab
apache-2.0
andrey-terekhov/RuC,andrey-terekhov/RuC,andrey-terekhov/RuC
e02046531c3e291aeb87a92918dda0f21bad9700
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2010 NorthScale, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in 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 CONFIG_STATIC_H #define CONFIG_STATIC_H 1 /* The intention of this file is to avoid cluttering the code with #ifdefs */ #include <event.h> #if (!defined(_EVENT_NUMERIC_VERSION) || _EVENT_NUMERIC_VERSION < 0x02000000) && !defined(WIN32) typedef int evutil_socket_t; #endif #ifndef DEFAULT_ERRORLOG #define DEFAULT_ERRORLOG ERRORLOG_STDERR #endif #if defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN > 1 #define ENDIAN_BIG 1 #else #define ENDIAN_LITTLE 1 #endif #endif
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2010 NorthScale, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in 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 CONFIG_STATIC_H #define CONFIG_STATIC_H 1 /* The intention of this file is to avoid cluttering the code with #ifdefs */ #include <event.h> #if !defined(_EVENT_NUMERIC_VERSION) || _EVENT_NUMERIC_VERSION < 0x02000000 typedef int evutil_socket_t; #endif #ifndef DEFAULT_ERRORLOG #define DEFAULT_ERRORLOG ERRORLOG_STDERR #endif #if defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN > 1 #define ENDIAN_BIG 1 #else #define ENDIAN_LITTLE 1 #endif #endif
--- +++ @@ -20,7 +20,7 @@ /* The intention of this file is to avoid cluttering the code with #ifdefs */ #include <event.h> -#if !defined(_EVENT_NUMERIC_VERSION) || _EVENT_NUMERIC_VERSION < 0x02000000 +#if (!defined(_EVENT_NUMERIC_VERSION) || _EVENT_NUMERIC_VERSION < 0x02000000) && !defined(WIN32) typedef int evutil_socket_t; #endif
Fix event test for win32 Change-Id: I74011ed8cdebaf1771bbaadf4c1eba559f240448 Reviewed-on: http://review.couchbase.org/34772 Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com> Tested-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
bsd-3-clause
couchbase/moxi,membase/moxi,membase/moxi,couchbase/moxi,membase/moxi,couchbase/moxi,couchbase/moxi,membase/moxi,couchbase/moxi,membase/moxi,couchbase/moxi,membase/moxi
de9b060c9e15245df187379f366894c83333bc6c
// Copyright (c) 2015 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ #define ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ #include <vector> #include "base/compiler_specific.h" #include "base/memory/scoped_vector.h" #include "content/public/utility/content_utility_client.h" class UtilityMessageHandler; namespace atom { class AtomContentUtilityClient : public content::ContentUtilityClient { public: AtomContentUtilityClient(); ~AtomContentUtilityClient() override; private: #if defined(OS_WIN) typedef ScopedVector<UtilityMessageHandler> Handlers; Handlers handlers_; #endif DISALLOW_COPY_AND_ASSIGN(AtomContentUtilityClient); }; } // namespace atom #endif // ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_
// Copyright (c) 2015 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ #define ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ #include <vector> #include "base/compiler_specific.h" #include "base/memory/scoped_vector.h" #include "content/public/utility/content_utility_client.h" class UtilityMessageHandler; namespace atom { class AtomContentUtilityClient : public content::ContentUtilityClient { public: AtomContentUtilityClient(); ~AtomContentUtilityClient() override; private: typedef ScopedVector<UtilityMessageHandler> Handlers; Handlers handlers_; DISALLOW_COPY_AND_ASSIGN(AtomContentUtilityClient); }; } // namespace atom #endif // ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_
--- +++ @@ -21,8 +21,10 @@ ~AtomContentUtilityClient() override; private: +#if defined(OS_WIN) typedef ScopedVector<UtilityMessageHandler> Handlers; Handlers handlers_; +#endif DISALLOW_COPY_AND_ASSIGN(AtomContentUtilityClient); };
Fix compilation waring on Mac
mit
shiftkey/electron,shiftkey/electron,the-ress/electron,renaesop/electron,rajatsingla28/electron,electron/electron,rreimann/electron,Floato/electron,renaesop/electron,tonyganch/electron,miniak/electron,brenca/electron,the-ress/electron,miniak/electron,tonyganch/electron,electron/electron,shiftkey/electron,renaesop/electron,Floato/electron,Floato/electron,miniak/electron,gerhardberger/electron,seanchas116/electron,thompsonemerson/electron,rajatsingla28/electron,tonyganch/electron,Floato/electron,gerhardberger/electron,gerhardberger/electron,wan-qy/electron,twolfson/electron,tonyganch/electron,joaomoreno/atom-shell,biblerule/UMCTelnetHub,joaomoreno/atom-shell,bpasero/electron,thompsonemerson/electron,rreimann/electron,seanchas116/electron,twolfson/electron,thomsonreuters/electron,rajatsingla28/electron,the-ress/electron,rajatsingla28/electron,electron/electron,biblerule/UMCTelnetHub,wan-qy/electron,twolfson/electron,thompsonemerson/electron,rreimann/electron,Floato/electron,miniak/electron,electron/electron,brenca/electron,the-ress/electron,miniak/electron,joaomoreno/atom-shell,shiftkey/electron,brenca/electron,renaesop/electron,biblerule/UMCTelnetHub,joaomoreno/atom-shell,wan-qy/electron,joaomoreno/atom-shell,twolfson/electron,shiftkey/electron,rajatsingla28/electron,bpasero/electron,rreimann/electron,twolfson/electron,renaesop/electron,the-ress/electron,thompsonemerson/electron,seanchas116/electron,Floato/electron,tonyganch/electron,bpasero/electron,gerhardberger/electron,rreimann/electron,thomsonreuters/electron,thomsonreuters/electron,thompsonemerson/electron,wan-qy/electron,renaesop/electron,seanchas116/electron,bpasero/electron,seanchas116/electron,gerhardberger/electron,brenca/electron,wan-qy/electron,biblerule/UMCTelnetHub,shiftkey/electron,thomsonreuters/electron,biblerule/UMCTelnetHub,thomsonreuters/electron,joaomoreno/atom-shell,brenca/electron,thompsonemerson/electron,gerhardberger/electron,biblerule/UMCTelnetHub,tonyganch/electron,bpasero/electron,electron/electron,twolfson/electron,the-ress/electron,wan-qy/electron,seanchas116/electron,bpasero/electron,brenca/electron,thomsonreuters/electron,rreimann/electron,rajatsingla28/electron,electron/electron,gerhardberger/electron,bpasero/electron,miniak/electron,electron/electron,the-ress/electron
e0c021bfef7292524964b4ab61db5db65c49f6aa
#include "handlers.h" void warning(void *ctx, const char *msg, ...) { va_list args; va_start(args, msg); fprintf(stdout, "SAX.warning()\n"); vfprintf(stdout, msg, args); va_end(args); } void error(void *ctx, const char *msg, ...) { va_list args; va_start(args, msg); fprintf(stdout, "SAX.error()\n"); vfprintf(stdout, msg, args); va_end(args); } void fatal_error(void *ctx, const char *msg, ...) { va_list args; va_start(args, msg); fprintf(stdout, "SAX.fatal_error()\n"); vfprintf(stdout, msg, args); va_end(args); } void say(void *ctx, const char *tag, const char *msg) { fprintf(stdout, "[%s] %s\n", tag, msg); }
#include "handlers.h" void warning(void *ctx, const char *msg, ...) { va_list args; va_start(args, msg); fprintf(stdout, "SAX.warning()\n"); vfprintf(stdout, msg, args); va_end(args); } void error(void *ctx, const char *msg, ...) { va_list args; va_start(args, msg); fprintf(stdout, "SAX.error()\n"); vfprintf(stdout, msg, args); va_end(args); } void fatal_error(void *ctx, const char *msg, ...) { va_list args; va_start(args, msg); fprintf(stdout, "SAX.fatal_error()\n"); vfprintf(stdout, msg, args); va_end(args); }
--- +++ @@ -29,3 +29,8 @@ vfprintf(stdout, msg, args); va_end(args); } + +void say(void *ctx, const char *tag, const char *msg) +{ + fprintf(stdout, "[%s] %s\n", tag, msg); +}
Add overridable default message serializer
bsd-3-clause
jonforums/xvalid,jonforums/xvalid,jonforums/xvalid
080514a81e4b6fba16474516aa84f48039dad111
#include "cowboy.h" VALUE mCowboy; VALUE fft_1d(VALUE m, VALUE nums){ fftw_complex *in, *out; fftw_plan fp; long n; Check_Type(nums, T_ARRAY); n = size_of_ary(nums); if (n == 0){ rb_raise(rb_eException, "Can't use blank array"); } in = allocate_fftw_complex(n); out = allocate_fftw_complex(n); fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE); cast_nums_to_complex(in, nums); fftw_execute(fp); free(in); return complex_to_real_nums(out, n); } void Init_cowboy(){ mCowboy = rb_define_module("Cowboy"); Init_cowboy_complex(); rb_define_module_function(mCowboy, "fft_1d", fft_1d, 1); }
#include "cowboy.h" VALUE mCowboy; VALUE fft_1d(VALUE m, VALUE nums){ fftw_complex *in, *out; fftw_plan fp; long n; Check_Type(nums, T_ARRAY); n = size_of_ary(nums); in = allocate_fftw_complex(n); out = allocate_fftw_complex(n); fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE); cast_nums_to_complex(in, nums); fftw_execute(fp); return complex_to_real_nums(out, n); } void Init_cowboy(){ mCowboy = rb_define_module("Cowboy"); Init_cowboy_complex(); rb_define_module_function(mCowboy, "fft_1d", fft_1d, 1); }
--- +++ @@ -10,6 +10,9 @@ Check_Type(nums, T_ARRAY); n = size_of_ary(nums); + if (n == 0){ + rb_raise(rb_eException, "Can't use blank array"); + } in = allocate_fftw_complex(n); out = allocate_fftw_complex(n); fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE); @@ -17,6 +20,7 @@ cast_nums_to_complex(in, nums); fftw_execute(fp); + free(in); return complex_to_real_nums(out, n); }
Handle call with empty array gracefully. (Compare to segfault earlier).
mit
ciniglio/cowboy,ciniglio/cowboy
8fe518a50830119365916f194dae8d458064ff70
// 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 CHROME_NACL_NACL_BROKER_LISTENER_H_ #define CHROME_NACL_NACL_BROKER_LISTENER_H_ #pragma once #include "base/memory/scoped_ptr.h" #include "base/process.h" #include "chrome/common/nacl_types.h" #include "ipc/ipc_channel.h" // The BrokerThread class represents the thread that handles the messages from // the browser process and starts NaCl loader processes. class NaClBrokerListener : public IPC::Channel::Listener { public: NaClBrokerListener(); ~NaClBrokerListener(); void Listen(); // IPC::Channel::Listener implementation. virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; virtual void OnChannelError() OVERRIDE; private: void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id); void OnStopBroker(); base::ProcessHandle browser_handle_; scoped_ptr<IPC::Channel> channel_; DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener); }; #endif // CHROME_NACL_NACL_BROKER_LISTENER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_NACL_NACL_BROKER_LISTENER_H_ #define CHROME_NACL_NACL_BROKER_LISTENER_H_ #pragma once #include "base/memory/scoped_ptr.h" #include "base/process.h" #include "chrome/common/nacl_types.h" #include "ipc/ipc_channel.h" // The BrokerThread class represents the thread that handles the messages from // the browser process and starts NaCl loader processes. class NaClBrokerListener : public IPC::Channel::Listener { public: NaClBrokerListener(); ~NaClBrokerListener(); void Listen(); // IPC::Channel::Listener implementation. virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; virtual void OnChannelError() OVERRIDE; private: void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id); void OnShareBrowserHandle(int browser_handle); void OnStopBroker(); base::ProcessHandle browser_handle_; scoped_ptr<IPC::Channel> channel_; DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener); }; #endif // CHROME_NACL_NACL_BROKER_LISTENER_H_
--- +++ @@ -1,4 +1,4 @@ -// Copyright (c) 2011 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. @@ -27,7 +27,6 @@ private: void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id); - void OnShareBrowserHandle(int browser_handle); void OnStopBroker(); base::ProcessHandle browser_handle_;
NaCl: Remove declaration of non-existent method BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9592039 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@125431 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
gavinp/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,gavinp/chromium
bbbb905e897e8dd9e59c51d1dc3f34023314295e
// 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 UI_APP_LIST_APP_LIST_EXPORT_H_ #define UI_APP_LIST_APP_LIST_EXPORT_H_ #pragma once // Defines APP_LIST_EXPORT so that functionality implemented by the app_list // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __declspec(dllexport) #else #define APP_LIST_EXPORT __declspec(dllimport) #endif // defined(APP_LIST_IMPLEMENTATION) #else // defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __attribute__((visibility("default"))) #else #define APP_LIST_EXPORT #endif #endif #else // defined(COMPONENT_BUILD) #define APP_LIST_EXPORT #endif #endif // UI_APP_LIST_APP_LIST_EXPORT_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_APP_LIST_APP_LIST_EXPORT_H_ #define UI_APP_LIST_APP_LIST_EXPORT_H_ #pragma once // Defines APP_LIST_EXPORT so that functionality implemented by the app_list // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __declspec(dllexport) #else #define APP_LIST_EXPORT __declspec(dllimport) #endif // defined(APP_LIST_IMPLEMENTATION) #else // defined(WIN32) #define APP_LIST_EXPORT __attribute__((visibility("default"))) #endif #else // defined(COMPONENT_BUILD) #define APP_LIST_EXPORT #endif #endif // UI_APP_LIST_APP_LIST_EXPORT_H_
--- +++ @@ -19,7 +19,11 @@ #endif // defined(APP_LIST_IMPLEMENTATION) #else // defined(WIN32) +#if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __attribute__((visibility("default"))) +#else +#define APP_LIST_EXPORT +#endif #endif #else // defined(COMPONENT_BUILD)
Change the way _EXPORT macros look, app_list edition I missed this in https://chromiumcodereview.appspot.com/10386108/ . Thanks to tfarina for noticing. BUG=90078 TEST=none TBR=ben Review URL: https://chromiumcodereview.appspot.com/10377151 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@137221 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
mogoweb/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,anirudhSK/chromium,Chilledheart/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,keishi/chromium,axinging/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,M4sse/chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,keishi/chromium,Just-D/chromium-1,zcbenz/cefode-chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,ChromiumWebApps/chromium,dednal/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,ChromiumWebApps/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,ltilve/chromium,zcbenz/cefode-chromium,dednal/chromium.src,Fireblend/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,keishi/chromium,ltilve/chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,dushu1203/chromium.src,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,patrickm/chromium.src,keishi/chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,anirudhSK/chromium,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,keishi/chromium,littlstar/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,Jonekee/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,littlstar/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,M4sse/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,keishi/chromium,dednal/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,littlstar/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,M4sse/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,jaruba/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,dednal/chromium.src,hujiajie/pa-chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,keishi/chromium,krieger-od/nwjs_chromium.src,jaruba/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,littlstar/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,hgl888/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,ltilve/chromium,dushu1203/chromium.src,littlstar/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,keishi/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,dednal/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,dednal/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,ltilve/chromium,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,patrickm/chromium.src,M4sse/chromium.src,Just-D/chromium-1,hujiajie/pa-chromium,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,patrickm/chromium.src,zcbenz/cefode-chromium,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,ChromiumWebApps/chromium,Chilledheart/chromium,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,anirudhSK/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,keishi/chromium,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,patrickm/chromium.src,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,Just-D/chromium-1,littlstar/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,hgl888/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,ondra-novak/chromium.src,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,Just-D/chromium-1,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk
915afec8f2eb56ad3fb89cedf8b6b6dda363164a
//===-- GCs.h - Garbage collector linkage hacks ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains hack functions to force linking in the GC components. // //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_GCS_H #define LLVM_CODEGEN_GCS_H namespace llvm { class GCStrategy; class GCMetadataPrinter; /// FIXME: Collector instances are not useful on their own. These no longer /// serve any purpose except to link in the plugins. /// Creates an ocaml-compatible garbage collector. void linkOcamlGC(); /// Creates an ocaml-compatible metadata printer. void linkOcamlGCPrinter(); /// Creates an erlang-compatible garbage collector. void linkErlangGC(); /// Creates an erlang-compatible metadata printer. void linkErlangGCPrinter(); /// Creates a shadow stack garbage collector. This collector requires no code /// generator support. void linkShadowStackGC(); } #endif
//===-- GCs.h - Garbage collector linkage hacks ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains hack functions to force linking in the GC components. // //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_GCS_H #define LLVM_CODEGEN_GCS_H namespace llvm { class GCStrategy; class GCMetadataPrinter; /// FIXME: Collector instances are not useful on their own. These no longer /// serve any purpose except to link in the plugins. /// Creates an ocaml-compatible garbage collector. void linkOcamlGC(); /// Creates an ocaml-compatible metadata printer. void linkOcamlGCPrinter(); /// Creates an erlang-compatible garbage collector. void linkErlangGC(); /// Creates an erlang-compatible metadata printer. void linkErlangGCPrinter(); /// Creates a shadow stack garbage collector. This collector requires no code /// generator support. void linkShadowStackGC(); } #endif
--- +++ @@ -17,13 +17,13 @@ namespace llvm { class GCStrategy; class GCMetadataPrinter; - + /// FIXME: Collector instances are not useful on their own. These no longer /// serve any purpose except to link in the plugins. - + /// Creates an ocaml-compatible garbage collector. void linkOcamlGC(); - + /// Creates an ocaml-compatible metadata printer. void linkOcamlGCPrinter(); @@ -32,7 +32,7 @@ /// Creates an erlang-compatible metadata printer. void linkErlangGCPrinter(); - + /// Creates a shadow stack garbage collector. This collector requires no code /// generator support. void linkShadowStackGC();
Test commit: Remove trailing whitespace. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@203502 91177308-0d34-0410-b5e6-96231b3b80d8
bsd-2-clause
chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm
e45534d027c685561d6da233e3cf5e0c1dde726c
/* * Copyright (C) 2015 Muhammad Tayyab Akram * * 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 SHEENBIDI_PARSER_UNICODE_VERSION_H #define SHEENBIDI_PARSER_UNICODE_VERSION_H #include <string> #ifdef major #undef major #endif #ifdef minor #undef minor #endif namespace SheenBidi { namespace Parser { class UnicodeVersion { public: UnicodeVersion(const std::string &versionLine); int major() const; int minor() const; int micro() const; const std::string &versionString() const; private: int m_major; int m_minor; int m_micro; std::string m_versionString; }; } } #endif
/* * Copyright (C) 2015 Muhammad Tayyab Akram * * 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 SHEENBIDI_PARSER_UNICODE_VERSION_H #define SHEENBIDI_PARSER_UNICODE_VERSION_H #include <string> namespace SheenBidi { namespace Parser { class UnicodeVersion { public: UnicodeVersion(const std::string &versionLine); int major() const; int minor() const; int micro() const; const std::string &versionString() const; private: int m_major; int m_minor; int m_micro; std::string m_versionString; }; } } #endif
--- +++ @@ -18,6 +18,12 @@ #define SHEENBIDI_PARSER_UNICODE_VERSION_H #include <string> +#ifdef major +#undef major +#endif +#ifdef minor +#undef minor +#endif namespace SheenBidi { namespace Parser {
Fix warnings about major and minor macros Tools/Parser/UnicodeVersion.h:29:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. int major() const; ^~~~~~~~~~ In file included from Tools/Parser/BidiMirroring.h:24:0, from Tools/Tester/MirrorTester.cpp:26: Tools/Parser/UnicodeVersion.h:30:13: warning: In the GNU C Library, "minor" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>. int minor() const; ^~~~~~~~~~
apache-2.0
mta452/SheenBidi,mta452/SheenBidi
674a7580b153119527f92582465524a09627c1e9
/* @ 0xCCCCCCCC */ #if defined(_MSC_VER) #pragma once #endif #ifndef KBASE_BASIC_MACROS_H_ #define KBASE_BASIC_MACROS_H_ #define DISALLOW_COPY(CLASSNAME) \ CLASSNAME(const CLASSNAME&) = delete; \ CLASSNAME& operator=(const CLASSNAME&) = delete #define DISALLOW_MOVE(CLASSNAME) \ CLASSNAME(CLASSNAME&&) = delete; \ CLASSNAME& operator=(CLASSNAME&&) = delete #define UNREFED_VAR(x) \ ::kbase::internal::SilenceUnusedVariableWarning(x) // Put complicated implementation below. namespace kbase { namespace internal { template<typename T> void SilenceUnusedVariableWarning(T&&) {} } // namespace internal } // namespace kbase #endif // KBASE_BASIC_MACROS_H_
/* @ 0xCCCCCCCC */ #if defined(_MSC_VER) #pragma once #endif #ifndef KBASE_BASIC_MACROS_H_ #define KBASE_BASIC_MACROS_H_ #define DISALLOW_COPY(CLASSNAME) \ CLASSNAME(const CLASSNAME&) = delete; \ CLASSNAME& operator=(const CLASSNAME&) = delete #define DISALLOW_MOVE(CLASSNAME) \ CLASSNAME(CLASSNAME&&) = delete; \ CLASSNAME& operator=(CLASSNAME&&) = delete #endif // KBASE_BASIC_MACROS_H_
--- +++ @@ -17,4 +17,21 @@ CLASSNAME(CLASSNAME&&) = delete; \ CLASSNAME& operator=(CLASSNAME&&) = delete +#define UNREFED_VAR(x) \ + ::kbase::internal::SilenceUnusedVariableWarning(x) + +// Put complicated implementation below. + +namespace kbase { + +namespace internal { + +template<typename T> +void SilenceUnusedVariableWarning(T&&) +{} + +} // namespace internal + +} // namespace kbase + #endif // KBASE_BASIC_MACROS_H_
Add a macro UNREFED_VAR to silence unused variables warning.
mit
kingsamchen/KBase,kingsamchen/KBase_Demo,kingsamchen/KBase,kingsamchen/KBase_Demo
7bddee2c910460fc164840003b8a2c0c3b1dd284
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <pthread.h> #include <getopt.h> #include <sys/uio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <signal.h> #include "utils.h" #include "logSpeed.h" int keepRunning = 1; int main(int argc, char *argv[]) { // int index = handle_args(argc, argv); int index = 1; // signal(SIGTERM, intHandler); // signal(SIGINT, intHandler); for (size_t i = index; i < argc; i++) { int fd = open(argv[i], O_RDWR | O_EXCL | O_DIRECT ); if (fd >= 0) { size_t bdsize = blockDeviceSizeFromFD(fd); trimDevice(fd, argv[i], 0, bdsize - 512); close(fd); } else { perror("open"); } } return 0; }
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <pthread.h> #include <getopt.h> #include <sys/uio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <signal.h> #include "utils.h" #include "logSpeed.h" int keepRunning = 1; int main(int argc, char *argv[]) { // int index = handle_args(argc, argv); int index = 1; // signal(SIGTERM, intHandler); // signal(SIGINT, intHandler); for (size_t i = index; i < argc; i++) { int fd = open(argv[i], O_WRONLY | O_EXCL | O_DIRECT); if (fd >= 0) { size_t bdsize = blockDeviceSizeFromFD(fd); trimDevice(fd, argv[i], 0, bdsize); // only sending 1GiB for now close(fd); } else { perror("open"); } } return 0; }
--- +++ @@ -24,10 +24,10 @@ // signal(SIGINT, intHandler); for (size_t i = index; i < argc; i++) { - int fd = open(argv[i], O_WRONLY | O_EXCL | O_DIRECT); + int fd = open(argv[i], O_RDWR | O_EXCL | O_DIRECT ); if (fd >= 0) { size_t bdsize = blockDeviceSizeFromFD(fd); - trimDevice(fd, argv[i], 0, bdsize); // only sending 1GiB for now + trimDevice(fd, argv[i], 0, bdsize - 512); close(fd); } else { perror("open");
Subtract one old school sector
apache-2.0
dr-who/stutools,dr-who/stutools
5103d9b68accfc116275636d1a6068aa14df2d33
/*ckwg +5 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef VISTK_PROCESSES_HELPER_IMAGE_MACROS_H #define VISTK_PROCESSES_HELPER_IMAGE_MACROS_H #include <boost/cstdint.hpp> /** * \file macros.h * * \brief Macros to help manage templates. */ #define TYPE_CHECK(type, name, function) \ if (pixtype == pixtypes::pixtype_##name()) \ { \ return &function<type>; \ } #define SPECIFY_FUNCTION(function) \ TYPE_CHECK(bool, bool, function) \ else TYPE_CHECK(uint8_t, byte, function) \ else TYPE_CHECK(float, float, function) \ else TYPE_CHECK(double, double, function) #endif // VISTK_PROCESSES_HELPER_IMAGE_MACROS_H
/*ckwg +5 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef VISTK_PROCESSES_HELPER_IMAGE_MACROS_H #define VISTK_PROCESSES_HELPER_IMAGE_MACROS_H #include <boost/cstdint.hpp> /** * \file macros.h * * \brief Macros to help manage templates. */ #define TYPE_CHECK(type, name, function) \ if (pixtype == pixtypes::pixtype_##name()) \ { \ return &function<type>; \ } #define SPECIFY_FUNCTION(function) \ TYPE_CHECK(bool, bool, function) \ TYPE_CHECK(uint8_t, byte, function) \ TYPE_CHECK(float, float, function) \ TYPE_CHECK(double, double, function) #endif // VISTK_PROCESSES_HELPER_IMAGE_MACROS_H
--- +++ @@ -21,10 +21,10 @@ return &function<type>; \ } -#define SPECIFY_FUNCTION(function) \ - TYPE_CHECK(bool, bool, function) \ - TYPE_CHECK(uint8_t, byte, function) \ - TYPE_CHECK(float, float, function) \ - TYPE_CHECK(double, double, function) +#define SPECIFY_FUNCTION(function) \ + TYPE_CHECK(bool, bool, function) \ + else TYPE_CHECK(uint8_t, byte, function) \ + else TYPE_CHECK(float, float, function) \ + else TYPE_CHECK(double, double, function) #endif // VISTK_PROCESSES_HELPER_IMAGE_MACROS_H
Use else in comparison chain
bsd-3-clause
Kitware/sprokit,mathstuf/sprokit,Kitware/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,linus-sherrill/sprokit,Kitware/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,Kitware/sprokit,mathstuf/sprokit,linus-sherrill/sprokit
f8e8e58902fbaa14e2ea7c8a317747197d53bf37
#ifndef NPY_IMPORT_H #define NPY_IMPORT_H #include <Python.h> /*! \brief Fetch and cache Python function. * * Import a Python function and cache it for use. The function checks if * cache is NULL, and if not NULL imports the Python function specified by * \a module and \a function, increments its reference count, and stores * the result in \a cache. Usually \a cache will be a static variable and * should be initialized to NULL. On error \a cache will contain NULL on * exit, * * @param module Absolute module name. * @param function Function name. * @param cache Storage location for imported function. */ NPY_INLINE static void npy_cache_pyfunc(const char *module, const char *function, PyObject **cache) { if (*cache == NULL) { PyObject *mod = PyImport_ImportModule(module); if (mod != NULL) { *cache = PyObject_GetAttrString(mod, function); Py_DECREF(mod); } } } #endif
#ifndef NPY_IMPORT_H #define NPY_IMPORT_H #include <Python.h> #include <assert.h> /*! \brief Fetch and cache Python function. * * Import a Python function and cache it for use. The function checks if * cache is NULL, and if not NULL imports the Python function specified by * \a module and \a function, increments its reference count, and stores * the result in \a cache. Usually \a cache will be a static variable and * should be initialized to NULL. On error \a cache will contain NULL on * exit, * * @param module Absolute module name. * @param function Function name. * @param cache Storage location for imported function. */ NPY_INLINE void npy_cache_pyfunc(const char *module, const char *function, PyObject **cache) { if (*cache == NULL) { PyObject *mod = PyImport_ImportModule(module); if (mod != NULL) { *cache = PyObject_GetAttrString(mod, function); Py_DECREF(mod); } } } #endif
--- +++ @@ -2,7 +2,6 @@ #define NPY_IMPORT_H #include <Python.h> -#include <assert.h> /*! \brief Fetch and cache Python function. * @@ -17,7 +16,7 @@ * @param function Function name. * @param cache Storage location for imported function. */ -NPY_INLINE void +NPY_INLINE static void npy_cache_pyfunc(const char *module, const char *function, PyObject **cache) { if (*cache == NULL) {
BUG: Fix npy_cache_pyfunc to properly implement inline. The function was not static, which led to multiple definition errors.
bsd-3-clause
leifdenby/numpy,charris/numpy,sonnyhu/numpy,charris/numpy,has2k1/numpy,sinhrks/numpy,rhythmsosad/numpy,pdebuyl/numpy,jorisvandenbossche/numpy,mattip/numpy,stuarteberg/numpy,MaPePeR/numpy,Eric89GXL/numpy,MichaelAquilina/numpy,SiccarPoint/numpy,gmcastil/numpy,nguyentu1602/numpy,MSeifert04/numpy,maniteja123/numpy,mingwpy/numpy,pdebuyl/numpy,Anwesh43/numpy,gfyoung/numpy,seberg/numpy,jschueller/numpy,empeeu/numpy,GaZ3ll3/numpy,pbrod/numpy,anntzer/numpy,sinhrks/numpy,jakirkham/numpy,trankmichael/numpy,Yusa95/numpy,mwiebe/numpy,nbeaver/numpy,rgommers/numpy,shoyer/numpy,rherault-insa/numpy,ahaldane/numpy,jonathanunderwood/numpy,GrimDerp/numpy,joferkington/numpy,kirillzhuravlev/numpy,kirillzhuravlev/numpy,nbeaver/numpy,rudimeier/numpy,ekalosak/numpy,nguyentu1602/numpy,ahaldane/numpy,ahaldane/numpy,sinhrks/numpy,ddasilva/numpy,pbrod/numpy,AustereCuriosity/numpy,simongibbons/numpy,Eric89GXL/numpy,skwbc/numpy,pyparallel/numpy,dwillmer/numpy,kirillzhuravlev/numpy,gmcastil/numpy,empeeu/numpy,pdebuyl/numpy,GaZ3ll3/numpy,MichaelAquilina/numpy,shoyer/numpy,dwillmer/numpy,GrimDerp/numpy,mattip/numpy,jankoslavic/numpy,mattip/numpy,abalkin/numpy,Srisai85/numpy,ssanderson/numpy,KaelChen/numpy,endolith/numpy,cjermain/numpy,skymanaditya1/numpy,joferkington/numpy,shoyer/numpy,mathdd/numpy,gfyoung/numpy,GaZ3ll3/numpy,madphysicist/numpy,ChanderG/numpy,MSeifert04/numpy,has2k1/numpy,pdebuyl/numpy,jonathanunderwood/numpy,dimasad/numpy,musically-ut/numpy,skymanaditya1/numpy,madphysicist/numpy,githubmlai/numpy,mingwpy/numpy,CMartelLML/numpy,Dapid/numpy,grlee77/numpy,b-carter/numpy,bringingheavendown/numpy,has2k1/numpy,ContinuumIO/numpy,mingwpy/numpy,simongibbons/numpy,solarjoe/numpy,kiwifb/numpy,ChanderG/numpy,rajathkumarmp/numpy,madphysicist/numpy,stuarteberg/numpy,leifdenby/numpy,argriffing/numpy,grlee77/numpy,solarjoe/numpy,ESSS/numpy,sonnyhu/numpy,ahaldane/numpy,pbrod/numpy,bertrand-l/numpy,WarrenWeckesser/numpy,WarrenWeckesser/numpy,githubmlai/numpy,endolith/numpy,sonnyhu/numpy,mhvk/numpy,mhvk/numpy,b-carter/numpy,abalkin/numpy,jorisvandenbossche/numpy,groutr/numpy,numpy/numpy,Yusa95/numpy,maniteja123/numpy,utke1/numpy,ChanderG/numpy,jorisvandenbossche/numpy,skwbc/numpy,rajathkumarmp/numpy,trankmichael/numpy,AustereCuriosity/numpy,rhythmsosad/numpy,ekalosak/numpy,seberg/numpy,kirillzhuravlev/numpy,mwiebe/numpy,mingwpy/numpy,rhythmsosad/numpy,njase/numpy,chiffa/numpy,madphysicist/numpy,rudimeier/numpy,musically-ut/numpy,joferkington/numpy,jankoslavic/numpy,CMartelLML/numpy,ChristopherHogan/numpy,rudimeier/numpy,endolith/numpy,BabeNovelty/numpy,pizzathief/numpy,musically-ut/numpy,behzadnouri/numpy,moreati/numpy,mathdd/numpy,gfyoung/numpy,Anwesh43/numpy,KaelChen/numpy,seberg/numpy,solarjoe/numpy,tacaswell/numpy,skymanaditya1/numpy,Linkid/numpy,WarrenWeckesser/numpy,numpy/numpy,pbrod/numpy,ChristopherHogan/numpy,trankmichael/numpy,Linkid/numpy,mhvk/numpy,hainm/numpy,SiccarPoint/numpy,BabeNovelty/numpy,shoyer/numpy,CMartelLML/numpy,tacaswell/numpy,dimasad/numpy,tynn/numpy,empeeu/numpy,seberg/numpy,jakirkham/numpy,grlee77/numpy,dimasad/numpy,hainm/numpy,trankmichael/numpy,bringingheavendown/numpy,Anwesh43/numpy,kiwifb/numpy,numpy/numpy,nguyentu1602/numpy,Eric89GXL/numpy,felipebetancur/numpy,behzadnouri/numpy,WillieMaddox/numpy,MaPePeR/numpy,GrimDerp/numpy,rajathkumarmp/numpy,grlee77/numpy,BMJHayward/numpy,stuarteberg/numpy,dwillmer/numpy,MaPePeR/numpy,jakirkham/numpy,bmorris3/numpy,dwillmer/numpy,pizzathief/numpy,pizzathief/numpy,jakirkham/numpy,Srisai85/numpy,chatcannon/numpy,anntzer/numpy,ahaldane/numpy,WillieMaddox/numpy,grlee77/numpy,musically-ut/numpy,groutr/numpy,jschueller/numpy,mwiebe/numpy,charris/numpy,moreati/numpy,SiccarPoint/numpy,charris/numpy,jorisvandenbossche/numpy,GrimDerp/numpy,chatcannon/numpy,Srisai85/numpy,Anwesh43/numpy,stuarteberg/numpy,rgommers/numpy,cjermain/numpy,tynn/numpy,b-carter/numpy,abalkin/numpy,empeeu/numpy,nguyentu1602/numpy,drasmuss/numpy,ESSS/numpy,MSeifert04/numpy,pbrod/numpy,MSeifert04/numpy,jschueller/numpy,MichaelAquilina/numpy,mathdd/numpy,Dapid/numpy,cjermain/numpy,tacaswell/numpy,Srisai85/numpy,felipebetancur/numpy,BMJHayward/numpy,joferkington/numpy,MichaelAquilina/numpy,bertrand-l/numpy,hainm/numpy,mathdd/numpy,argriffing/numpy,skwbc/numpy,njase/numpy,ViralLeadership/numpy,maniteja123/numpy,SunghanKim/numpy,BMJHayward/numpy,BabeNovelty/numpy,pyparallel/numpy,ssanderson/numpy,bmorris3/numpy,pyparallel/numpy,KaelChen/numpy,ViralLeadership/numpy,SunghanKim/numpy,mhvk/numpy,sonnyhu/numpy,BMJHayward/numpy,rherault-insa/numpy,chiffa/numpy,anntzer/numpy,numpy/numpy,Yusa95/numpy,jorisvandenbossche/numpy,drasmuss/numpy,simongibbons/numpy,bmorris3/numpy,leifdenby/numpy,githubmlai/numpy,ddasilva/numpy,SunghanKim/numpy,ViralLeadership/numpy,ChristopherHogan/numpy,WarrenWeckesser/numpy,nbeaver/numpy,endolith/numpy,MSeifert04/numpy,njase/numpy,Dapid/numpy,SiccarPoint/numpy,moreati/numpy,Linkid/numpy,AustereCuriosity/numpy,madphysicist/numpy,ContinuumIO/numpy,rajathkumarmp/numpy,ChanderG/numpy,cjermain/numpy,KaelChen/numpy,behzadnouri/numpy,WillieMaddox/numpy,CMartelLML/numpy,jankoslavic/numpy,MaPePeR/numpy,rherault-insa/numpy,BabeNovelty/numpy,ddasilva/numpy,simongibbons/numpy,rgommers/numpy,mhvk/numpy,bringingheavendown/numpy,pizzathief/numpy,hainm/numpy,WarrenWeckesser/numpy,rudimeier/numpy,Linkid/numpy,SunghanKim/numpy,utke1/numpy,GaZ3ll3/numpy,drasmuss/numpy,ChristopherHogan/numpy,utke1/numpy,rgommers/numpy,jschueller/numpy,githubmlai/numpy,jakirkham/numpy,dimasad/numpy,anntzer/numpy,chiffa/numpy,Yusa95/numpy,bmorris3/numpy,jonathanunderwood/numpy,has2k1/numpy,gmcastil/numpy,kiwifb/numpy,tynn/numpy,chatcannon/numpy,argriffing/numpy,groutr/numpy,ContinuumIO/numpy,pizzathief/numpy,ESSS/numpy,ekalosak/numpy,felipebetancur/numpy,shoyer/numpy,Eric89GXL/numpy,ssanderson/numpy,jankoslavic/numpy,skymanaditya1/numpy,mattip/numpy,felipebetancur/numpy,rhythmsosad/numpy,simongibbons/numpy,bertrand-l/numpy,ekalosak/numpy,sinhrks/numpy
8c18581110925ebe9e2b3530d4d5fc4afefbc8b0
/* * Copyright (c) 2019, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <cdefs.h> #include <stdint.h> /* * Instruction pointer authentication key A. The low 64-bit are at [0], and the * high bits at [1]. */ uint64_t plat_apiakey[2]; /* * This is only a toy implementation to generate a seemingly random 128-bit key * from sp and x30 values. A production system must re-implement this function * to generate keys from a reliable randomness source. */ uint64_t *plat_init_apiakey(void) { uintptr_t return_addr = (uintptr_t)__builtin_return_address(0U); uintptr_t frame_addr = (uintptr_t)__builtin_frame_address(0U); plat_apiakey[0] = (return_addr << 13) ^ frame_addr; plat_apiakey[1] = (frame_addr << 15) ^ return_addr; return plat_apiakey; }
/* * Copyright (c) 2019, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <cdefs.h> #include <stdint.h> /* * Instruction pointer authentication key A. The low 64-bit are at [0], and the * high bits at [1]. They are run-time constants so they are placed in the * rodata section. They are written before MMU is turned on and the permissions * are effective. */ uint64_t plat_apiakey[2] __section("rodata.apiakey"); /* * This is only a toy implementation to generate a seemingly random 128-bit key * from sp and x30 values. A production system must re-implement this function * to generate keys from a reliable randomness source. */ uint64_t *plat_init_apiakey(void) { uintptr_t return_addr = (uintptr_t)__builtin_return_address(0U); uintptr_t frame_addr = (uintptr_t)__builtin_frame_address(0U); plat_apiakey[0] = (return_addr << 13) ^ frame_addr; plat_apiakey[1] = (frame_addr << 15) ^ return_addr; return plat_apiakey; }
--- +++ @@ -9,11 +9,9 @@ /* * Instruction pointer authentication key A. The low 64-bit are at [0], and the - * high bits at [1]. They are run-time constants so they are placed in the - * rodata section. They are written before MMU is turned on and the permissions - * are effective. + * high bits at [1]. */ -uint64_t plat_apiakey[2] __section("rodata.apiakey"); +uint64_t plat_apiakey[2]; /* * This is only a toy implementation to generate a seemingly random 128-bit key
Put Pointer Authentication key value in BSS section The dummy implementation of the plat_init_apiakey() platform API uses an internal 128-bit buffer to store the initial key value used for Pointer Authentication support. The intent - as stated in the file comments - was for this buffer to be write-protected by the MMU. Initialization of the buffer would be performed before enabling the MMU, thus bypassing write protection checks. However, the key buffer ended up into its own read-write section by mistake due to a typo on the section name ('rodata.apiakey' instead of '.rodata.apiakey', note the leading dot). As a result, the linker script was not pulling it into the .rodata output section. One way to address this issue could have been to fix the section name. However, this approach does not work well for BL1. Being the first image in the boot flow, it typically is sitting in real ROM so we don't have the capacity to update the key buffer at any time. The dummy implementation of plat_init_apiakey() provided at the moment is just there to demonstrate the Pointer Authentication feature in action. Proper key management and key generation would have to be a lot more careful on a production system. Therefore, the approach chosen here to leave the key buffer in writable memory but move it to the BSS section. This does mean that the key buffer could be maliciously updated for intalling unintended keys on the warm boot path but at the feature is only at an experimental stage right now, this is deemed acceptable. Change-Id: I121ccf35fe7bc86c73275a4586b32d4bc14698d6 Signed-off-by: Sandrine Bailleux <4b69fcfca8da45b0c11ecda5434c5da526575d9d@arm.com>
bsd-3-clause
achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware
47102b35d644a8c5a1343f9ec05c29b5d1e0e1b0
#include <stdio.h> #include <mpi.h> #include <unistd.h> #include "hello_mpi.h" int hello_mpi(void) { int numprocs, rank, namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(NULL, NULL); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processor_name(processor_name, &namelen); // printf("Process %d on %s out of %d\n", rank, processor_name, numprocs); if (rank == 0) { printf("I'm master\n"); int slaves_rank = -1; int i; MPI_Status status; MPI_Request request; for (i = 1; i < numprocs; i++) { MPI_Irecv(&slaves_rank, 1, MPI_INT, i, 10111, MPI_COMM_WORLD, &request); MPI_Wait(&request, &status); printf("Master got reply from %d and request is: %d\n", slaves_rank, request); } } else { MPI_Request request; MPI_Isend((void*)&rank, 1, MPI_INT, 0, 10111, MPI_COMM_WORLD, &request); printf("Only a slave - with request %d\n", request); } MPI_Finalize(); return 0; }
#include <stdio.h> #include <mpi.h> #include "hello_mpi.h" int hello_mpi(void) { int numprocs, rank, namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(NULL, NULL); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processor_name(processor_name, &namelen); // printf("Process %d on %s out of %d\n", rank, processor_name, numprocs); if (rank == 0) { printf("I'm master\n"); int slaves_rank = -1; int i; struct MPI_Status status; for (i = 1; i < numprocs; i++) { MPI_Recv(&slaves_rank, 1, MPI_INT, i,10111, MPI_COMM_WORLD, &status); printf("Master got reply from %d and status is: %d\n", slaves_rank, status.MPI_ERROR); } } else { printf("Only a slave\n"); MPI_Send((void*)&rank, 1, MPI_INT, 0, 10111, MPI_COMM_WORLD); } MPI_Finalize(); return 0; }
--- +++ @@ -1,5 +1,6 @@ #include <stdio.h> #include <mpi.h> +#include <unistd.h> #include "hello_mpi.h" @@ -17,16 +18,19 @@ printf("I'm master\n"); int slaves_rank = -1; int i; - struct MPI_Status status; + MPI_Status status; + MPI_Request request; for (i = 1; i < numprocs; i++) { - MPI_Recv(&slaves_rank, 1, MPI_INT, i,10111, MPI_COMM_WORLD, &status); - printf("Master got reply from %d and status is: %d\n", slaves_rank, - status.MPI_ERROR); + MPI_Irecv(&slaves_rank, 1, MPI_INT, i, 10111, MPI_COMM_WORLD, &request); + MPI_Wait(&request, &status); + printf("Master got reply from %d and request is: %d\n", slaves_rank, + request); } } else { - printf("Only a slave\n"); - MPI_Send((void*)&rank, 1, MPI_INT, 0, 10111, MPI_COMM_WORLD); + MPI_Request request; + MPI_Isend((void*)&rank, 1, MPI_INT, 0, 10111, MPI_COMM_WORLD, &request); + printf("Only a slave - with request %d\n", request); } MPI_Finalize();
Convert from MPI_Send/Recv, to MPI_ISend/IRecv
mit
Convolution-filter/convolution-filter-MPI
b6a04637c81e41c348e985c78f3e9f3009a19826
#ifndef __PARSE_GIT_ST_H #define __PARSE_GIT_ST_H #include <vector> #include <string> const int PIPE_LINE_BUFFER_SIZE = 256; class GitStatusParser { std::vector<std::string*> pipe_buffer; std::string* branch; std::vector<std::string*> new_files; std::vector<std::string*> modified_files; std::vector<std::string*> untracked_files; public: GitStatusParser(); ~GitStatusParser(); void parse(); std::string* getBranch() { return branch; } std::vector<std::string*> getNewFiles() { return new_files; } std::vector<std::string*> getModifiedFiles() { return modified_files; } std::vector<std::string*> getUntrackedFiles() { return untracked_files; } private: void load(); void parseBranch(); void parseNewFiles(); void parseModifiedFiles(); void parseUntrackedFiles(); }; #endif
#ifndef __PARSE_GIT_ST_H #define __PARSE_GIT_ST_H #include <vector> #include <string> const int PIPE_LINE_BUFFER_SIZE = 256; class GitStatusParser { std::vector<std::string*> pipe_buffer; std::string* branch; std::vector<std::string*> new_files; std::vector<std::string*> modified_files; std::vector<std::string*> untracked_files; public: GitStatusParser(); ~GitStatusParser(); void parse(); private: void load(); void parseBranch(); void parseNewFiles(); void parseModifiedFiles(); void parseUntrackedFiles(); }; #endif
--- +++ @@ -20,6 +20,11 @@ ~GitStatusParser(); void parse(); + std::string* getBranch() { return branch; } + std::vector<std::string*> getNewFiles() { return new_files; } + std::vector<std::string*> getModifiedFiles() { return modified_files; } + std::vector<std::string*> getUntrackedFiles() { return untracked_files; } + private: void load();
Add getters for branch and files.
mit
tomaszwojcik/git-ec,tomaszwojcik/git-ec
958bfb18a876a10d862ba71a34c67bf15ccf3274
/* * Copyright (C) 2015 CossackLabs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import <Foundation/Foundation.h> #import <themis/themis.h> @interface SMessage : NSObject { NSMutableData* _priv_key; NSMutableData* _pub_key; } - (id)initWithPrivateKey: (NSData*)private_key peerPublicKey:(NSData*)peer_pub_key; - (NSData*)wrap: (NSData*)message error:(NSError**)errorPtr; - (NSData*)unwrap: (NSData*)message error:(NSError**)errorPtr; @end
/* * Copyright (C) 2015 CossackLabs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import <Foundation/Foundation.h> #import <themis/themis.h> @interface SKeygen : NSObject { NSData* _priv_key; NSData* _pub_key; } - (id)init; - (NSData*)priv_key: error:(NSError**)errorPtr; - (NSData*)pub_key: error:(NSError**)errorPtr; @end
--- +++ @@ -17,15 +17,15 @@ #import <Foundation/Foundation.h> #import <themis/themis.h> -@interface SKeygen : NSObject +@interface SMessage : NSObject { - NSData* _priv_key; - NSData* _pub_key; + NSMutableData* _priv_key; + NSMutableData* _pub_key; } -- (id)init; -- (NSData*)priv_key: error:(NSError**)errorPtr; -- (NSData*)pub_key: error:(NSError**)errorPtr; +- (id)initWithPrivateKey: (NSData*)private_key peerPublicKey:(NSData*)peer_pub_key; +- (NSData*)wrap: (NSData*)message error:(NSError**)errorPtr; +- (NSData*)unwrap: (NSData*)message error:(NSError**)errorPtr; @end
Add some correction to Obj-C wrappers
apache-2.0
mnaza/themis,storojs72/themis,cossacklabs/themis,Lagovas/themis,storojs72/themis,mnaza/themis,storojs72/themis,cossacklabs/themis,Lagovas/themis,storojs72/themis,mnaza/themis,cossacklabs/themis,mnaza/themis,cossacklabs/themis,Lagovas/themis,Lagovas/themis,cossacklabs/themis,cossacklabs/themis,storojs72/themis,storojs72/themis,storojs72/themis,cossacklabs/themis,mnaza/themis,cossacklabs/themis,cossacklabs/themis,cossacklabs/themis,mnaza/themis,cossacklabs/themis,storojs72/themis,cossacklabs/themis,mnaza/themis,Lagovas/themis,Lagovas/themis,Lagovas/themis,mnaza/themis,Lagovas/themis,storojs72/themis,Lagovas/themis,mnaza/themis,cossacklabs/themis,storojs72/themis
eae3d77193813825d7c4cb8dcb86d341c0b5b756
/** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * 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. */ /** * * @file libscp_init.c * @brief libscp initialization code * @author Simone Fedele * */ #include "libscp_init.h" //struct log_config* s_log; /* server API */ int DEFAULT_CC scp_init() { /* if (0 == log) { return 1; } */ //s_log = log; scp_lock_init(); log_message(LOG_LEVEL_DEBUG, "libscp initialized"); return 0; }
/** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * 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. */ /** * * @file libscp_init.c * @brief libscp initialization code * @author Simone Fedele * */ #include "libscp_init.h" //struct log_config* s_log; /* server API */ int DEFAULT_CC scp_init() { /* if (0 == log) { return 1; } */ //s_log = log; scp_lock_init(); log_message(LOG_LEVEL_WARNING, "[init:%d] libscp initialized", __LINE__); return 0; }
--- +++ @@ -43,7 +43,7 @@ scp_lock_init(); - log_message(LOG_LEVEL_WARNING, "[init:%d] libscp initialized", __LINE__); + log_message(LOG_LEVEL_DEBUG, "libscp initialized"); return 0; }
Downgrade "libscp initialized" to LOG_LEVEL_DEBUG, remove line number It's a bad style to start the log with a cryptic warning.
apache-2.0
metalefty/xrdp,moobyfr/xrdp,itamarjp/xrdp,PKRoma/xrdp,PKRoma/xrdp,jsorg71/xrdp,cocoon/xrdp,ubuntu-xrdp/xrdp,ubuntu-xrdp/xrdp,itamarjp/xrdp,neutrinolabs/xrdp,itamarjp/xrdp,moobyfr/xrdp,proski/xrdp,jsorg71/xrdp,metalefty/xrdp,moobyfr/xrdp,neutrinolabs/xrdp,neutrinolabs/xrdp,cocoon/xrdp,metalefty/xrdp,proski/xrdp,cocoon/xrdp,proski/xrdp,jsorg71/xrdp,ubuntu-xrdp/xrdp,PKRoma/xrdp
f908528a004812c36a27a6705f8d2453cc9084c4
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.50f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.49f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
--- +++ @@ -3,7 +3,7 @@ // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. -const float kCurrentVersion = 1.49f; +const float kCurrentVersion = 1.50f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor
Change version number to 1.50
apache-2.0
ariccio/UIforETW,google/UIforETW,ariccio/UIforETW,google/UIforETW,ariccio/UIforETW,ariccio/UIforETW,google/UIforETW,google/UIforETW
adca044ede25200548c3b2b4dbdcf8e1ddc40959
// 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 CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_ #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_ #include "build/build_config.h" class Browser; class ExtensionService; // Only enable the external install UI on Windows and Mac, because those // are the platforms where external installs are the biggest issue. #if defined(OS_WIN) || defined(OS_MACOSX) #define ENABLE_EXTERNAL_INSTALL_UI 1 #else #define ENABLE_EXTERNAL_INSTALL_UI 0 #endif namespace extensions { class Extension; // Adds/Removes a global error informing the user that an external extension // was installed. bool AddExternalInstallError(ExtensionService* service, const Extension* extension); void RemoveExternalInstallError(ExtensionService* service); // Used for testing. bool HasExternalInstallError(ExtensionService* service); } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_ #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_ class Browser; class ExtensionService; // Only enable the external install UI on Windows and Mac, because those // are the platforms where external installs are the biggest issue. #if defined(OS_WINDOWS) || defined(OS_MACOSX) #define ENABLE_EXTERNAL_INSTALL_UI 1 #else #define ENABLE_EXTERNAL_INSTALL_UI 0 #endif namespace extensions { class Extension; // Adds/Removes a global error informing the user that an external extension // was installed. bool AddExternalInstallError(ExtensionService* service, const Extension* extension); void RemoveExternalInstallError(ExtensionService* service); // Used for testing. bool HasExternalInstallError(ExtensionService* service); } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_
--- +++ @@ -5,12 +5,14 @@ #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_ #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_UI_H_ +#include "build/build_config.h" + class Browser; class ExtensionService; // Only enable the external install UI on Windows and Mac, because those // are the platforms where external installs are the biggest issue. -#if defined(OS_WINDOWS) || defined(OS_MACOSX) +#if defined(OS_WIN) || defined(OS_MACOSX) #define ENABLE_EXTERNAL_INSTALL_UI 1 #else #define ENABLE_EXTERNAL_INSTALL_UI 0
Fix external extension install (post-sideload) restriction on Windows. I had #ifdef'd it to OS_WINDOWS. It should be OS_WIN. BUG=156727 Review URL: https://codereview.chromium.org/11238042 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@163418 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
Jonekee/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,dednal/chromium.src,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,Chilledheart/chromium,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,Jonekee/chromium.src,markYoungH/chromium.src,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,littlstar/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,littlstar/chromium.src,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,dednal/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,littlstar/chromium.src,Just-D/chromium-1,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,patrickm/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,anirudhSK/chromium,jaruba/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,littlstar/chromium.src,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,Jonekee/chromium.src,zcbenz/cefode-chromium,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,zcbenz/cefode-chromium,anirudhSK/chromium,anirudhSK/chromium,axinging/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,zcbenz/cefode-chromium,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,Chilledheart/chromium,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,M4sse/chromium.src,ltilve/chromium,markYoungH/chromium.src,M4sse/chromium.src,dednal/chromium.src,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,axinging/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,zcbenz/cefode-chromium,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,M4sse/chromium.src,jaruba/chromium.src,nacl-webkit/chrome_deps,dushu1203/chromium.src,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,jaruba/chromium.src,patrickm/chromium.src,jaruba/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,timopulkkinen/BubbleFish,ondra-novak/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,hujiajie/pa-chromium,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,ltilve/chromium,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,patrickm/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ltilve/chromium,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,anirudhSK/chromium,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,patrickm/chromium.src,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ltilve/chromium,hujiajie/pa-chromium,timopulkkinen/BubbleFish,dednal/chromium.src,ondra-novak/chromium.src,hujiajie/pa-chromium
6c12c50736a7f2cce5d8776c9d64b85e3435aec6
// RUN: %clang -S -v -o %t %s 2>&1 | FileCheck %s // CHECK-NOT: -g // RUN: %clang -S -v -o %t %s -g 2>&1 | FileCheck %s // CHECK: -g // RUN: %clang -S -v -o %t %s -g0 2>&1 | FileCheck %s // CHECK-NOT: -g // RUN: %clang -S -v -o %t %s -g -g0 2>&1 | FileCheck %s // CHECK-NOT: -g // RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | FileCheck %s // CHECK: -g
// RUN: %clang -S -v -o %t %s 2>&1 | not grep -w -- -g // RUN: %clang -S -v -o %t %s -g 2>&1 | grep -w -- -g // RUN: %clang -S -v -o %t %s -g0 2>&1 | not grep -w -- -g // RUN: %clang -S -v -o %t %s -g -g0 2>&1 | not grep -w -- -g // RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | grep -w -- -g
--- +++ @@ -1,5 +1,14 @@ -// RUN: %clang -S -v -o %t %s 2>&1 | not grep -w -- -g -// RUN: %clang -S -v -o %t %s -g 2>&1 | grep -w -- -g -// RUN: %clang -S -v -o %t %s -g0 2>&1 | not grep -w -- -g -// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | not grep -w -- -g -// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | grep -w -- -g +// RUN: %clang -S -v -o %t %s 2>&1 | FileCheck %s +// CHECK-NOT: -g + +// RUN: %clang -S -v -o %t %s -g 2>&1 | FileCheck %s +// CHECK: -g + +// RUN: %clang -S -v -o %t %s -g0 2>&1 | FileCheck %s +// CHECK-NOT: -g + +// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | FileCheck %s +// CHECK-NOT: -g + +// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | FileCheck %s +// CHECK: -g
Move a non portable test to FileCheck, from Jonathan Gray! git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@155874 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,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
1de801a7120e0e8a2c7614265880452a20a38a29
#include <stddef.h> #include <unistd.h> int main(int argc, char *argv[]) { #ifdef __MINGW32__ const #endif char * args[2] = {"T7037", NULL}; execv("./T7037", args); }
#include <stddef.h> #include <unistd.h> int main(int argc, char *argv[]) { const char *args[2] = {"T7037", NULL}; execv("./T7037", args); }
--- +++ @@ -2,6 +2,9 @@ #include <unistd.h> int main(int argc, char *argv[]) { - const char *args[2] = {"T7037", NULL}; +#ifdef __MINGW32__ + const +#endif + char * args[2] = {"T7037", NULL}; execv("./T7037", args); }
Make T7037 work on both Windows and other platforms
bsd-3-clause
mcschroeder/ghc,forked-upstream-packages-for-ghcjs/ghc,tibbe/ghc,ryantm/ghc,TomMD/ghc,oldmanmike/ghc,nkaretnikov/ghc,mettekou/ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,nkaretnikov/ghc,mfine/ghc,mettekou/ghc,mcschroeder/ghc,AlexanderPankiv/ghc,christiaanb/ghc,snoyberg/ghc,ghc-android/ghc,snoyberg/ghc,christiaanb/ghc,hferreiro/replay,spacekitteh/smcghc,acowley/ghc,fmthoma/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,ghc-android/ghc,da-x/ghc,nushio3/ghc,nkaretnikov/ghc,bitemyapp/ghc,anton-dessiatov/ghc,holzensp/ghc,nkaretnikov/ghc,oldmanmike/ghc,vikraman/ghc,bitemyapp/ghc,tjakway/ghcjvm,anton-dessiatov/ghc,elieux/ghc,christiaanb/ghc,oldmanmike/ghc,TomMD/ghc,vikraman/ghc,spacekitteh/smcghc,mfine/ghc,frantisekfarka/ghc-dsi,ryantm/ghc,frantisekfarka/ghc-dsi,sdiehl/ghc,vikraman/ghc,jstolarek/ghc,GaloisInc/halvm-ghc,forked-upstream-packages-for-ghcjs/ghc,nathyong/microghc-ghc,holzensp/ghc,elieux/ghc,anton-dessiatov/ghc,fmthoma/ghc,lukexi/ghc-7.8-arm64,nushio3/ghc,christiaanb/ghc,mettekou/ghc,nushio3/ghc,hferreiro/replay,nkaretnikov/ghc,forked-upstream-packages-for-ghcjs/ghc,ezyang/ghc,sgillespie/ghc,ghc-android/ghc,mettekou/ghc,sgillespie/ghc,gridaphobe/ghc,sgillespie/ghc,AlexanderPankiv/ghc,da-x/ghc,vTurbine/ghc,urbanslug/ghc,ryantm/ghc,christiaanb/ghc,anton-dessiatov/ghc,elieux/ghc,oldmanmike/ghc,holzensp/ghc,TomMD/ghc,urbanslug/ghc,siddhanathan/ghc,snoyberg/ghc,elieux/ghc,gcampax/ghc,ml9951/ghc,ezyang/ghc,shlevy/ghc,oldmanmike/ghc,bitemyapp/ghc,urbanslug/ghc,GaloisInc/halvm-ghc,urbanslug/ghc,green-haskell/ghc,urbanslug/ghc,nushio3/ghc,jstolarek/ghc,frantisekfarka/ghc-dsi,hferreiro/replay,olsner/ghc,forked-upstream-packages-for-ghcjs/ghc,forked-upstream-packages-for-ghcjs/ghc,anton-dessiatov/ghc,sdiehl/ghc,nushio3/ghc,tibbe/ghc,vTurbine/ghc,wxwxwwxxx/ghc,mettekou/ghc,ml9951/ghc,nkaretnikov/ghc,acowley/ghc,da-x/ghc,GaloisInc/halvm-ghc,da-x/ghc,shlevy/ghc,olsner/ghc,gcampax/ghc,oldmanmike/ghc,snoyberg/ghc,olsner/ghc,vTurbine/ghc,lukexi/ghc-7.8-arm64,sdiehl/ghc,green-haskell/ghc,ezyang/ghc,hferreiro/replay,tibbe/ghc,nathyong/microghc-ghc,gridaphobe/ghc,sdiehl/ghc,ml9951/ghc,sdiehl/ghc,wxwxwwxxx/ghc,TomMD/ghc,anton-dessiatov/ghc,nathyong/microghc-ghc,ezyang/ghc,sgillespie/ghc,ml9951/ghc,urbanslug/ghc,AlexanderPankiv/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,lukexi/ghc,ezyang/ghc,wxwxwwxxx/ghc,vTurbine/ghc,sgillespie/ghc,gridaphobe/ghc,lukexi/ghc,tjakway/ghcjvm,bitemyapp/ghc,olsner/ghc,tjakway/ghcjvm,acowley/ghc,mcschroeder/ghc,christiaanb/ghc,gcampax/ghc,fmthoma/ghc,lukexi/ghc,christiaanb/ghc,AlexanderPankiv/ghc,hferreiro/replay,ml9951/ghc,gridaphobe/ghc,olsner/ghc,mfine/ghc,ml9951/ghc,olsner/ghc,lukexi/ghc,vikraman/ghc,shlevy/ghc,fmthoma/ghc,olsner/ghc,shlevy/ghc,mfine/ghc,tibbe/ghc,siddhanathan/ghc,AlexanderPankiv/ghc,ezyang/ghc,bitemyapp/ghc,tjakway/ghcjvm,mcschroeder/ghc,ezyang/ghc,wxwxwwxxx/ghc,gcampax/ghc,mcschroeder/ghc,holzensp/ghc,lukexi/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,nkaretnikov/ghc,hferreiro/replay,gcampax/ghc,sdiehl/ghc,nathyong/microghc-ghc,sgillespie/ghc,ghc-android/ghc,jstolarek/ghc,siddhanathan/ghc,ryantm/ghc,spacekitteh/smcghc,lukexi/ghc-7.8-arm64,ghc-android/ghc,ml9951/ghc,fmthoma/ghc,mfine/ghc,green-haskell/ghc,gcampax/ghc,TomMD/ghc,da-x/ghc,acowley/ghc,mettekou/ghc,forked-upstream-packages-for-ghcjs/ghc,ghc-android/ghc,vikraman/ghc,fmthoma/ghc,vTurbine/ghc,mettekou/ghc,nushio3/ghc,sdiehl/ghc,green-haskell/ghc,vTurbine/ghc,frantisekfarka/ghc-dsi,acowley/ghc,elieux/ghc,gridaphobe/ghc,snoyberg/ghc,gridaphobe/ghc,vTurbine/ghc,ghc-android/ghc,tjakway/ghcjvm,snoyberg/ghc,fmthoma/ghc,nushio3/ghc,ryantm/ghc,mcschroeder/ghc,nathyong/microghc-ghc,holzensp/ghc,vikraman/ghc,elieux/ghc,hferreiro/replay,wxwxwwxxx/ghc,mfine/ghc,elieux/ghc,acowley/ghc,lukexi/ghc-7.8-arm64,wxwxwwxxx/ghc,ml9951/ghc,shlevy/ghc,jstolarek/ghc,da-x/ghc,shlevy/ghc,nathyong/microghc-ghc,tjakway/ghcjvm,mfine/ghc,sgillespie/ghc,gcampax/ghc,acowley/ghc,oldmanmike/ghc,anton-dessiatov/ghc,nathyong/microghc-ghc,spacekitteh/smcghc,vikraman/ghc,urbanslug/ghc,lukexi/ghc-7.8-arm64,spacekitteh/smcghc,TomMD/ghc,AlexanderPankiv/ghc,jstolarek/ghc,siddhanathan/ghc,mcschroeder/ghc,TomMD/ghc,forked-upstream-packages-for-ghcjs/ghc,shlevy/ghc,da-x/ghc,AlexanderPankiv/ghc,gridaphobe/ghc,siddhanathan/ghc,frantisekfarka/ghc-dsi,tibbe/ghc,snoyberg/ghc,green-haskell/ghc
188b56251284352d2a2da90d5fab31276a834ff7
#define PY_SSIZE_T_CLEAN #include <Python.h> static PyObject* websocket_mask(PyObject* self, PyObject* args) { const char* mask; Py_ssize_t mask_len; const char* data; Py_ssize_t data_len; Py_ssize_t i; PyObject* result; char* buf; if (!PyArg_ParseTuple(args, "s#s#", &mask, &mask_len, &data, &data_len)) { return NULL; } result = PyBytes_FromStringAndSize(NULL, data_len); if (!result) { return NULL; } buf = PyBytes_AsString(result); for (i = 0; i < data_len; i++) { buf[i] = data[i] ^ mask[i % 4]; } return result; } static PyMethodDef methods[] = { {"websocket_mask", websocket_mask, METH_VARARGS, ""}, {NULL, NULL, 0, NULL} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef speedupsmodule = { PyModuleDef_HEAD_INIT, "speedups", NULL, -1, methods }; PyMODINIT_FUNC PyInit_speedups() { return PyModule_Create(&speedupsmodule); } #else // Python 2.x PyMODINIT_FUNC initspeedups() { Py_InitModule("tornado.speedups", methods); } #endif
#include <Python.h> static PyObject* websocket_mask(PyObject* self, PyObject* args) { const char* mask; int mask_len; const char* data; int data_len; int i; if (!PyArg_ParseTuple(args, "s#s#", &mask, &mask_len, &data, &data_len)) { return NULL; } PyObject* result = PyBytes_FromStringAndSize(NULL, data_len); if (!result) { return NULL; } char* buf = PyBytes_AsString(result); for (i = 0; i < data_len; i++) { buf[i] = data[i] ^ mask[i % 4]; } return result; } static PyMethodDef methods[] = { {"websocket_mask", websocket_mask, METH_VARARGS, ""}, {NULL, NULL, 0, NULL} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef speedupsmodule = { PyModuleDef_HEAD_INIT, "speedups", NULL, -1, methods }; PyMODINIT_FUNC PyInit_speedups() { return PyModule_Create(&speedupsmodule); } #else // Python 2.x PyMODINIT_FUNC initspeedups() { Py_InitModule("tornado.speedups", methods); } #endif
--- +++ @@ -1,21 +1,24 @@ +#define PY_SSIZE_T_CLEAN #include <Python.h> static PyObject* websocket_mask(PyObject* self, PyObject* args) { const char* mask; - int mask_len; + Py_ssize_t mask_len; const char* data; - int data_len; - int i; + Py_ssize_t data_len; + Py_ssize_t i; + PyObject* result; + char* buf; if (!PyArg_ParseTuple(args, "s#s#", &mask, &mask_len, &data, &data_len)) { return NULL; } - PyObject* result = PyBytes_FromStringAndSize(NULL, data_len); + result = PyBytes_FromStringAndSize(NULL, data_len); if (!result) { return NULL; } - char* buf = PyBytes_AsString(result); + buf = PyBytes_AsString(result); for (i = 0; i < data_len; i++) { buf[i] = data[i] ^ mask[i % 4]; }
Fix msvc compile error and improve 64 bit compatibility
apache-2.0
whip112/tornado,wujuguang/tornado,kippandrew/tornado,legnaleurc/tornado,sxfmol/tornado,VShangxiao/tornado,andyaguiar/tornado,jparise/tornado,takeshineshiro/tornado,futurechallenger/tornado,0x73/tornado,InverseLina/tornado,dongpinglai/my_tornado,ymero/tornado,elelianghh/tornado,wxhzk/tornado-1,Aaron1992/tornado,icejoywoo/tornado,hzruandd/tornado,tianyk/tornado-research,yangkf1985/tornado,eXcomm/tornado,Polyconseil/tornado,wsyzxcn/tornado,codeb2cc/tornado,codecov/tornado,xinyu7/tornado,anandology/tornado,VShangxiao/tornado,tianyk/tornado-research,tianyk/tornado-research,anandology/tornado,Geoion/tornado,hzruandd/tornado,arthurdarcet/tornado,noxiouz/tornado,yuezhonghua/tornado,ymero/tornado,ovidiucp/tornado,allenl203/tornado,Lancher/tornado,jarrahwu/tornado,Lancher/tornado,VShangxiao/tornado,felixonmars/tornado,fengsp/tornado,yuezhonghua/tornado,ajdavis/tornado,elijah513/tornado,bywbilly/tornado,bdarnell/tornado,cyrusin/tornado,Aaron1992/tornado,pombredanne/tornado,zguangyu/tornado,kangbiao/tornado,ZhuPeng/tornado,arthurdarcet/tornado,djt5019/tornado,ZhuPeng/tornado,anjan-srivastava/tornado,0x73/tornado,BencoLee/tornado,ydaniv/tornado,QuanZag/tornado,frtmelody/tornado,Windsooon/tornado,ColorFuzzy/tornado,AlphaStaxLLC/tornado,Fydot/tornado,0xkag/tornado,yuyangit/tornado,johan--/tornado,NoyaInRain/tornado,Geoion/tornado,kangbiao/tornado,Snamint/tornado,djt5019/tornado,whip112/tornado,shaohung001/tornado,mehmetkose/tornado,pombredanne/tornado,Polyconseil/tornado,liqueur/tornado,gwillem/tornado,hzruandd/tornado,djt5019/tornado,johan--/tornado,nordaux/tornado,gwillem/tornado,Fydot/tornado,304471720/tornado,ydaniv/tornado,Windsooon/tornado,ubear/tornado,AlphaStaxLLC/tornado,mehmetkose/tornado,lsanotes/tornado,shashankbassi92/tornado,shashankbassi92/tornado,yuezhonghua/tornado,zhuochenKIDD/tornado,Polyconseil/tornado,akalipetis/tornado,lilydjwg/tornado,jehiah/tornado,fengshao0907/tornado,mivade/tornado,gwillem/tornado,dongpinglai/my_tornado,sevenguin/tornado,cyrilMargaria/tornado,legnaleurc/tornado,noxiouz/tornado,MjAbuz/tornado,kaushik94/tornado,Windsooon/tornado,wujuguang/tornado,djt5019/tornado,LTD-Beget/tornado,noxiouz/tornado,ymero/tornado,cyrusin/tornado,cyrusin/tornado,kippandrew/tornado,liqueur/tornado,sunjeammy/tornado,dsseter/tornado,bywbilly/tornado,bdarnell/tornado,whip112/tornado,Polyconseil/tornado,gitchs/tornado,coderhaoxin/tornado,Callwoola/tornado,kevinge314gh/tornado,arthurdarcet/tornado,elijah513/tornado,0x73/tornado,liqueur/tornado,gitchs/tornado,LTD-Beget/tornado,sxfmol/tornado,frtmelody/tornado,mehmetkose/tornado,erichuang1994/tornado,mr-ping/tornado,shashankbassi92/tornado,NoyaInRain/tornado,importcjj/tornado,lsanotes/tornado,dongpinglai/my_tornado,pombredanne/tornado,codeb2cc/tornado,eklitzke/tornado,eXcomm/tornado,mivade/tornado,dsseter/tornado,insflow/tornado,ajdavis/tornado,nephics/tornado,obsh/tornado,fengsp/tornado,wujuguang/tornado,chenxiaba/tornado,sxfmol/tornado,anjan-srivastava/tornado,noxiouz/tornado,andyaguiar/tornado,takeshineshiro/tornado,ajdavis/tornado,importcjj/tornado,arthurdarcet/tornado,kippandrew/tornado,dongpinglai/my_tornado,0x73/tornado,jarrahwu/tornado,wechasing/tornado,sxfmol/tornado,zhuochenKIDD/tornado,takeshineshiro/tornado,AlphaStaxLLC/tornado,304471720/tornado,fengshao0907/tornado,yangkf1985/tornado,ms7s/tornado,drewmiller/tornado,SuminAndrew/tornado,shashankbassi92/tornado,chenxiaba/tornado,Polyconseil/tornado,futurechallenger/tornado,leekchan/tornado_test,InverseLina/tornado,obsh/tornado,elijah513/tornado,arthurdarcet/tornado,hhru/tornado,allenl203/tornado,wxhzk/tornado-1,kevinge314gh/tornado,jehiah/tornado,ifduyue/tornado,jarrahwu/tornado,ZhuPeng/tornado,elijah513/tornado,0xkag/tornado,jonashagstedt/tornado,sevenguin/tornado,drewmiller/tornado,whip112/tornado,xinyu7/tornado,Batterfii/tornado,cyrilMargaria/tornado,lujinda/tornado,InverseLina/tornado,andyaguiar/tornado,nbargnesi/tornado,jparise/tornado,codeb2cc/tornado,codecov/tornado,jarrahwu/tornado,sunjeammy/tornado,chenxiaba/tornado,cyrilMargaria/tornado,ms7s/tornado,QuanZag/tornado,elijah513/tornado,Acidburn0zzz/tornado,QuanZag/tornado,mlyundin/tornado,chenxiaba/tornado,sevenguin/tornado,z-fork/tornado,wxhzk/tornado-1,codecov/tornado,jsjohnst/tornado,InverseLina/tornado,coderhaoxin/tornado,MjAbuz/tornado,anandology/tornado,fengshao0907/tornado,icejoywoo/tornado,shashankbassi92/tornado,mr-ping/tornado,z-fork/tornado,Batterfii/tornado,drewmiller/tornado,nordaux/tornado,Geoion/tornado,ColorFuzzy/tornado,mlyundin/tornado,zhuochenKIDD/tornado,eklitzke/tornado,eXcomm/tornado,Lancher/tornado,nbargnesi/tornado,takeshineshiro/tornado,ListFranz/tornado,cyrilMargaria/tornado,ColorFuzzy/tornado,allenl203/tornado,andyaguiar/tornado,futurechallenger/tornado,importcjj/tornado,djt5019/tornado,hhru/tornado,fengsp/tornado,gitchs/tornado,bdarnell/tornado,kaushik94/tornado,Geoion/tornado,SuminAndrew/tornado,allenl203/tornado,tornadoweb/tornado,LTD-Beget/tornado,sunjeammy/tornado,gwillem/tornado,drewmiller/tornado,Drooids/tornado,elelianghh/tornado,ListFranz/tornado,lsanotes/tornado,futurechallenger/tornado,anjan-srivastava/tornado,MjAbuz/tornado,Callwoola/tornado,LTD-Beget/tornado,cyrusin/tornado,nordaux/tornado,djt5019/tornado,sunjeammy/tornado,jsjohnst/tornado,NoyaInRain/tornado,kangbiao/tornado,304471720/tornado,Drooids/tornado,nbargnesi/tornado,SuminAndrew/tornado,Aaron1992/tornado,Drooids/tornado,zhuochenKIDD/tornado,johan--/tornado,importcjj/tornado,yuezhonghua/tornado,yangkf1985/tornado,Fydot/tornado,kevinge314gh/tornado,jonashagstedt/tornado,fengsp/tornado,cyrilMargaria/tornado,tornadoweb/tornado,ListFranz/tornado,allenl203/tornado,kangbiao/tornado,jampp/tornado,ifduyue/tornado,jsjohnst/tornado,icejoywoo/tornado,ovidiucp/tornado,futurechallenger/tornado,ListFranz/tornado,ZhuPeng/tornado,ymero/tornado,Acidburn0zzz/tornado,nbargnesi/tornado,Windsooon/tornado,Drooids/tornado,eklitzke/tornado,LTD-Beget/tornado,icejoywoo/tornado,coderhaoxin/tornado,MjAbuz/tornado,nephics/tornado,wsyzxcn/tornado,fengshao0907/tornado,kaushik94/tornado,jampp/tornado,wxhzk/tornado-1,jampp/tornado,Batterfii/tornado,andyaguiar/tornado,dsseter/tornado,erichuang1994/tornado,arthurdarcet/tornado,NoyaInRain/tornado,VShangxiao/tornado,mr-ping/tornado,Fydot/tornado,elelianghh/tornado,wsyzxcn/tornado,zguangyu/tornado,Windsooon/tornado,pombredanne/tornado,gwillem/tornado,mivade/tornado,Polyconseil/tornado,ymero/tornado,dsseter/tornado,frtmelody/tornado,lsanotes/tornado,cyrusin/tornado,yuyangit/tornado,eXcomm/tornado,tianyk/tornado-research,mlyundin/tornado,jparise/tornado,sevenguin/tornado,NoyaInRain/tornado,mlyundin/tornado,liqueur/tornado,eklitzke/tornado,ubear/tornado,dsseter/tornado,jsjohnst/tornado,jarrahwu/tornado,jarrahwu/tornado,bywbilly/tornado,erichuang1994/tornado,codecov/tornado,mr-ping/tornado,ovidiucp/tornado,BencoLee/tornado,Acidburn0zzz/tornado,yuyangit/tornado,pombredanne/tornado,obsh/tornado,jonashagstedt/tornado,codeb2cc/tornado,zguangyu/tornado,noxiouz/tornado,leekchan/tornado_test,lsanotes/tornado,304471720/tornado,VShangxiao/tornado,0x73/tornado,johan--/tornado,ydaniv/tornado,jehiah/tornado,gitchs/tornado,Geoion/tornado,wechasing/tornado,ms7s/tornado,kangbiao/tornado,lujinda/tornado,jampp/tornado,hzruandd/tornado,shashankbassi92/tornado,insflow/tornado,gitchs/tornado,Geoion/tornado,codeb2cc/tornado,coderhaoxin/tornado,bywbilly/tornado,0xkag/tornado,liqueur/tornado,fengsp/tornado,kaushik94/tornado,Callwoola/tornado,SuminAndrew/tornado,noxiouz/tornado,wujuguang/tornado,ColorFuzzy/tornado,kevinge314gh/tornado,drewmiller/tornado,elelianghh/tornado,shaohung001/tornado,felixonmars/tornado,jparise/tornado,futurechallenger/tornado,anjan-srivastava/tornado,eXcomm/tornado,wechasing/tornado,dongpinglai/my_tornado,legnaleurc/tornado,chenxiaba/tornado,icejoywoo/tornado,hhru/tornado,akalipetis/tornado,z-fork/tornado,gitchs/tornado,obsh/tornado,ymero/tornado,wsyzxcn/tornado,yuezhonghua/tornado,wechasing/tornado,tianyk/tornado-research,xinyu7/tornado,elelianghh/tornado,ajdavis/tornado,erichuang1994/tornado,anjan-srivastava/tornado,hhru/tornado,kevinge314gh/tornado,anjan-srivastava/tornado,zhuochenKIDD/tornado,wsyzxcn/tornado,fengshao0907/tornado,jonashagstedt/tornado,ifduyue/tornado,yuyangit/tornado,sxfmol/tornado,Fydot/tornado,lujinda/tornado,zhuochenKIDD/tornado,Snamint/tornado,xinyu7/tornado,nbargnesi/tornado,elijah513/tornado,jparise/tornado,andyaguiar/tornado,Drooids/tornado,cyrusin/tornado,chenxiaba/tornado,jsjohnst/tornado,akalipetis/tornado,johan--/tornado,xinyu7/tornado,QuanZag/tornado,fengsp/tornado,kangbiao/tornado,hhru/tornado,jparise/tornado,MjAbuz/tornado,xinyu7/tornado,ms7s/tornado,ifduyue/tornado,insflow/tornado,frtmelody/tornado,jehiah/tornado,importcjj/tornado,z-fork/tornado,felixonmars/tornado,erichuang1994/tornado,shaohung001/tornado,Callwoola/tornado,sunjeammy/tornado,mlyundin/tornado,Batterfii/tornado,mr-ping/tornado,wujuguang/tornado,leekchan/tornado_test,jampp/tornado,shaohung001/tornado,wechasing/tornado,Callwoola/tornado,Acidburn0zzz/tornado,ovidiucp/tornado,Callwoola/tornado,SuminAndrew/tornado,shaohung001/tornado,icejoywoo/tornado,lilydjwg/tornado,InverseLina/tornado,ydaniv/tornado,mehmetkose/tornado,304471720/tornado,sevenguin/tornado,gwillem/tornado,ajdavis/tornado,LTD-Beget/tornado,yangkf1985/tornado,z-fork/tornado,mehmetkose/tornado,0xkag/tornado,mlyundin/tornado,bdarnell/tornado,felixonmars/tornado,sevenguin/tornado,nephics/tornado,Drooids/tornado,nordaux/tornado,leekchan/tornado_test,hzruandd/tornado,jsjohnst/tornado,Aaron1992/tornado,eXcomm/tornado,takeshineshiro/tornado,Snamint/tornado,zguangyu/tornado,yangkf1985/tornado,BencoLee/tornado,ubear/tornado,yangkf1985/tornado,frtmelody/tornado,QuanZag/tornado,nordaux/tornado,Windsooon/tornado,Batterfii/tornado,kevinge314gh/tornado,yuezhonghua/tornado,whip112/tornado,mivade/tornado,ovidiucp/tornado,kippandrew/tornado,tornadoweb/tornado,cyrilMargaria/tornado,akalipetis/tornado,tornadoweb/tornado,mehmetkose/tornado,Aaron1992/tornado,jonashagstedt/tornado,anandology/tornado,AlphaStaxLLC/tornado,hzruandd/tornado,jehiah/tornado,ydaniv/tornado,legnaleurc/tornado,Acidburn0zzz/tornado,coderhaoxin/tornado,AlphaStaxLLC/tornado,Batterfii/tornado,z-fork/tornado,Fydot/tornado,fengshao0907/tornado,liqueur/tornado,whip112/tornado,ZhuPeng/tornado,lsanotes/tornado,BencoLee/tornado,Snamint/tornado,coderhaoxin/tornado,drewmiller/tornado,ms7s/tornado,ydaniv/tornado,0xkag/tornado,felixonmars/tornado,legnaleurc/tornado,Snamint/tornado,obsh/tornado,ms7s/tornado,ZhuPeng/tornado,AlphaStaxLLC/tornado,bywbilly/tornado,ColorFuzzy/tornado,ubear/tornado,lujinda/tornado,anandology/tornado,leekchan/tornado_test,MjAbuz/tornado,bywbilly/tornado,sxfmol/tornado,shaohung001/tornado,johan--/tornado,Snamint/tornado,lujinda/tornado,BencoLee/tornado,mivade/tornado,mr-ping/tornado,nephics/tornado,wxhzk/tornado-1,elelianghh/tornado,kippandrew/tornado,zguangyu/tornado,ColorFuzzy/tornado,ListFranz/tornado,dsseter/tornado,codeb2cc/tornado,InverseLina/tornado,Lancher/tornado,Lancher/tornado,ifduyue/tornado,bdarnell/tornado,wechasing/tornado,VShangxiao/tornado,nephics/tornado,Acidburn0zzz/tornado,ListFranz/tornado,akalipetis/tornado,QuanZag/tornado,pombredanne/tornado,yuyangit/tornado,kippandrew/tornado,wsyzxcn/tornado,erichuang1994/tornado,frtmelody/tornado,lilydjwg/tornado,insflow/tornado,dongpinglai/my_tornado,ovidiucp/tornado,BencoLee/tornado,ubear/tornado,lujinda/tornado,NoyaInRain/tornado,kaushik94/tornado,zguangyu/tornado,ubear/tornado,obsh/tornado,304471720/tornado,anandology/tornado,eklitzke/tornado,insflow/tornado,jampp/tornado,importcjj/tornado,lilydjwg/tornado,wxhzk/tornado-1,nbargnesi/tornado,wsyzxcn/tornado,insflow/tornado,akalipetis/tornado,takeshineshiro/tornado
57a022230f9ae1b3f5901e26babafb2d321b4511
/* * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { /* Some ENGINEs need this */ OPENSSL_cpuid_setup(); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) && OPENSSL_API_COMPAT < 0x10100000L void ENGINE_setup_bsd_cryptodev(void) { } #endif
/* * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { /* Some ENGINEs need this */ OPENSSL_cpuid_setup(); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) && !defined(OPENSSL_NO_DEPRECATED) void ENGINE_setup_bsd_cryptodev(void) { } #endif
--- +++ @@ -18,7 +18,7 @@ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } -#if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) && !defined(OPENSSL_NO_DEPRECATED) +#if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) && OPENSSL_API_COMPAT < 0x10100000L void ENGINE_setup_bsd_cryptodev(void) { }
Convert our own check of OPENSSL_NO_DEPRECATED ... to the check OPENSSL_API_COMPAT < 0x10100000L, to correspond with how it's declared. Reviewed-by: Matt Caswell <1fa2ef4755a9226cb9a0a4840bd89b158ac71391@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6470)
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
a9091c137bb21a247afa01ecf17bd5c75d9b0e65
// // KWFutureObject.h // iOSFalconCore // // Created by Luke Redpath on 13/01/2011. // Copyright 2011 LJR Software Limited. All rights reserved. // #import <Foundation/Foundation.h> #ifdef __weak #undef __weak #define __weak __unsafe_unretained #endif typedef id (^KWFutureObjectBlock)(void); @interface KWFutureObject : NSObject { __weak id *objectPointer; KWFutureObjectBlock block; } + (id)objectWithObjectPointer:(id *)pointer; + (id)objectWithReturnValueOfBlock:(KWFutureObjectBlock)block; - (id)initWithObjectPointer:(id *)pointer; - (id)initWithBlock:(KWFutureObjectBlock)aBlock; - (id)object; @end
// // KWFutureObject.h // iOSFalconCore // // Created by Luke Redpath on 13/01/2011. // Copyright 2011 LJR Software Limited. All rights reserved. // #import <Foundation/Foundation.h> typedef id (^KWFutureObjectBlock)(void); @interface KWFutureObject : NSObject { __weak id *objectPointer; KWFutureObjectBlock block; } + (id)objectWithObjectPointer:(id *)pointer; + (id)objectWithReturnValueOfBlock:(KWFutureObjectBlock)block; - (id)initWithObjectPointer:(id *)pointer; - (id)initWithBlock:(KWFutureObjectBlock)aBlock; - (id)object; @end
--- +++ @@ -7,6 +7,11 @@ // #import <Foundation/Foundation.h> + +#ifdef __weak +#undef __weak +#define __weak __unsafe_unretained +#endif typedef id (^KWFutureObjectBlock)(void);
Work arounf use of weak when deployment target it iOS 4
bsd-3-clause
carezone/Kiwi,carezone/Kiwi,tcirwin/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,tcirwin/Kiwi,unisontech/Kiwi,tangwei6423471/Kiwi,iosRookie/Kiwi,TaemoonCho/Kiwi,ecaselles/Kiwi,indiegogo/Kiwi,ashfurrow/Kiwi,TaemoonCho/Kiwi,unisontech/Kiwi,LiuShulong/Kiwi,weslindsay/Kiwi,ecaselles/Kiwi,depop/Kiwi,JoistApp/Kiwi,indiegogo/Kiwi,iosRookie/Kiwi,ecaselles/Kiwi,alloy/Kiwi,allending/Kiwi,depop/Kiwi,LiuShulong/Kiwi,TaemoonCho/Kiwi,hyperoslo/Tusen,emodeqidao/Kiwi,tcirwin/Kiwi,howandhao/Kiwi,emodeqidao/Kiwi,PaulTaykalo/Kiwi,emodeqidao/Kiwi,tangwei6423471/Kiwi,weslindsay/Kiwi,tangwei6423471/Kiwi,iosRookie/Kiwi,PaulTaykalo/Kiwi,tonyarnold/Kiwi,PaulTaykalo/Kiwi,hyperoslo/Tusen,carezone/Kiwi,JoistApp/Kiwi,samkrishna/Kiwi,cookov/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,PaulTaykalo/Kiwi,alloy/Kiwi,allending/Kiwi,LiuShulong/Kiwi,LiuShulong/Kiwi,cookov/Kiwi,tonyarnold/Kiwi,hyperoslo/Tusen,tonyarnold/Kiwi,samkrishna/Kiwi,tangwei6423471/Kiwi,unisontech/Kiwi,depop/Kiwi,emodeqidao/Kiwi,iosRookie/Kiwi,JoistApp/Kiwi,cookov/Kiwi,samkrishna/Kiwi,alloy/Kiwi,howandhao/Kiwi,ecaselles/Kiwi,hyperoslo/Tusen,unisontech/Kiwi,ashfurrow/Kiwi,ashfurrow/Kiwi,indiegogo/Kiwi,weslindsay/Kiwi,JoistApp/Kiwi,weslindsay/Kiwi,howandhao/Kiwi,indiegogo/Kiwi,allending/Kiwi,cookov/Kiwi,allending/Kiwi,depop/Kiwi,samkrishna/Kiwi,tcirwin/Kiwi
73cfbf47cc0f13db91e461d98081503597d3d50b
/* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s * * __builtin_longjmp/setjmp should get transformed into intrinsics. */ // CHECK-NOT: builtin_longjmp void jumpaway(int *ptr) { __builtin_longjmp(ptr,1); } int main(void) { __builtin_setjmp(0); jumpaway(0); }
/* RUN: %clang_cc1 %s -emit-llvm -o - | not grep __builtin_ * * __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp * just like explicit setjmp/longjmp calls are. */ void jumpaway(int *ptr) { __builtin_longjmp(ptr,1); } int main(void) { __builtin_setjmp(0); jumpaway(0); }
--- +++ @@ -1,8 +1,9 @@ -/* RUN: %clang_cc1 %s -emit-llvm -o - | not grep __builtin_ +/* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s * - * __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp - * just like explicit setjmp/longjmp calls are. + * __builtin_longjmp/setjmp should get transformed into intrinsics. */ + +// CHECK-NOT: builtin_longjmp void jumpaway(int *ptr) { __builtin_longjmp(ptr,1);
Fix test in two ways: remove incorrect comment (the intrinsic generated now is of the llvm.sjlj.* flavore) and convert grep->FileCheck git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@181468 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
1c8f270a75665f44f8570735762003a4319cbe19
#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; }
#include <stdio.h> #include <cs50.h> int main(void) { return 0; }
--- +++ @@ -1,7 +1,17 @@ #include <stdio.h> #include <cs50.h> -int main(void) { +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; }
Add key check and convert key to int
unlicense
Implaier/CS50,Implaier/CS50,Implaier/CS50,Implaier/CS50
a236747cee13f512f5f1708b41306533b67ebddb
#ifndef SRC_FORCES_LABEL_STATE_H_ #define SRC_FORCES_LABEL_STATE_H_ #include <Eigen/Core> #include <string> #include <map> namespace Forces { class Force; /** * \brief Encapsulates state for a label necessary for the simulation * * This consists of label and anchor positions in 2D and 3D, as well as * the label's size, text and its id. * * It also stores the last force values for debugging purposes. */ class LabelState { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW LabelState(int id, std::string text, Eigen::Vector3f anchorPosition, Eigen::Vector2f size); int id; Eigen::Vector3f anchorPosition; Eigen::Vector3f labelPosition; Eigen::Vector2f size; Eigen::Vector2f anchorPosition2D; Eigen::Vector2f labelPosition2D; float labelPositionDepth; std::string text; std::map<Force *, Eigen::Vector2f> forces; }; } // namespace Forces #endif // SRC_FORCES_LABEL_STATE_H_
#ifndef SRC_FORCES_LABEL_STATE_H_ #define SRC_FORCES_LABEL_STATE_H_ #include <Eigen/Core> #include <string> #include <map> namespace Forces { class Force; /** * \brief Encapsulates state for a label necessary for the simulation * * This consists of label and anchor positions in 2D and 3D, as well as * the label's size, text and its id. * * It also stores the last force values for debugging purposes. */ class LabelState { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW LabelState(int id, std::string text, Eigen::Vector3f anchorPosition, Eigen::Vector2f size); const int id; Eigen::Vector3f anchorPosition; Eigen::Vector3f labelPosition; Eigen::Vector2f size; Eigen::Vector2f anchorPosition2D; Eigen::Vector2f labelPosition2D; float labelPositionDepth; const std::string text; std::map<Force *, Eigen::Vector2f> forces; }; } // namespace Forces #endif // SRC_FORCES_LABEL_STATE_H_
--- +++ @@ -26,7 +26,7 @@ LabelState(int id, std::string text, Eigen::Vector3f anchorPosition, Eigen::Vector2f size); - const int id; + int id; Eigen::Vector3f anchorPosition; Eigen::Vector3f labelPosition; Eigen::Vector2f size; @@ -35,7 +35,7 @@ Eigen::Vector2f labelPosition2D; float labelPositionDepth; - const std::string text; + std::string text; std::map<Force *, Eigen::Vector2f> forces; };
Remove const modifier from LabelState members. This enables move and move assignment, which is necessary for containers.
mit
Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller
fe85b79dbc358dc3ecddf77f33621798541f358f
/** * @file * @description char devices */ #ifndef __CHAR_DEVICE_H #define __CHAR_DEVICE_H typedef struct chardev { int (*putc) (void); int (*getc) (int); } chardev_t; #if 0 #define MAX_COUNT_CHAR_DEVICES 10 static chardev_t pool_chardev[MAX_COUNT_CHAR_DEVICES]; static int chardev_c = 0; #define ADD_CHAR_DEVICE(__NAME,__IN,__OUT) \ int __NAME=0;\ __NAME=chardev_c; \ pool_chardev[chardev_c++] = { \ .getc = __IN; \ .putc = __OUT;\ }; #endif #endif /* __CHAR_DEVICE_H */
/** * @file * @description char devices */ #ifndef __CHAR_DEVICE_H #define __CHAR_DEVICE_H typedef struct chardev { int (*putc) (void); int (*getc) (int); } chardev_t; #define MAX_COUNT_CHAR_DEVICES 10 static chardev_t pool_chardev[MAX_COUNT_CHAR_DEVICES]; static int chardev_c = 0; #define ADD_CHAR_DEVICE(__NAME,__IN,__OUT) \ int __NAME=0;\ __NAME=chardev_c; \ pool_chardev[chardev_c++] = { \ .getc = __IN; \ .putc = __OUT;\ }; #endif /* __CHAR_DEVICE_H */
--- +++ @@ -10,7 +10,7 @@ int (*putc) (void); int (*getc) (int); } chardev_t; - +#if 0 #define MAX_COUNT_CHAR_DEVICES 10 static chardev_t pool_chardev[MAX_COUNT_CHAR_DEVICES]; static int chardev_c = 0; @@ -22,5 +22,5 @@ .getc = __IN; \ .putc = __OUT;\ }; - +#endif #endif /* __CHAR_DEVICE_H */
Delete char_dev massive from header
bsd-2-clause
gzoom13/embox,vrxfile/embox-trik,Kefir0192/embox,vrxfile/embox-trik,abusalimov/embox,Kefir0192/embox,gzoom13/embox,mike2390/embox,mike2390/embox,embox/embox,embox/embox,abusalimov/embox,embox/embox,embox/embox,mike2390/embox,Kakadu/embox,Kakadu/embox,abusalimov/embox,vrxfile/embox-trik,Kefir0192/embox,abusalimov/embox,Kakadu/embox,gzoom13/embox,mike2390/embox,vrxfile/embox-trik,Kakadu/embox,Kakadu/embox,mike2390/embox,Kefir0192/embox,gzoom13/embox,vrxfile/embox-trik,embox/embox,vrxfile/embox-trik,Kefir0192/embox,gzoom13/embox,gzoom13/embox,abusalimov/embox,gzoom13/embox,Kakadu/embox,embox/embox,Kefir0192/embox,mike2390/embox,Kakadu/embox,mike2390/embox,abusalimov/embox,vrxfile/embox-trik,Kefir0192/embox
28f427e69ea72b113380a835c1096c1e15ca4d22
// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | FileCheck %s // PR 5406 // XFAIL: * // XTARGET: arm typedef struct { char x[3]; } A0; void foo (int i, ...); // CHECK: call void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind int main (void) { A0 a3; a3.x[0] = 0; a3.x[0] = 0; a3.x[2] = 26; foo (1, a3 ); return 0; }
// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | FileCheck %s // PR 5406 // XFAIL: * // XTARGET: arm typedef struct { char x[3]; } A0; void foo (int i, ...); // CHECK: call arm_aapcscc void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind int main (void) { A0 a3; a3.x[0] = 0; a3.x[0] = 0; a3.x[2] = 26; foo (1, a3 ); return 0; }
--- +++ @@ -8,7 +8,7 @@ void foo (int i, ...); -// CHECK: call arm_aapcscc void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind +// CHECK: call void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind int main (void) { A0 a3;
Update test to match recent llvm-gcc change. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@106056 91177308-0d34-0410-b5e6-96231b3b80d8
bsd-2-clause
dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm
5869dc005e829ed07b066746b01d24f264a47113
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode)); n->left = NULL; n->right = NULL; n->p = NULL; n->k = k; } void BST_Inorder_Tree_Walk(BSTNode* n, void (f)(void*)) { if (n != NULL) { BST_Inorder_Tree_Walk(n->left, f); f(n->k); BST_Inorder_Tree_Walk(n->right, f); } }
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode)); n->left = NULL; n->right = NULL; n->p = NULL; n->k = k; }
--- +++ @@ -31,3 +31,13 @@ n->k = k; } +void BST_Inorder_Tree_Walk(BSTNode* n, void (f)(void*)) +{ + if (n != NULL) + { + BST_Inorder_Tree_Walk(n->left, f); + f(n->k); + BST_Inorder_Tree_Walk(n->right, f); + } +} +
Add BST inorder traversal function implementation
mit
MaxLikelihood/CADT
52e1beb3dfe634b6e05cd28e480fce984ba36141
/*! \file SwiftParticle.h * \brief header file for the SWIFT particle type. */ #ifndef SWIFT_PARTICLE_H #define SWIFT_PARTICLE_H #ifdef SWIFTINTERFACE namespace Swift { /* SWIFT enum of part types. Should match VELOCIraptor type values. */ enum part_type { swift_type_gas = 0, swift_type_dark_matter = 1, swift_type_star = 4, swift_type_black_hole = 5, swift_type_count } __attribute__((packed)); /* SWIFT/VELOCIraptor particle. */ struct swift_vel_part { /*! Particle ID. */ long long id; /*! Particle position. */ double x[3]; /*! Particle velocity. */ float v[3]; /*! Particle mass. */ float mass; /*! Gravitational potential */ float potential; /*! Internal energy of gas particle */ float u; /*! Type of the #gpart (DM, gas, star, ...) */ enum part_type type; }; } #endif #endif
/*! \file SwiftParticle.h * \brief header file for the SWIFT particle type. */ #ifndef SWIFT_PARTICLE_H #define SWIFT_PARTICLE_H #ifdef SWIFTINTERFACE /** * @brief The default struct alignment in SWIFT. */ #define SWIFT_STRUCT_ALIGNMENT 32 #define SWIFT_STRUCT_ALIGN __attribute__((aligned(SWIFT_STRUCT_ALIGNMENT))) namespace Swift { /* SWIFT enum of part types. Should match VELOCIraptor type values. */ enum part_type { swift_type_gas = 0, swift_type_dark_matter = 1, swift_type_star = 4, swift_type_black_hole = 5, swift_type_count } __attribute__((packed)); /* SWIFT/VELOCIraptor particle. */ struct swift_vel_part { /*! Particle ID. If negative, it is the negative offset of the #part with which this gpart is linked. */ long long id; /*! Particle position. */ double x[3]; /*! Particle velocity. */ float v[3]; /*! Particle mass. */ float mass; /*! Gravitational potential */ float potential; /*! Internal energy of gas particle */ float u; /*! Type of the #gpart (DM, gas, star, ...) */ enum part_type type; } SWIFT_STRUCT_ALIGN; } #endif #endif
--- +++ @@ -7,11 +7,6 @@ #define SWIFT_PARTICLE_H #ifdef SWIFTINTERFACE - /** - * @brief The default struct alignment in SWIFT. - */ -#define SWIFT_STRUCT_ALIGNMENT 32 -#define SWIFT_STRUCT_ALIGN __attribute__((aligned(SWIFT_STRUCT_ALIGNMENT))) namespace Swift { @@ -28,8 +23,7 @@ /* SWIFT/VELOCIraptor particle. */ struct swift_vel_part { - /*! Particle ID. If negative, it is the negative offset of the #part with - which this gpart is linked. */ + /*! Particle ID. */ long long id; /*! Particle position. */ @@ -50,7 +44,7 @@ /*! Type of the #gpart (DM, gas, star, ...) */ enum part_type type; - } SWIFT_STRUCT_ALIGN; + }; }
Use unaligned particle structure to save memory.
mit
pelahi/VELOCIraptor-STF,pelahi/VELOCIraptor-STF,pelahi/VELOCIraptor-STF
80e3504b8bd57974c86cafa9a9fbe0614c965bdf
// These macros weren't added until v8 version 4.4 #include "node_wrapper.h" #ifndef V8_MAJOR_VERSION #if NODE_MODULE_VERSION <= 11 #define V8_MAJOR_VERSION 3 #define V8_MINOR_VERSION 14 #define V8_PATCH_LEVEL 0 #elif V8_MAJOR_VERSION <= 14 #define V8_MAJOR_VERSION 3 #define V8_MINOR_VERSION 28 #define V8_PATCH_LEVEL 0 #else #error v8 version macros missing #endif #endif #define V8_AT_LEAST(major, minor, patch) (\ V8_MAJOR_VERSION > (major) || \ (V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION >= (minor)) || \ (V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION == (minor) && V8_PATCH_LEVEL >= (patch)) \ ) #ifdef NODE_MODULE_VERSION #define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (NODE_MODULE_VERSION >= nodejs) #else #define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (V8_AT_LEAST(v8_major, v8_minor, v8_patch)) #endif
// These macros weren't added until v8 version 4.4 #include "node_wrapper.h" #ifndef V8_MAJOR_VERSION #if NODE_MODULE_VERSION <= 11 #define V8_MAJOR_VERSION 3 #define V8_MINOR_VERSION 14 #define V8_PATCH_LEVEL 0 #elif V8_MAJOR_VERSION <= 14 #define V8_MAJOR_VERSION 3 #define V8_MINOR_VERSION 28 #define V8_PATCH_LEVEL 0 #else #error v8 version macros missing #endif #endif #define V8_AT_LEAST(major, minor, patch) (\ V8_MAJOR_VERSION > (major) || \ (V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION >= (minor)) || \ (V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION == (minor) && V8_PATCH_LEVEL >= (patch)) \ ) #define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (\ defined(NODE_MODULE_VERSION) ? NODE_MODULE_VERSION >= nodejs : V8_AT_LEAST(v8_major, v8_minor, v8_patch) \ )
--- +++ @@ -20,6 +20,8 @@ (V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION == (minor) && V8_PATCH_LEVEL >= (patch)) \ ) -#define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (\ - defined(NODE_MODULE_VERSION) ? NODE_MODULE_VERSION >= nodejs : V8_AT_LEAST(v8_major, v8_minor, v8_patch) \ -) +#ifdef NODE_MODULE_VERSION +#define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (NODE_MODULE_VERSION >= nodejs) +#else +#define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (V8_AT_LEAST(v8_major, v8_minor, v8_patch)) +#endif
Fix msvc preprocessor error (omg)
isc
laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm
92f64df6d3551bec6f5c14e78b1195a381f9fc11
// // SendEmailController.h // PhotoWheel // // Created by Kirby Turner on 12/11/12. // Copyright (c) 2012 White Peak Software Inc. All rights reserved. // #import <Foundation/Foundation.h> #import <MessageUI/MessageUI.h> #import <MessageUI/MFMailComposeViewController.h> @protocol SendEmailControllerDelegate; @interface SendEmailController : NSObject <MFMailComposeViewControllerDelegate> @property (nonatomic, weak) UIViewController<SendEmailControllerDelegate> *viewController; @property (nonatomic, strong) NSSet *photos; - (id)initWithViewController:(UIViewController<SendEmailControllerDelegate> *)viewController; - (void)sendEmail; + (BOOL)canSendMail; @end @protocol SendEmailControllerDelegate <NSObject> @required - (void)sendEmailControllerDidFinish:(SendEmailController *)controller; @end
// // SendEmailController.h // PhotoWheel // // Created by Kirby Turner on 12/11/12. // Copyright (c) 2012 White Peak Software Inc. All rights reserved. // #import <Foundation/Foundation.h> #import <MessageUI/MessageUI.h> #import <MessageUI/MFMailComposeViewController.h> @protocol SendEmailControllerDelegate; @interface SendEmailController : NSObject <MFMailComposeViewControllerDelegate> @property (nonatomic, strong) UIViewController<SendEmailControllerDelegate> *viewController; @property (nonatomic, strong) NSSet *photos; - (id)initWithViewController:(UIViewController<SendEmailControllerDelegate> *)viewController; - (void)sendEmail; + (BOOL)canSendMail; @end @protocol SendEmailControllerDelegate <NSObject> @required - (void)sendEmailControllerDidFinish:(SendEmailController *)controller; @end
--- +++ @@ -16,7 +16,7 @@ @interface SendEmailController : NSObject <MFMailComposeViewControllerDelegate> -@property (nonatomic, strong) UIViewController<SendEmailControllerDelegate> *viewController; +@property (nonatomic, weak) UIViewController<SendEmailControllerDelegate> *viewController; @property (nonatomic, strong) NSSet *photos;
Change from strong to weak.
mit
kirbyt/PhotoWheel,kirbyt/PhotoWheel
a34e8ff7a88128234c647074f588ea87435a9fd9
#ifndef KMEM_H #define KMEM_H #include <stdbool.h> #include <stdint.h> #include <arch/x86/paging.h> #include <libk/kabort.h> #define KHEAP_PHYS_ROOT ((void*)0x100000) //#define KHEAP_PHYS_END ((void*)0xc1000000) #define KHEAP_END_SENTINEL (NULL) #define KHEAP_BLOCK_SLOP 32 struct kheap_metadata { size_t size; struct kheap_metadata *next; bool is_free; }; struct kheap_metadata *root; struct kheap_metadata *kheap_init(); int kheap_extend(); void kheap_install(struct kheap_metadata *root, size_t initial_heap_size); void *kmalloc(size_t bytes); void kfree(void *mem); void kheap_defragment(); #endif
#ifndef KMEM_H #define KMEM_H #include <stdbool.h> #include <stdint.h> #include <arch/x86/paging.h> #include <libk/kabort.h> #define KHEAP_PHYS_ROOT ((void*)0x100000) //#define KHEAP_PHYS_END ((void*)0xc1000000) #define KHEAP_END_SENTINEL (NULL) // 1 GB #define PHYS_MEMORY_SIZE (1*1024*1024*1024) #define KHEAP_BLOCK_SLOP 32 #define PAGE_ALIGN(x) ((uint32_t)x >> 12) struct kheap_metadata { size_t size; struct kheap_metadata *next; bool is_free; }; struct kheap_metadata *root; struct kheap_metadata *kheap_init(); int kheap_extend(); void kheap_install(struct kheap_metadata *root, size_t initial_heap_size); void *kmalloc(size_t bytes); void kfree(void *mem); void kheap_defragment(); #endif
--- +++ @@ -8,13 +8,8 @@ #define KHEAP_PHYS_ROOT ((void*)0x100000) //#define KHEAP_PHYS_END ((void*)0xc1000000) #define KHEAP_END_SENTINEL (NULL) -// 1 GB -#define PHYS_MEMORY_SIZE (1*1024*1024*1024) #define KHEAP_BLOCK_SLOP 32 - -#define PAGE_ALIGN(x) ((uint32_t)x >> 12) - struct kheap_metadata {
Remove macros which now live in paging.h
mit
iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth
894133a4b116abcde29ae9a92e5f823af6713083
/* Copyright (c) 2015, ENEA Software AB * Copyright (c) 2015, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __OFP_ODP_COMPAT__ #define __OFP_ODP_COMPAT__ #if ODP_VERSION == 102 #include "linux.h" #else #include "odp/helper/linux.h" #endif /* odp_version == 102 */ #if ODP_VERSION < 105 typedef uint64_t odp_time_t; #endif /* ODP_VERSION < 105 */ #if ODP_VERSION < 104 && ODP_VERSION > 101 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers) #elif ODP_VERSION < 102 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask) #define odp_init_local(x) odp_init_local() #define ODP_THREAD_WORKER 0 #define ODP_THREAD_CONTROL 1 #endif #endif
/* Copyright (c) 2015, ENEA Software AB * Copyright (c) 2015, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __OFP_ODP_COMPAT__ #define __OFP_ODP_COMPAT__ #if ODP_VERSION == 102 #include "linux.h" #else #include "odp/helper/linux.h" #endif /* odp_version == 102 */ #if ODP_VERSION < 105 typedef uint64_t odp_time_t; #endif /* ODP_VERSION < 105 */ #if ODP_VERSION < 104 && ODP_VERSION > 101 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers) #elif ODP_VERSION < 102 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask) #define ODP_THREAD_WORKER #define ODP_THREAD_CONTROL #endif #endif
--- +++ @@ -22,8 +22,9 @@ #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers) #elif ODP_VERSION < 102 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask) -#define ODP_THREAD_WORKER -#define ODP_THREAD_CONTROL +#define odp_init_local(x) odp_init_local() +#define ODP_THREAD_WORKER 0 +#define ODP_THREAD_CONTROL 1 #endif #endif
Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL as in it's original enum, instead of mangling them. Defining odp_init_local like this we can initialized properly the values of ODP_THREAD_WORKER and ODP_THREAD_CONTROL. This is important for the following patch where we need to define odp_threat_type_t. Signed-off-by: José Pekkarinen <d7cb8761fb0e75b1a78c2fda4f1daed76cd46cfe@nokia.com> Reviewed-and-tested-by: Sorin Vultureanu <8013ba55f8675034bc2ab0d6c3a1c9650437ca36@enea.com>
bsd-3-clause
OpenFastPath/ofp,OpenFastPath/ofp,OpenFastPath/ofp,TolikH/ofp,TolikH/ofp,OpenFastPath/ofp,TolikH/ofp
b3f4c5d49830a8ef77ec1d74e8100fe3cc561230
/**************************************************** * This is a test that will test barriers * ****************************************************/ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> #include <fcntl.h> #include "carbon_user.h" #include "capi.h" #include "sync_api.h" carbon_barrier_t my_barrier; // Functions executed by threads void* test_wait_barrier(void * threadid); int main(int argc, char* argv[]) // main begins { CarbonStartSim(); const unsigned int num_threads = 5; carbon_thread_t threads[num_threads]; CarbonBarrierInit(&my_barrier, num_threads); for(unsigned int i = 0; i < num_threads; i++) threads[i] = CarbonSpawnThread(test_wait_barrier, (void *) i); for(unsigned int i = 0; i < num_threads; i++) CarbonJoinThread(threads[i]); printf("Finished running barrier test!.\n"); CarbonStopSim(); return 0; } // main ends void* test_wait_barrier(void *threadid) { for (unsigned int i = 0; i < 50; i++) CarbonBarrierWait(&my_barrier); return NULL; }
/**************************************************** * This is a test that will test barriers * ****************************************************/ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> #include <fcntl.h> #include "carbon_user.h" #include "capi.h" #include "sync_api.h" carbon_barrier_t my_barrier; // Functions executed by threads void* test_wait_barrier(void * threadid); int main(int argc, char* argv[]) // main begins { CarbonStartSim(); const unsigned int num_threads = 5; carbon_thread_t threads[num_threads]; barrierInit(&my_barrier, num_threads); for(unsigned int i = 0; i < num_threads; i++) threads[i] = CarbonSpawnThread(test_wait_barrier, (void *) i); for(unsigned int i = 0; i < num_threads; i++) CarbonJoinThread(threads[i]); printf("Finished running barrier test!.\n"); CarbonStopSim(); return 0; } // main ends void* test_wait_barrier(void *threadid) { for (unsigned int i = 0; i < 50; i++) barrierWait(&my_barrier); return NULL; }
--- +++ @@ -22,7 +22,7 @@ const unsigned int num_threads = 5; carbon_thread_t threads[num_threads]; - barrierInit(&my_barrier, num_threads); + CarbonBarrierInit(&my_barrier, num_threads); for(unsigned int i = 0; i < num_threads; i++) threads[i] = CarbonSpawnThread(test_wait_barrier, (void *) i); @@ -39,7 +39,7 @@ void* test_wait_barrier(void *threadid) { for (unsigned int i = 0; i < 50; i++) - barrierWait(&my_barrier); + CarbonBarrierWait(&my_barrier); return NULL; }
[tests] Update barrier test to new api.
mit
victorisildur/Graphite,mit-carbon/Graphite-Cycle-Level,mit-carbon/Graphite-Cycle-Level,mit-carbon/Graphite,mit-carbon/Graphite-Cycle-Level,8l/Graphite,victorisildur/Graphite,8l/Graphite,nkawahara/Graphite,fhijaz/Graphite,8l/Graphite,8l/Graphite,mit-carbon/Graphite-Cycle-Level,nkawahara/Graphite,nkawahara/Graphite,mit-carbon/Graphite,mit-carbon/Graphite,mit-carbon/Graphite,nkawahara/Graphite,fhijaz/Graphite,victorisildur/Graphite,fhijaz/Graphite,victorisildur/Graphite,fhijaz/Graphite
0e363dd05530ea6d0fe407bfbeb0eff4706301cc
#pragma once #include "chainerx/array.h" #include "chainerx/kernel.h" namespace chainerx { class SinhKernel : public Kernel { public: static const char* name() { return "Sinh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class CoshKernel : public Kernel { public: static const char* name() { return "Cosh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class TanhKernel : public Kernel { public: static const char* name() { return "Tanh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class ArcsinhKernel : public Kernel { public: static const char* name() { return "Arcsinh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class ArccoshKernel : public Kernel { public: static const char* name() { return "Arccosh"; } virtual void Call(const Array& x, const Array& out) = 0; }; } // namespace chainerx
#pragma once #include "chainerx/array.h" #include "chainerx/kernel.h" namespace chainerx { class SinhKernel : public Kernel { public: static const char* name() { return "Sinh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class CoshKernel : public Kernel { public: static const char* name() { return "Cosh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class TanhKernel : public Kernel { public: static const char* name() { return "Tanh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class ArcsinhKernel : public Kernel { public: static const char* name() { return "Archsinh"; } virtual void Call(const Array& x, const Array& out) = 0; }; class ArccoshKernel : public Kernel { public: static const char* name() { return "Arccosh"; } virtual void Call(const Array& x, const Array& out) = 0; }; } // namespace chainerx
--- +++ @@ -28,7 +28,7 @@ class ArcsinhKernel : public Kernel { public: - static const char* name() { return "Archsinh"; } + static const char* name() { return "Arcsinh"; } virtual void Call(const Array& x, const Array& out) = 0; };
Fix a typo in a kernel name
mit
pfnet/chainer,wkentaro/chainer,chainer/chainer,chainer/chainer,chainer/chainer,niboshi/chainer,chainer/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer,wkentaro/chainer,hvy/chainer,niboshi/chainer,hvy/chainer,hvy/chainer,niboshi/chainer,wkentaro/chainer
1cd869313d2d54aadf44d1958e5a987dee0f1a90
// LAF Gfx Library // Copyright (C) 2019 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef GFX_SIZE_IO_H_INCLUDED #define GFX_SIZE_IO_H_INCLUDED #pragma once #include "gfx/size.h" #include <iosfwd> namespace gfx { inline std::ostream& operator<<(std::ostream& os, const Size& size) { return os << "(" << size.w << ", " << size.h << ")"; } inline std::istream& operator>>(std::istream& in, Size& size) { while (in && in.get() != '(') ; if (!in) return in; char chr; in >> size.w >> chr >> size.h; return in; } } #endif
// LAF Gfx Library // Copyright (C) 2019 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef GFX_SIZE_IO_H_INCLUDED #define GFX_SIZE_IO_H_INCLUDED #pragma once #include "gfx/size.h" #include <iosfwd> namespace gfx { inline std::ostream& operator<<(std::ostream& os, const Size& size) { return os << "(" << size.x << ", " << size.y << ")"; } inline std::istream& operator>>(std::istream& in, Size& size) { while (in && in.get() != '(') ; if (!in) return in; char chr; in >> size.x >> chr >> size.y; return in; } } #endif
--- +++ @@ -15,8 +15,8 @@ inline std::ostream& operator<<(std::ostream& os, const Size& size) { return os << "(" - << size.x << ", " - << size.y << ")"; + << size.w << ", " + << size.h << ")"; } inline std::istream& operator>>(std::istream& in, Size& size) { @@ -27,8 +27,8 @@ return in; char chr; - in >> size.x >> chr - >> size.y; + in >> size.w >> chr + >> size.h; return in; }
Fix operator<<(ostream&) and operator>>(istream&) for gfx::Size
mit
aseprite/laf,aseprite/laf
4fddd802417ad903fe7dd590d7175d556c0697dd
#define _SLAVEREGISTERS #include <inttypes.h> //Functions needed from other modules extern void MODBUSBuildException( uint8_t, uint8_t ); //Functions for parsing requests extern void MODBUSParseRequest03( union MODBUSParser *Parser ); extern void MODBUSParseRequest06( union MODBUSParser *Parser ); extern void MODBUSParseRequest16( union MODBUSParser *Parser ); //Functions for building responses extern void MODBUSBuildResponse03( union MODBUSParser *Parser ); extern void MODBUSBuildResponse06( union MODBUSParser *Parser ); extern void MODBUSBuildResponse16( union MODBUSParser *Parser );
#define _SLAVEREGISTERS #include <inttypes.h> //Functions needed from other modules extern void MODBUSBuildException( uint8_t, uint8_t ); //Functions for parsing requests extern void MODBUSParseRequest03( union MODBUSParser *Parser ); extern void MODBUSParseRequest06( union MODBUSParser *Parser ); extern void MODBUSParseRequest16( union MODBUSParser *Parser );
--- +++ @@ -9,3 +9,8 @@ extern void MODBUSParseRequest03( union MODBUSParser *Parser ); extern void MODBUSParseRequest06( union MODBUSParser *Parser ); extern void MODBUSParseRequest16( union MODBUSParser *Parser ); + +//Functions for building responses +extern void MODBUSBuildResponse03( union MODBUSParser *Parser ); +extern void MODBUSBuildResponse06( union MODBUSParser *Parser ); +extern void MODBUSBuildResponse16( union MODBUSParser *Parser );
Add prototypes of response-building functions
mit
Jacajack/modlib
24ccdf6f2a0802a286416133d31364d42d18d720
#ifndef WATCHER_GLOBAL_FUNCTIONS #define WATCHER_GLOBAL_FUNCTIONS #include <boost/serialization/split_free.hpp> #include "watcherTypes.h" BOOST_SERIALIZATION_SPLIT_FREE(boost::asio::ip::address); namespace boost { namespace serialization { template<class Archive> void save(Archive & ar, const watcher::NodeIdentifier &a, const unsigned int version) { std::string tmp=a.to_string(); ar & tmp; } template<class Archive> void load(Archive & ar, watcher::NodeIdentifier &a, const unsigned int version) { std::string tmp; ar & tmp; a=boost::asio::ip::address::from_string(tmp); } } } #endif // WATCHER_GLOBAL_FUNCTIONS
#ifndef WATCHER_GLOBAL_FUNCTIONS #define WATCHER_GLOBAL_FUNCTIONS #include <boost/asio/ip/address.hpp> #include <boost/serialization/split_free.hpp> BOOST_SERIALIZATION_SPLIT_FREE(boost::asio::ip::address); namespace boost { namespace serialization { template<class Archive> void save(Archive & ar, const boost::asio::ip::address & a, const unsigned int version) { std::string tmp=a.to_string(); ar & tmp; } template<class Archive> void load(Archive & ar, boost::asio::ip::address & a, const unsigned int version) { std::string tmp; ar & tmp; a=boost::asio::ip::address::from_string(tmp); } } } #endif // WATCHER_GLOBAL_FUNCTIONS
--- +++ @@ -1,8 +1,8 @@ #ifndef WATCHER_GLOBAL_FUNCTIONS #define WATCHER_GLOBAL_FUNCTIONS -#include <boost/asio/ip/address.hpp> #include <boost/serialization/split_free.hpp> +#include "watcherTypes.h" BOOST_SERIALIZATION_SPLIT_FREE(boost::asio::ip::address); @@ -11,14 +11,14 @@ namespace serialization { template<class Archive> - void save(Archive & ar, const boost::asio::ip::address & a, const unsigned int version) + void save(Archive & ar, const watcher::NodeIdentifier &a, const unsigned int version) { std::string tmp=a.to_string(); ar & tmp; } template<class Archive> - void load(Archive & ar, boost::asio::ip::address & a, const unsigned int version) + void load(Archive & ar, watcher::NodeIdentifier &a, const unsigned int version) { std::string tmp; ar & tmp;
Use watcher::NodeIdentifier in place of boost::asio::address
agpl-3.0
glawler/watcher-visualization,glawler/watcher-visualization,glawler/watcher-visualization,glawler/watcher-visualization,glawler/watcher-visualization
d799cd9b227334a81c4c98068f09bad8c4be27c1
// UIKitExtensions // // UIKitExtensions/UIView/Framing.h // // Copyright (c) 2013 Stanislaw Pankevich // Released under the MIT license // // Inspired by FrameAccessor // https://github.com/AlexDenisov/FrameAccessor/ #import <UIKit/UIKit.h> @interface UIView (Framing) // http://stackoverflow.com/questions/16118106/uitextview-strange-text-clipping // https://github.com/genericspecific/CKUITools/issues/8 @property CGPoint viewOrigin; @property CGSize viewSize; @property CGFloat x; @property CGFloat y; @property CGFloat height; @property CGFloat width; @property CGFloat centerX; @property CGFloat centerY; @end
// UIKitExtensions // // UIKitExtensions/UIView/Framing.h // // Copyright (c) 2013 Stanislaw Pankevich // Released under the MIT license // // Inspired by FrameAccessor // https://github.com/AlexDenisov/FrameAccessor/ #import <UIKit/UIKit.h> @interface UIView (Framing) @property CGPoint viewOrigin; @property CGSize viewSize; @property CGFloat x; @property CGFloat y; @property CGFloat height; @property CGFloat width; @property CGFloat centerX; @property CGFloat centerY; @end
--- +++ @@ -12,6 +12,8 @@ @interface UIView (Framing) +// http://stackoverflow.com/questions/16118106/uitextview-strange-text-clipping +// https://github.com/genericspecific/CKUITools/issues/8 @property CGPoint viewOrigin; @property CGSize viewSize;
Add links to original problem
mit
stanislaw/UIKitExtensions,stanislaw/UIKitExtensions,stanislaw/UIKitExtensions,stanislaw/UIKitExtensions
351c01d249e0b93f4d2805f5b93d6cb52fae8894
#pragma once #include <SDL2/SDL.h> #include <string> class Application { private: // Main loop flag bool quit; // The window SDL_Window* window; // The window renderer SDL_Renderer* renderer; // The background color SDL_Color backgroundColor; // Window properties std::string title; unsigned int windowWidth; unsigned int windowHeight; bool isFullscreen; bool init(); void close(); void draw(); protected: // Event called after initialized virtual void on_init(); // Event called when before drawing the screen in the loop virtual void on_update(); // Event called when drawing the screen in the loop virtual void on_draw(SDL_Renderer* renderer); void set_background_color(SDL_Color color); unsigned int get_window_height() { return windowHeight; } unsigned int get_window_width() { return windowWidth; } bool is_fullscreen() { return isFullscreen; } public: Application(); Application(std::string title); Application(std::string title, unsigned int width, unsigned int height); Application(std::string title, unsigned int width, unsigned int height, bool fullscreen); ~Application(); void Run(); };
#pragma once #include <SDL2/SDL.h> #include <string> class Application { private: // Main loop flag bool quit; // The window SDL_Window* window; // The window renderer SDL_Renderer* renderer; // The background color SDL_Color backgroundColor; // Window properties std::string title; unsigned int windowWidth; unsigned int windowHeight; bool isFullscreen; bool init(); void close(); void draw(); protected: // Event called after initialized virtual void on_init(); // Event called when before drawing the screen in the loop virtual void on_update(); // Event called when drawing the screen in the loop virtual void on_draw(SDL_Renderer* renderer); void set_background_color(SDL_Color color); public: Application(); Application(std::string title); Application(std::string title, unsigned int width, unsigned int height); Application(std::string title, unsigned int width, unsigned int height, bool fullscreen); ~Application(); void Run(); };
--- +++ @@ -40,6 +40,21 @@ void set_background_color(SDL_Color color); + + unsigned int get_window_height() + { + return windowHeight; + } + + unsigned int get_window_width() + { + return windowWidth; + } + + bool is_fullscreen() + { + return isFullscreen; + } public: Application();
Add getters for window constants
mit
gldraphael/SdlTemplate
dd3ef21ed70fa4d34f6713f83089c821b2707a60
// // OAuthManager.h // // Created by Ari Lerner on 5/31/16. // Copyright © 2016 Facebook. All rights reserved. // #import <Foundation/Foundation.h> #if __has_include(<React/RCTBridgeModule.h>) #import <React/RCTBridgeModule.h> #else #import "RCTBridgeModule.h" #endif #if __has_include(<React/RCTLinkingManager.h>) #import <React/RCTLinkingManager.h> #else #import "RCTLinkingManager.h" #endif @class OAuthClient; static NSString *kAuthConfig = @"OAuthManager"; @interface OAuthManager : NSObject <RCTBridgeModule, UIWebViewDelegate> + (instancetype) sharedManager; + (BOOL)setupOAuthHandler:(UIApplication *)application; + (BOOL)handleOpenUrl:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; - (BOOL) _configureProvider:(NSString *) name andConfig:(NSDictionary *) config; - (NSDictionary *) getConfigForProvider:(NSString *)name; @property (nonatomic, strong) NSDictionary *providerConfig; @property (nonatomic, strong) NSArray *callbackUrls; @end
// // OAuthManager.h // // Created by Ari Lerner on 5/31/16. // Copyright © 2016 Facebook. All rights reserved. // #import <Foundation/Foundation.h> #if __has_include(<React/RCTBridgeModule.h>) #import <React/RCTBridgeModule.h> #else #import "RCTBridgeModule.h" #endif #if __has_include("RCTLinkingManager.h") #import "RCTLinkingManager.h" #else #import <React/RCTLinkingManager.h> #endif @class OAuthClient; static NSString *kAuthConfig = @"OAuthManager"; @interface OAuthManager : NSObject <RCTBridgeModule, UIWebViewDelegate> + (instancetype) sharedManager; + (BOOL)setupOAuthHandler:(UIApplication *)application; + (BOOL)handleOpenUrl:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; - (BOOL) _configureProvider:(NSString *) name andConfig:(NSDictionary *) config; - (NSDictionary *) getConfigForProvider:(NSString *)name; @property (nonatomic, strong) NSDictionary *providerConfig; @property (nonatomic, strong) NSArray *callbackUrls; @end
--- +++ @@ -13,10 +13,10 @@ #import "RCTBridgeModule.h" #endif -#if __has_include("RCTLinkingManager.h") +#if __has_include(<React/RCTLinkingManager.h>) + #import <React/RCTLinkingManager.h> +#else #import "RCTLinkingManager.h" -#else - #import <React/RCTLinkingManager.h> #endif
Fix duplicate React library import error conflict w/certain pods
mit
fullstackreact/react-native-oauth,fullstackreact/react-native-oauth,fullstackreact/react-native-oauth
3949c3ba8cec129241ce6c47534f417d619c34e3
// Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include <X11/keysym.h> #include <X11/XKBlib.h> #include <X11/cursorfont.h> #include <X11/X.h> #include "input/Input.h" namespace ouzel { class Engine; namespace input { class InputLinux: public Input { friend Engine; public: static KeyboardKey convertKeyCode(KeySym keyCode); static uint32_t getModifiers(unsigned int state); virtual ~InputLinux(); virtual void setCursorVisible(bool visible) override; virtual bool isCursorVisible() const override; virtual void setCursorLocked(bool locked) override; virtual bool isCursorLocked() const override; virtual void setCursorPosition(const Vector2& position) override; protected: InputLinux(); virtual bool init() override; bool cursorVisible = true; bool cursorLocked = false; ::Cursor emptyCursor = None; }; } // namespace input } // namespace ouzel
// Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include <X11/keysym.h> #include <X11/XKBlib.h> #include <X11/cursorfont.h> #include <X11/X.h> #include "input/Input.h" namespace ouzel { class Engine; namespace input { class InputLinux: public Input { friend Engine; public: static KeyboardKey convertKeyCode(KeySym keyCode); static uint32_t getModifiers(unsigned int state); virtual ~InputLinux(); virtual void setCursorVisible(bool visible) override; virtual bool isCursorVisible() const override; virtual void setCursorLocked(bool locked) override; virtual bool isCursorLocked() const override; virtual void setCursorPosition(const Vector2& position) override; protected: InputLinux(); virtual bool init() override; bool cursorVisible = true; bool cursorLocked = false; Cursor emptyCursor = None; }; } // namespace input } // namespace ouzel
--- +++ @@ -38,7 +38,7 @@ bool cursorVisible = true; bool cursorLocked = false; - Cursor emptyCursor = None; + ::Cursor emptyCursor = None; }; } // namespace input } // namespace ouzel
Fix the declaration of Cursor on Linux
unlicense
Hotspotmar/ouzel,elvman/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elnormous/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elvman/ouzel
c3a30babd416d7c91ba0d187ff9e57df49930595
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_BUILTIN_H #define _UTILS_BUILTIN_H /* macros for accessing compiler builtins */ #include <assert.h> #define CTZ(x) __builtin_ctz(x) #define CLZ(x) __builtin_clz(x) #define OFFSETOF(type, member) __builtin_offsetof(type, member) #define TYPES_COMPATIBLE(t1, t2) __builtin_types_compatible_p(t1, t2) #define CHOOSE_EXPR(cond, x, y) __builtin_choose_expr(cond, x, y) #define IS_CONSTANT(expr) __builtin_constant_p(expr) #define POPCOUNT(x) __builtin_popcount(x) #define UNREACHABLE() \ do { \ assert(!"unreachable"); \ __builtin_unreachable(); \ } while (0) /* Borrowed from linux/include/linux/compiler.h */ #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #endif /* _UTILS_BUILTIN_H */
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_BUILTIN_H #define _UTILS_BUILTIN_H /* macros for accessing compiler builtins */ #include <assert.h> #define CTZ(x) __builtin_ctz(x) #define CLZ(x) __builtin_clz(x) #define OFFSETOF(type, member) __builtin_offsetof(type, member) #define TYPES_COMPATIBLE(t1, t2) __builtin_types_compatible_p(t1, t2) #define CHOOSE_EXPR(cond, x, y) __builtin_choose_expr(cond, x, y) #define IS_CONSTANT(expr) __builtin_constant_p(expr) #define POPCOUNT(x) __builtin_popcount(x) #define UNREACHABLE() \ do { \ assert(!"unreachable"); \ __builtin_unreachable(); \ } while (0) #endif /* _UTILS_BUILTIN_H */
--- +++ @@ -27,4 +27,8 @@ __builtin_unreachable(); \ } while (0) +/* Borrowed from linux/include/linux/compiler.h */ +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + #endif /* _UTILS_BUILTIN_H */
Add likely and unlikely macros.
bsd-2-clause
agacek/util_libs,winksaville/libutils,agacek/util_libs,agacek/util_libs,seL4/libutils,agacek/util_libs
9e469bb71d97fb04c425c0955e27174841fe4ba8
#include <stdio.h> #include <string.h> #ifdef WIN32 #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT extern #endif DLLEXPORT void Nothing() { /* we don't even print something */ } DLLEXPORT int Argless() { return 2; } DLLEXPORT int long_and_complicated_name() { return 3; }
#include <stdio.h> #include <string.h> #ifdef WIN32 #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT extern #endif DLLEXPORT Nothing() { /* we don't even print something */ } DLLEXPORT int Argless() { return 2; } DLLEXPORT int long_and_complicated_name() { return 3; }
--- +++ @@ -7,7 +7,7 @@ #define DLLEXPORT extern #endif -DLLEXPORT Nothing() +DLLEXPORT void Nothing() { /* we don't even print something */ }
Fix compiler warnings on OS X / JVM backend
artistic-2.0
Leont/rakudo,softmoth/rakudo,salortiz/rakudo,skids/rakudo,dankogai/rakudo,laben/rakudo,ugexe/rakudo,ungrim97/rakudo,labster/rakudo,tony-o/deb-rakudodaily,salortiz/rakudo,usev6/rakudo,salortiz/rakudo,tony-o/deb-rakudodaily,teodozjan/rakudo,nbrown/rakudo,rakudo/rakudo,ungrim97/rakudo,MasterDuke17/rakudo,awwaiid/rakudo,zostay/rakudo,tony-o/rakudo,labster/rakudo,nunorc/rakudo,usev6/rakudo,b2gills/rakudo,jonathanstowe/rakudo,salortiz/rakudo,samcv/rakudo,sjn/rakudo,tbrowder/rakudo,zostay/rakudo,softmoth/rakudo,jonathanstowe/rakudo,lucasbuchala/rakudo,Gnouc/rakudo,ab5tract/rakudo,dankogai/rakudo,ugexe/rakudo,b2gills/rakudo,cognominal/rakudo,skids/rakudo,tony-o/deb-rakudodaily,cygx/rakudo,zostay/rakudo,tony-o/rakudo,LLFourn/rakudo,zhuomingliang/rakudo,cognominal/rakudo,ab5tract/rakudo,tony-o/deb-rakudodaily,sergot/rakudo,tony-o/rakudo,MasterDuke17/rakudo,lucasbuchala/rakudo,tony-o/deb-rakudodaily,labster/rakudo,rakudo/rakudo,raydiak/rakudo,raydiak/rakudo,cygx/rakudo,nbrown/rakudo,lucasbuchala/rakudo,azawawi/rakudo,nbrown/rakudo,azawawi/rakudo,Gnouc/rakudo,skids/rakudo,samcv/rakudo,paultcochrane/rakudo,awwaiid/rakudo,LLFourn/rakudo,usev6/rakudo,ugexe/rakudo,skids/rakudo,samcv/rakudo,jonathanstowe/rakudo,paultcochrane/rakudo,niner/rakudo,b2gills/rakudo,laben/rakudo,nbrown/rakudo,ugexe/rakudo,cognominal/rakudo,sjn/rakudo,laben/rakudo,samcv/rakudo,ugexe/rakudo,raydiak/rakudo,LLFourn/rakudo,paultcochrane/rakudo,laben/rakudo,cygx/rakudo,raydiak/rakudo,sergot/rakudo,ab5tract/rakudo,azawawi/rakudo,paultcochrane/rakudo,tbrowder/rakudo,tbrowder/rakudo,nunorc/rakudo,awwaiid/rakudo,rakudo/rakudo,ab5tract/rakudo,usev6/rakudo,labster/rakudo,tony-o/deb-rakudodaily,softmoth/rakudo,tony-o/rakudo,teodozjan/rakudo,niner/rakudo,nunorc/rakudo,zhuomingliang/rakudo,cygx/rakudo,Gnouc/rakudo,azawawi/rakudo,usev6/rakudo,softmoth/rakudo,Gnouc/rakudo,dankogai/rakudo,sergot/rakudo,Gnouc/rakudo,salortiz/rakudo,ab5tract/rakudo,zhuomingliang/rakudo,awwaiid/rakudo,b2gills/rakudo,tony-o/rakudo,sjn/rakudo,labster/rakudo,Gnouc/rakudo,samcv/rakudo,rakudo/rakudo,ungrim97/rakudo,LLFourn/rakudo,ungrim97/rakudo,rakudo/rakudo,tbrowder/rakudo,tbrowder/rakudo,awwaiid/rakudo,Leont/rakudo,tony-o/rakudo,MasterDuke17/rakudo,cognominal/rakudo,azawawi/rakudo,tbrowder/rakudo,dankogai/rakudo,MasterDuke17/rakudo,softmoth/rakudo,labster/rakudo,nbrown/rakudo,Leont/rakudo,lucasbuchala/rakudo,cygx/rakudo,b2gills/rakudo,salortiz/rakudo,sjn/rakudo,cognominal/rakudo,MasterDuke17/rakudo,tony-o/deb-rakudodaily,nunorc/rakudo,paultcochrane/rakudo,nbrown/rakudo,MasterDuke17/rakudo,sergot/rakudo,Leont/rakudo,jonathanstowe/rakudo,zhuomingliang/rakudo,niner/rakudo,skids/rakudo,ungrim97/rakudo,teodozjan/rakudo,teodozjan/rakudo,LLFourn/rakudo,rakudo/rakudo,lucasbuchala/rakudo,dankogai/rakudo,zostay/rakudo,sjn/rakudo,jonathanstowe/rakudo,niner/rakudo
4659f32c7023d6c92874e284d3c031418d634728
#include "papi.h" #include <sys/procfs.h> #include <stdio.h> #include <fcntl.h> int get_memory_info( PAPI_mem_info_t * mem_info ){ int retval = 0; return PAPI_OK; } long _papi_hwd_get_dmem_info(int option){ pid_t pid = getpid(); prpsinfo_t info; char pfile[256]; int fd; sprintf(pfile, "/proc/%05d", pid); if((fd=open(pfile,O_RDONLY)) <0 ) { DBG((stderr,"PAPI_get_dmem_info can't open /proc/%d\n",pid)); return(PAPI_ESYS); } if(ioctl(fd, PIOCPSINFO, &info)<0){ return(PAPI_ESYS); } close(fd); switch(option){ case PAPI_GET_RESSIZE: return(info.pr_rssize); case PAPI_GET_SIZE: return(info.pr_size); default: return(PAPI_EINVAL); } }
#include "papi.h" int get_memory_info( PAPI_mem_info_t * mem_info ){ int retval = 0; return PAPI_OK; } long _papi_hwd_get_dmem_info(int option){ }
--- +++ @@ -1,4 +1,7 @@ #include "papi.h" +#include <sys/procfs.h> +#include <stdio.h> +#include <fcntl.h> int get_memory_info( PAPI_mem_info_t * mem_info ){ int retval = 0; @@ -6,4 +9,26 @@ } long _papi_hwd_get_dmem_info(int option){ + pid_t pid = getpid(); + prpsinfo_t info; + char pfile[256]; + int fd; + + sprintf(pfile, "/proc/%05d", pid); + if((fd=open(pfile,O_RDONLY)) <0 ) { + DBG((stderr,"PAPI_get_dmem_info can't open /proc/%d\n",pid)); + return(PAPI_ESYS); + } + if(ioctl(fd, PIOCPSINFO, &info)<0){ + return(PAPI_ESYS); + } + close(fd); + switch(option){ + case PAPI_GET_RESSIZE: + return(info.pr_rssize); + case PAPI_GET_SIZE: + return(info.pr_size); + default: + return(PAPI_EINVAL); + } }
Support for dynamic memory information added for Alpha
bsd-3-clause
pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi
ef0e80e41dafccc5d3b64b37d150b4cee858997e
/* * scheduler.h * * Created on: Jun 8, 2016 * Author: riley */ #ifndef SCHEDULER_H #define SCHEDULER_H #include <stdint.h> #include "scheduler_private.h" typedef void (*task_func_t)( void ) ; typedef volatile struct task_private_s { const char * name; volatile void * task_sp; //Task stack pointer volatile struct task_private_s * next; } task_t; /// Sets up the idle task void scheduler_init( void ); /** * Add task to task list to be run at next context switch. */ void scheduler_add_task(task_t * task_handle, const char * name, task_func_t func, uint16_t * task_stack, uint16_t stack_bytes); /// Kicks off the timer interrupt void scheduler_run( void ); /** * Handy macro which blackboxes the allocation of memory * per task. Accepts the task function to schedule * and the size of stack to allocate as arguments. */ #define SCHEDULER_ADD(func, stack_size) \ CREATE_TASK_HANDLE(__LINE__, func); \ CREATE_TASK_STACK(__LINE__, func, stack_size); \ CALL_SCHEDULER_ADD(__LINE__, func); #endif /* SCHEDULER_H */
/* * scheduler.h * * Created on: Jun 8, 2016 * Author: riley */ #ifndef SCHEDULER_H #define SCHEDULER_H #include <stdint.h> #include "scheduler_private.h" typedef void (*task_func_t)( void ) ; typedef volatile struct task_private_s { const char * name; volatile void * task_sp; //Task stack pointer volatile struct task_private_s * next; } task_t; /// Sets up the idle task void scheduler_init( void ); /** * Add task to task list to be run at next context switch. * Push task routine pointer and empty status register * onto the new task stack so they can be popped off later * from the task switch interrupt. */ void scheduler_add_task(task_t * task_handle, const char * name, task_func_t func, uint16_t * task_stack, uint16_t stack_bytes); /// Kicks off the timer interrupt void scheduler_run( void ); /** * Handy macro which blackboxes the allocation of memory * per task. Accepts the task function to schedule * and the size of stack to allocate as arguments. */ #define SCHEDULER_ADD(func, stack_size) \ CREATE_TASK_HANDLE(__LINE__, func); \ CREATE_TASK_STACK(__LINE__, func, stack_size); \ CALL_SCHEDULER_ADD(__LINE__, func); #endif /* SCHEDULER_H */
--- +++ @@ -25,9 +25,6 @@ /** * Add task to task list to be run at next context switch. - * Push task routine pointer and empty status register - * onto the new task stack so they can be popped off later - * from the task switch interrupt. */ void scheduler_add_task(task_t * task_handle, const char * name, task_func_t func, uint16_t * task_stack, uint16_t stack_bytes);
Remove implementation details from API comment
mit
rjw245/rileyOS
f44be40fe1d9be9535a4819d7ef468cbba34ea74
// Make sure instrumentation data from available_externally functions doesn't // get thrown out and are emitted with the expected linkage. // RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 // CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data,regular,live_support", align 8 inline int foo(void) { return 1; } int main(void) { return foo(); }
// Make sure instrumentation data from available_externally functions doesn't // get thrown out and are emitted with the expected linkage. // RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 // CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data", align 8 inline int foo(void) { return 1; } int main(void) { return foo(); }
--- +++ @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 -// CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data", align 8 +// CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data,regular,live_support", align 8 inline int foo(void) { return 1; } int main(void) {
[Profile] Update testcase for r283948 (NFC) Old: "__DATA,__llvm_prf_data" New: "__DATA,__llvm_prf_data,regular,live_support" This should fix the following bot failure: http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55158 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@283949 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
88f1ce548a1e06c1d40dea57346dcd654f718fb7
//===--- TargetBuiltins.h - Target specific builtin IDs -------------------===// // // The LLVM Compiler Infrastructure // // This file was developed by Anders Carlsson and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_TARGET_BUILTINS_H #define LLVM_CLANG_AST_TARGET_BUILTINS_H #include "clang/AST/Builtins.h" /// X86 builtins namespace X86 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, #include "X86Builtins.def" LastTSBuiltin }; } /// PPC builtins namespace PPC { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, #include "PPCBuiltins.def" LastTSBuiltin }; } #endif
//===--- TargetBuiltins.h - Target specific builtin IDs -------------------===// // // The LLVM Compiler Infrastructure // // This file was developed by Anders Carlsson and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_TARGET_BUILTINS_H #define LLVM_CLANG_AST_TARGET_BUILTINS_H #include "clang/AST/Builtins.h" namespace clang { /// X86 builtins namespace X86 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, #include "X86Builtins.def" LastTSBuiltin }; } /// PPC builtins namespace PPC { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, #include "PPCBuiltins.def" LastTSBuiltin }; } } #endif
--- +++ @@ -11,8 +11,6 @@ #define LLVM_CLANG_AST_TARGET_BUILTINS_H #include "clang/AST/Builtins.h" - -namespace clang { /// X86 builtins namespace X86 { @@ -34,6 +32,4 @@ }; } -} - #endif
Revert change that broke the build. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@44808 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,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,llvm-mirror/clang,apple/swift-clang
05f753b996a6ea712ab06787190fb3287610fc59
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <termbox.h> #include "editor.h" #include "util.h" // termbox catches ctrl-z as a regular key event. To suspend the process as // normal, manually raise SIGTSTP. // // Not 100% sure why we need to shutdown termbox, but the terminal gets all // weird if we don't. Mainly copied this approach from here: // https://github.com/nsf/godit/blob/master/suspend_linux.go static void suspend(editor_t *editor) { tb_shutdown(); raise(SIGTSTP); int err = tb_init(); if (err) { fprintf(stderr, "tb_init() failed with error code %d\n", err); exit(1); } editor_draw(editor); } int main(int argc, char *argv[]) { debug_init(); editor_t editor; cursor_t cursor; editor_init(&editor, &cursor, argc > 1 ? argv[1] : NULL); int err = tb_init(); if (err) { fprintf(stderr, "tb_init() failed with error code %d\n", err); return 1; } atexit(tb_shutdown); editor_draw(&editor); struct tb_event ev; while (tb_poll_event(&ev)) { switch (ev.type) { case TB_EVENT_KEY: if (ev.key == TB_KEY_CTRL_Z) { suspend(&editor); } else { editor_handle_key_press(&editor, &ev); } break; case TB_EVENT_RESIZE: editor_draw(&editor); break; default: break; } } return 0; }
#include <stdio.h> #include <stdlib.h> #include <termbox.h> #include "editor.h" #include "util.h" int main(int argc, char *argv[]) { debug_init(); editor_t editor; cursor_t cursor; editor_init(&editor, &cursor, argc > 1 ? argv[1] : NULL); int err = tb_init(); if (err) { fprintf(stderr, "tb_init() failed with error code %d\n", err); return 1; } atexit(tb_shutdown); editor_draw(&editor); struct tb_event ev; while (tb_poll_event(&ev)) { switch (ev.type) { case TB_EVENT_KEY: editor_handle_key_press(&editor, &ev); break; case TB_EVENT_RESIZE: editor_draw(&editor); break; default: break; } } return 0; }
--- +++ @@ -1,10 +1,32 @@ #include <stdio.h> #include <stdlib.h> + +#include <signal.h> #include <termbox.h> #include "editor.h" #include "util.h" + +// termbox catches ctrl-z as a regular key event. To suspend the process as +// normal, manually raise SIGTSTP. +// +// Not 100% sure why we need to shutdown termbox, but the terminal gets all +// weird if we don't. Mainly copied this approach from here: +// https://github.com/nsf/godit/blob/master/suspend_linux.go +static void suspend(editor_t *editor) { + tb_shutdown(); + + raise(SIGTSTP); + + int err = tb_init(); + if (err) { + fprintf(stderr, "tb_init() failed with error code %d\n", err); + exit(1); + } + + editor_draw(editor); +} int main(int argc, char *argv[]) { debug_init(); @@ -26,7 +48,11 @@ while (tb_poll_event(&ev)) { switch (ev.type) { case TB_EVENT_KEY: - editor_handle_key_press(&editor, &ev); + if (ev.key == TB_KEY_CTRL_Z) { + suspend(&editor); + } else { + editor_handle_key_press(&editor, &ev); + } break; case TB_EVENT_RESIZE: editor_draw(&editor);
Handle Ctrl-Z to suspend the process.
mit
isbadawi/badavi
459c21926c5bbefe8689a4b4fd6088d0e6ed05f1
extern void denoise(void*, int, const uint32_t *in, uint32_t *out, int h, int w); extern void *kernelInit(void); extern void kernelFinalize(void*); enum { // "Real" filters SPATIAL, TEMPORAL_AVG, ADAPTIVE_TEMPORAL_AVG, KNN, AKNN, // Helpers DIFF, SOBEL, MOTION, NFILTERS, };
extern void denoise(void*, int, const uint32_t *in, uint32_t *out, int h, int w); extern void *kernelInit(void); extern void kernelFinalize(void*); enum { SPATIAL, TEMPORAL_AVG, KNN, AKNN, ADAPTIVE_TEMPORAL_AVG, DIFF, SOBEL, MOTION, };
--- +++ @@ -3,12 +3,16 @@ extern void kernelFinalize(void*); enum { + // "Real" filters SPATIAL, TEMPORAL_AVG, + ADAPTIVE_TEMPORAL_AVG, KNN, AKNN, - ADAPTIVE_TEMPORAL_AVG, + // Helpers DIFF, SOBEL, MOTION, + + NFILTERS, };
Add comments for filter enums
mit
xiaq/webcamfilter,xiaq/webcamfilter,xiaq/webcamfilter
cde8356ff78ad98f1c5cf8f34fa92014a1c0342f
/** \file * This file only exists to contain the front-page of the documentation */ /** \mainpage Documentation of the API if the Tiramisu Compiler * * Tiramisu provides few classes to enable users to represent their program: * - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C. * - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar. * - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function. * - The \ref tiramisu::var class: used to represent loop iterators. Usually we declare a var (a loop iterator) and then use it for the declaration of computations. The range of that variable defines the loop range. When use witha buffer it defines the buffer size and when used with an input it defines the input size. * - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain. * - The \ref tiramisu::buffer class: a class to represent memory buffers. */
/** \file * This file only exists to contain the front-page of the documentation */ /** \mainpage Documentation of the API if the Tiramisu Compiler * * Tiramisu provides few classes to enable users to represent their program: * - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C. * - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar. * - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function. * - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain. * - The \ref tiramisu::buffer class: a class to represent memory buffers. * */
--- +++ @@ -8,7 +8,7 @@ * - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C. * - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar. * - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function. + * - The \ref tiramisu::var class: used to represent loop iterators. Usually we declare a var (a loop iterator) and then use it for the declaration of computations. The range of that variable defines the loop range. When use witha buffer it defines the buffer size and when used with an input it defines the input size. * - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain. * - The \ref tiramisu::buffer class: a class to represent memory buffers. - * */
Fix the documentation main page
mit
rbaghdadi/COLi,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/ISIR,rbaghdadi/ISIR,rbaghdadi/COLi
accec546d710228b9b2a5cc84557cde6624d7a89
/* Interface to various FFT libraries. Double complex FFT and IFFT, arbitrary dimensions. Author: Pearu Peterson, August 2002 */ #include "fftpack.h" /* The following macro convert private backend specific function to the public * functions exported by the module */ #define GEN_PUBLIC_API(name) \ void destroy_zfftnd_cache(void)\ {\ destroy_zfftnd_##name##_caches();\ }\ \ void zfftnd(complex_double * inout, int rank,\ int *dims, int direction, int howmany, int normalize)\ {\ zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\ } #include "zfftnd_fftpack.c" GEN_PUBLIC_API(fftpack)
/* Interface to various FFT libraries. Double complex FFT and IFFT, arbitrary dimensions. Author: Pearu Peterson, August 2002 */ #include "fftpack.h" /* The following macro convert private backend specific function to the public * functions exported by the module */ #define GEN_PUBLIC_API(name) \ void destroy_zfftnd_cache(void)\ {\ destroy_zfftnd_##name##_caches();\ }\ \ void zfftnd(complex_double * inout, int rank,\ int *dims, int direction, int howmany, int normalize)\ {\ zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\ } #if defined(WITH_FFTW) || defined(WITH_MKL) static int equal_dims(int rank,int *dims1,int *dims2) { int i; for (i=0;i<rank;++i) if (dims1[i]!=dims2[i]) return 0; return 1; } #endif #ifdef WITH_FFTW3 #include "zfftnd_fftw3.c" GEN_PUBLIC_API(fftw3) #elif defined WITH_FFTW #include "zfftnd_fftw.c" GEN_PUBLIC_API(fftw) #elif defined WITH_MKL #include "zfftnd_mkl.c" GEN_PUBLIC_API(mkl) #else /* Use fftpack by default */ #include "zfftnd_fftpack.c" GEN_PUBLIC_API(fftpack) #endif
--- +++ @@ -19,27 +19,5 @@ zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\ } -#if defined(WITH_FFTW) || defined(WITH_MKL) -static -int equal_dims(int rank,int *dims1,int *dims2) { - int i; - for (i=0;i<rank;++i) - if (dims1[i]!=dims2[i]) - return 0; - return 1; -} -#endif - -#ifdef WITH_FFTW3 - #include "zfftnd_fftw3.c" - GEN_PUBLIC_API(fftw3) -#elif defined WITH_FFTW - #include "zfftnd_fftw.c" - GEN_PUBLIC_API(fftw) -#elif defined WITH_MKL - #include "zfftnd_mkl.c" - GEN_PUBLIC_API(mkl) -#else /* Use fftpack by default */ - #include "zfftnd_fftpack.c" - GEN_PUBLIC_API(fftpack) -#endif +#include "zfftnd_fftpack.c" +GEN_PUBLIC_API(fftpack)
Remove any non-fftpack code for complex, multi-dimension fft.
bsd-3-clause
lhilt/scipy,zaxliu/scipy,behzadnouri/scipy,andyfaff/scipy,andim/scipy,newemailjdm/scipy,gef756/scipy,jor-/scipy,fernand/scipy,witcxc/scipy,Eric89GXL/scipy,behzadnouri/scipy,futurulus/scipy,gef756/scipy,gfyoung/scipy,ogrisel/scipy,mdhaber/scipy,maciejkula/scipy,bkendzior/scipy,ilayn/scipy,chatcannon/scipy,aarchiba/scipy,cpaulik/scipy,juliantaylor/scipy,pyramania/scipy,felipebetancur/scipy,jseabold/scipy,juliantaylor/scipy,Dapid/scipy,minhlongdo/scipy,haudren/scipy,petebachant/scipy,fernand/scipy,sargas/scipy,jsilter/scipy,minhlongdo/scipy,jor-/scipy,mingwpy/scipy,felipebetancur/scipy,maciejkula/scipy,vhaasteren/scipy,matthewalbani/scipy,mortonjt/scipy,niknow/scipy,pschella/scipy,vberaudi/scipy,felipebetancur/scipy,mortada/scipy,vanpact/scipy,zxsted/scipy,FRidh/scipy,aman-iitj/scipy,ales-erjavec/scipy,maciejkula/scipy,zerothi/scipy,perimosocordiae/scipy,jamestwebber/scipy,jor-/scipy,jakevdp/scipy,sauliusl/scipy,vigna/scipy,ales-erjavec/scipy,mgaitan/scipy,vberaudi/scipy,fernand/scipy,chatcannon/scipy,mortonjt/scipy,dominicelse/scipy,juliantaylor/scipy,mingwpy/scipy,dominicelse/scipy,WillieMaddox/scipy,mingwpy/scipy,surhudm/scipy,sriki18/scipy,anntzer/scipy,piyush0609/scipy,matthewalbani/scipy,mdhaber/scipy,surhudm/scipy,pyramania/scipy,juliantaylor/scipy,Kamp9/scipy,sauliusl/scipy,apbard/scipy,aarchiba/scipy,richardotis/scipy,aeklant/scipy,raoulbq/scipy,sargas/scipy,aman-iitj/scipy,sonnyhu/scipy,mortada/scipy,trankmichael/scipy,Kamp9/scipy,kleskjr/scipy,jakevdp/scipy,ales-erjavec/scipy,lukauskas/scipy,giorgiop/scipy,hainm/scipy,cpaulik/scipy,pnedunuri/scipy,Stefan-Endres/scipy,giorgiop/scipy,zerothi/scipy,mgaitan/scipy,Dapid/scipy,ales-erjavec/scipy,hainm/scipy,newemailjdm/scipy,jsilter/scipy,matthew-brett/scipy,nvoron23/scipy,rgommers/scipy,lhilt/scipy,befelix/scipy,nmayorov/scipy,minhlongdo/scipy,bkendzior/scipy,endolith/scipy,andyfaff/scipy,nvoron23/scipy,behzadnouri/scipy,kleskjr/scipy,haudren/scipy,gfyoung/scipy,sonnyhu/scipy,vhaasteren/scipy,raoulbq/scipy,dch312/scipy,FRidh/scipy,perimosocordiae/scipy,woodscn/scipy,aeklant/scipy,aman-iitj/scipy,pizzathief/scipy,mgaitan/scipy,pschella/scipy,newemailjdm/scipy,mgaitan/scipy,mhogg/scipy,kleskjr/scipy,jor-/scipy,rgommers/scipy,sonnyhu/scipy,dominicelse/scipy,mikebenfield/scipy,anntzer/scipy,witcxc/scipy,jakevdp/scipy,zxsted/scipy,e-q/scipy,petebachant/scipy,richardotis/scipy,nmayorov/scipy,rmcgibbo/scipy,gfyoung/scipy,pbrod/scipy,njwilson23/scipy,anntzer/scipy,gfyoung/scipy,vberaudi/scipy,grlee77/scipy,richardotis/scipy,ilayn/scipy,lukauskas/scipy,matthew-brett/scipy,andim/scipy,nvoron23/scipy,vhaasteren/scipy,larsmans/scipy,vigna/scipy,person142/scipy,trankmichael/scipy,lukauskas/scipy,matthewalbani/scipy,Stefan-Endres/scipy,ChanderG/scipy,gfyoung/scipy,befelix/scipy,mortonjt/scipy,apbard/scipy,witcxc/scipy,argriffing/scipy,pnedunuri/scipy,sauliusl/scipy,cpaulik/scipy,pyramania/scipy,WarrenWeckesser/scipy,piyush0609/scipy,vhaasteren/scipy,person142/scipy,vanpact/scipy,maniteja123/scipy,Shaswat27/scipy,andim/scipy,witcxc/scipy,apbard/scipy,trankmichael/scipy,kleskjr/scipy,e-q/scipy,Dapid/scipy,zxsted/scipy,niknow/scipy,sonnyhu/scipy,futurulus/scipy,mortada/scipy,cpaulik/scipy,piyush0609/scipy,Srisai85/scipy,FRidh/scipy,futurulus/scipy,sauliusl/scipy,njwilson23/scipy,woodscn/scipy,FRidh/scipy,scipy/scipy,teoliphant/scipy,rgommers/scipy,ilayn/scipy,argriffing/scipy,mtrbean/scipy,Gillu13/scipy,Gillu13/scipy,teoliphant/scipy,Newman101/scipy,zxsted/scipy,mhogg/scipy,mikebenfield/scipy,behzadnouri/scipy,haudren/scipy,felipebetancur/scipy,lhilt/scipy,rmcgibbo/scipy,maniteja123/scipy,futurulus/scipy,fredrikw/scipy,chatcannon/scipy,jseabold/scipy,surhudm/scipy,pbrod/scipy,njwilson23/scipy,anntzer/scipy,josephcslater/scipy,njwilson23/scipy,ogrisel/scipy,vigna/scipy,tylerjereddy/scipy,fredrikw/scipy,maniteja123/scipy,gertingold/scipy,cpaulik/scipy,grlee77/scipy,grlee77/scipy,piyush0609/scipy,pnedunuri/scipy,ilayn/scipy,Srisai85/scipy,pyramania/scipy,mhogg/scipy,Kamp9/scipy,Stefan-Endres/scipy,jseabold/scipy,WarrenWeckesser/scipy,raoulbq/scipy,lhilt/scipy,lukauskas/scipy,apbard/scipy,gertingold/scipy,kalvdans/scipy,aeklant/scipy,pbrod/scipy,jsilter/scipy,petebachant/scipy,Kamp9/scipy,mtrbean/scipy,argriffing/scipy,juliantaylor/scipy,andyfaff/scipy,Eric89GXL/scipy,haudren/scipy,mtrbean/scipy,hainm/scipy,hainm/scipy,pyramania/scipy,aman-iitj/scipy,pnedunuri/scipy,gertingold/scipy,vhaasteren/scipy,mdhaber/scipy,argriffing/scipy,gdooper/scipy,sriki18/scipy,ChanderG/scipy,zerothi/scipy,ilayn/scipy,zaxliu/scipy,befelix/scipy,Gillu13/scipy,matthewalbani/scipy,larsmans/scipy,mhogg/scipy,mtrbean/scipy,aeklant/scipy,Gillu13/scipy,anielsen001/scipy,nonhermitian/scipy,vigna/scipy,trankmichael/scipy,jamestwebber/scipy,Gillu13/scipy,zerothi/scipy,kalvdans/scipy,rmcgibbo/scipy,richardotis/scipy,WarrenWeckesser/scipy,aarchiba/scipy,person142/scipy,woodscn/scipy,pbrod/scipy,efiring/scipy,gef756/scipy,ortylp/scipy,WillieMaddox/scipy,pizzathief/scipy,arokem/scipy,zaxliu/scipy,vanpact/scipy,fredrikw/scipy,ortylp/scipy,Stefan-Endres/scipy,vanpact/scipy,anielsen001/scipy,e-q/scipy,petebachant/scipy,mhogg/scipy,fredrikw/scipy,pschella/scipy,ales-erjavec/scipy,WillieMaddox/scipy,anielsen001/scipy,ndchorley/scipy,ortylp/scipy,vanpact/scipy,ilayn/scipy,anielsen001/scipy,fredrikw/scipy,kalvdans/scipy,sargas/scipy,trankmichael/scipy,jakevdp/scipy,felipebetancur/scipy,Srisai85/scipy,mingwpy/scipy,kalvdans/scipy,behzadnouri/scipy,Gillu13/scipy,Srisai85/scipy,futurulus/scipy,jseabold/scipy,ogrisel/scipy,anntzer/scipy,chatcannon/scipy,hainm/scipy,efiring/scipy,tylerjereddy/scipy,perimosocordiae/scipy,petebachant/scipy,ortylp/scipy,pbrod/scipy,e-q/scipy,nonhermitian/scipy,raoulbq/scipy,andyfaff/scipy,raoulbq/scipy,rgommers/scipy,ChanderG/scipy,gdooper/scipy,minhlongdo/scipy,Eric89GXL/scipy,Kamp9/scipy,petebachant/scipy,woodscn/scipy,Dapid/scipy,argriffing/scipy,futurulus/scipy,scipy/scipy,endolith/scipy,richardotis/scipy,gdooper/scipy,gef756/scipy,perimosocordiae/scipy,nmayorov/scipy,Srisai85/scipy,sonnyhu/scipy,grlee77/scipy,jor-/scipy,vberaudi/scipy,jonycgn/scipy,maciejkula/scipy,pnedunuri/scipy,zaxliu/scipy,fernand/scipy,newemailjdm/scipy,grlee77/scipy,chatcannon/scipy,pizzathief/scipy,matthew-brett/scipy,jamestwebber/scipy,nvoron23/scipy,dch312/scipy,josephcslater/scipy,Newman101/scipy,jonycgn/scipy,jamestwebber/scipy,sriki18/scipy,mortada/scipy,woodscn/scipy,pbrod/scipy,WarrenWeckesser/scipy,woodscn/scipy,argriffing/scipy,ndchorley/scipy,ndchorley/scipy,ogrisel/scipy,josephcslater/scipy,tylerjereddy/scipy,apbard/scipy,bkendzior/scipy,anntzer/scipy,giorgiop/scipy,haudren/scipy,arokem/scipy,jonycgn/scipy,WillieMaddox/scipy,vberaudi/scipy,andim/scipy,niknow/scipy,sauliusl/scipy,dch312/scipy,sriki18/scipy,surhudm/scipy,mdhaber/scipy,zerothi/scipy,teoliphant/scipy,endolith/scipy,behzadnouri/scipy,jsilter/scipy,person142/scipy,scipy/scipy,ndchorley/scipy,larsmans/scipy,person142/scipy,jamestwebber/scipy,jjhelmus/scipy,jseabold/scipy,mtrbean/scipy,lukauskas/scipy,andyfaff/scipy,larsmans/scipy,Dapid/scipy,perimosocordiae/scipy,matthew-brett/scipy,fredrikw/scipy,mikebenfield/scipy,nonhermitian/scipy,ortylp/scipy,gef756/scipy,aman-iitj/scipy,rgommers/scipy,niknow/scipy,jjhelmus/scipy,rmcgibbo/scipy,sauliusl/scipy,Dapid/scipy,efiring/scipy,sargas/scipy,WillieMaddox/scipy,efiring/scipy,nvoron23/scipy,Stefan-Endres/scipy,Stefan-Endres/scipy,efiring/scipy,tylerjereddy/scipy,ChanderG/scipy,josephcslater/scipy,lukauskas/scipy,maciejkula/scipy,anielsen001/scipy,felipebetancur/scipy,mdhaber/scipy,vhaasteren/scipy,tylerjereddy/scipy,giorgiop/scipy,bkendzior/scipy,chatcannon/scipy,Kamp9/scipy,richardotis/scipy,sriki18/scipy,maniteja123/scipy,raoulbq/scipy,piyush0609/scipy,Newman101/scipy,mikebenfield/scipy,ChanderG/scipy,giorgiop/scipy,arokem/scipy,giorgiop/scipy,gdooper/scipy,niknow/scipy,ortylp/scipy,dominicelse/scipy,matthew-brett/scipy,minhlongdo/scipy,zerothi/scipy,Eric89GXL/scipy,mtrbean/scipy,aarchiba/scipy,Shaswat27/scipy,scipy/scipy,hainm/scipy,aman-iitj/scipy,rmcgibbo/scipy,lhilt/scipy,fernand/scipy,gef756/scipy,mingwpy/scipy,maniteja123/scipy,larsmans/scipy,dch312/scipy,sriki18/scipy,Shaswat27/scipy,mortonjt/scipy,pnedunuri/scipy,arokem/scipy,befelix/scipy,jjhelmus/scipy,andyfaff/scipy,nvoron23/scipy,pschella/scipy,Newman101/scipy,FRidh/scipy,nmayorov/scipy,teoliphant/scipy,jakevdp/scipy,pschella/scipy,jseabold/scipy,kleskjr/scipy,Newman101/scipy,mortada/scipy,ndchorley/scipy,ales-erjavec/scipy,ogrisel/scipy,endolith/scipy,jsilter/scipy,gertingold/scipy,Shaswat27/scipy,Newman101/scipy,efiring/scipy,matthewalbani/scipy,minhlongdo/scipy,cpaulik/scipy,rmcgibbo/scipy,mikebenfield/scipy,Shaswat27/scipy,newemailjdm/scipy,piyush0609/scipy,anielsen001/scipy,maniteja123/scipy,vigna/scipy,ChanderG/scipy,josephcslater/scipy,zaxliu/scipy,endolith/scipy,sargas/scipy,bkendzior/scipy,mgaitan/scipy,gdooper/scipy,kalvdans/scipy,zaxliu/scipy,surhudm/scipy,fernand/scipy,arokem/scipy,pizzathief/scipy,aeklant/scipy,kleskjr/scipy,mgaitan/scipy,Shaswat27/scipy,zxsted/scipy,teoliphant/scipy,aarchiba/scipy,trankmichael/scipy,nmayorov/scipy,dch312/scipy,gertingold/scipy,vberaudi/scipy,endolith/scipy,mdhaber/scipy,zxsted/scipy,jjhelmus/scipy,mortonjt/scipy,andim/scipy,jonycgn/scipy,dominicelse/scipy,njwilson23/scipy,pizzathief/scipy,Eric89GXL/scipy,nonhermitian/scipy,mhogg/scipy,FRidh/scipy,vanpact/scipy,WarrenWeckesser/scipy,WarrenWeckesser/scipy,witcxc/scipy,njwilson23/scipy,mortada/scipy,haudren/scipy,jonycgn/scipy,surhudm/scipy,andim/scipy,e-q/scipy,larsmans/scipy,perimosocordiae/scipy,newemailjdm/scipy,scipy/scipy,sonnyhu/scipy,mingwpy/scipy,Srisai85/scipy,niknow/scipy,nonhermitian/scipy,mortonjt/scipy,ndchorley/scipy,jonycgn/scipy,scipy/scipy,WillieMaddox/scipy,Eric89GXL/scipy,jjhelmus/scipy,befelix/scipy
c46c6a4191ef841fb9e5c852985cbaef31846329
#ifndef _SHAKE_H_ #define _SHAKE_H_ #ifdef __cplusplus extern "C" { #endif #include "shake_private.h" struct shakeDev; /* libShake functions */ int shakeInit(); void shakeQuit(); void shakeListDevices(); int shakeNumOfDevices(); shakeDev *shakeOpen(unsigned int id); void shakeClose(shakeDev *dev); int shakeQuery(shakeDev *dev); void shakeSetGain(shakeDev *dev, int gain); void shakeInitEffect(shakeEffect *effect, shakeEffectType type); int shakeUploadEffect(shakeDev *dev, shakeEffect effect); void shakeEraseEffect(shakeDev *dev, int id); void shakePlay(shakeDev *dev, int id); void shakeStop(shakeDev *dev, int id); #ifdef __cplusplus } #endif #endif /* _SHAKE_H_ */
#ifndef _SHAKE_H_ #define _SHAKE_H_ #include "shake_private.h" struct shakeDev; /* libShake functions */ int shakeInit(); void shakeQuit(); void shakeListDevices(); int shakeNumOfDevices(); shakeDev *shakeOpen(unsigned int id); void shakeClose(shakeDev *dev); int shakeQuery(shakeDev *dev); void shakeSetGain(shakeDev *dev, int gain); void shakeInitEffect(shakeEffect *effect, shakeEffectType type); int shakeUploadEffect(shakeDev *dev, shakeEffect effect); void shakeEraseEffect(shakeDev *dev, int id); void shakePlay(shakeDev *dev, int id); void shakeStop(shakeDev *dev, int id); #endif /* _SHAKE_H_ */
--- +++ @@ -1,5 +1,9 @@ #ifndef _SHAKE_H_ #define _SHAKE_H_ + +#ifdef __cplusplus +extern "C" { +#endif #include "shake_private.h" @@ -20,4 +24,8 @@ void shakePlay(shakeDev *dev, int id); void shakeStop(shakeDev *dev, int id); +#ifdef __cplusplus +} +#endif + #endif /* _SHAKE_H_ */
Use C calling convention when header is included by C++ code
mit
zear/libShake,ShadowApex/libShake,ShadowApex/libShake,zear/libShake
87abaffc4ee3c5a694657821e55d66f7520e66cd
/* Author: Dan Wilder * * School: University of Missouri - St. Louis * Semester: Fall 2015 * Class: CS 3130 - Design and Analysis of Algorithms * Instructor: Galina N. Piatnitskaia */ #include "sort_algorithms.h" void swap(int *x, int *y) { int temp = *x; *x = *y *y = temp; } void bubbleSort(int arr[], int size) { /* with swaps counting. */ int i, j; for (i = 0; i <= size-1; ++i) for (j = size; j >= i+1; --j) if (arr[j] < arr[j-1]) swap(&arr[j], &arr[j-1]); }
/* Author: Dan Wilder * * School: University of Missouri - St. Louis * Semester: Fall 2015 * Class: CS 3130 - Design and Analysis of Algorithms * Instructor: Galina N. Piatnitskaia */ #include "sort_algorithms.h" void swap(int *x, int *y) { int temp = *x; *x = *y *y = temp; } void bubbleSort(int arr[], int n) { /* with swaps counting. n is the size of arr. */ int i, j; for (i = 0; i <= n-1; ++i) for (j = n; j >= i+1; --j) if (arr[j] < arr[j-1]) swap(&arr[j], &arr[j-1]); }
--- +++ @@ -14,12 +14,12 @@ *y = temp; } -void bubbleSort(int arr[], int n) { -/* with swaps counting. n is the size of arr. +void bubbleSort(int arr[], int size) { +/* with swaps counting. */ int i, j; - for (i = 0; i <= n-1; ++i) - for (j = n; j >= i+1; --j) + for (i = 0; i <= size-1; ++i) + for (j = size; j >= i+1; --j) if (arr[j] < arr[j-1]) swap(&arr[j], &arr[j-1]); }
Change name of parameter in bubbleSort
mit
sentientWilder/Search-and-Sort,sentientWilder/Search-and-Sort
a919d4dcbd4286c675d4ef6d720dd80b71be3614
#include <stdio.h> #include <stdlib.h> /* for free */ #include <string.h> /* for strcmp */ #include <strings.h> #include <platform/cbassert.h> static void test_asprintf(void) { char *result = 0; cb_assert(asprintf(&result, "test 1") > 0); cb_assert(strcmp(result, "test 1") == 0); free(result); cb_assert(asprintf(&result, "test %d", 2) > 0); cb_assert(strcmp(result, "test 2") == 0); free(result); cb_assert(asprintf(&result, "%c%c%c%c %d", 't', 'e', 's', 't', 3) > 0); cb_assert(strcmp(result, "test 3") == 0); free(result); } int main(void) { test_asprintf(); return 0; }
#include <stdio.h> #include <stdlib.h> /* for free */ #include <string.h> /* for strcmp */ #include <strings.h> #include <platform/cbassert.h> static void test_asprintf(void) { char *result = 0; (void)asprintf(&result, "test 1"); cb_assert(strcmp(result, "test 1") == 0); free(result); (void)asprintf(&result, "test %d", 2); cb_assert(strcmp(result, "test 2") == 0); free(result); (void)asprintf(&result, "%c%c%c%c %d", 't', 'e', 's', 't', 3); cb_assert(strcmp(result, "test 3") == 0); free(result); } int main(void) { test_asprintf(); return 0; }
--- +++ @@ -7,15 +7,15 @@ static void test_asprintf(void) { char *result = 0; - (void)asprintf(&result, "test 1"); + cb_assert(asprintf(&result, "test 1") > 0); cb_assert(strcmp(result, "test 1") == 0); free(result); - (void)asprintf(&result, "test %d", 2); + cb_assert(asprintf(&result, "test %d", 2) > 0); cb_assert(strcmp(result, "test 2") == 0); free(result); - (void)asprintf(&result, "%c%c%c%c %d", 't', 'e', 's', 't', 3); + cb_assert(asprintf(&result, "%c%c%c%c %d", 't', 'e', 's', 't', 3) > 0); cb_assert(strcmp(result, "test 3") == 0); free(result); }
Check for return value for asprintf Change-Id: Ib163468aac1a5e52cef28c59b55be2287dc4ba43 Reviewed-on: http://review.couchbase.org/43023 Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com> Tested-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
apache-2.0
vmx/platform,vmx/platform
97c8ae2e5624cdd8576a9acc9b70a9cb7cb47927
#include <stdlib.h> #include "seatest.h" static void test_abs (void) { // abs assert_int_equal(0, abs(0)); assert_int_equal(1, abs(1)); assert_int_equal(INT_MAX, abs(INT_MAX)); assert_int_equal(1, abs(-1)); // labs assert_true(labs(0) == 0); assert_true(labs(1) == 1); assert_true(labs(LONG_MAX) == LONG_MAX); assert_true(labs(-1) == 1); // llabs assert_true(llabs(0) == 0); assert_true(llabs(1) == 1); assert_true(llabs(LLONG_MAX) == LLONG_MAX); assert_true(llabs(-1) == 1); } void test_stdlib (void) { test_fixture_start(); run_test(test_abs); test_fixture_end(); }
#include <stdlib.h> #include "seatest.h" static void test_abs (void) { // abs assert_true(abs(0) == 0); assert_true(abs(1) == 1); assert_true(abs(INT_MAX) == INT_MAX); assert_true(abs(-1) == 1); // labs assert_true(labs(0) == 0); assert_true(labs(1) == 1); assert_true(labs(LONG_MAX) == LONG_MAX); assert_true(labs(-1) == 1); // llabs assert_true(llabs(0) == 0); assert_true(llabs(1) == 1); assert_true(llabs(LLONG_MAX) == LLONG_MAX); assert_true(llabs(-1) == 1); } void test_stdlib (void) { test_fixture_start(); run_test(test_abs); test_fixture_end(); }
--- +++ @@ -4,10 +4,10 @@ static void test_abs (void) { // abs - assert_true(abs(0) == 0); - assert_true(abs(1) == 1); - assert_true(abs(INT_MAX) == INT_MAX); - assert_true(abs(-1) == 1); + assert_int_equal(0, abs(0)); + assert_int_equal(1, abs(1)); + assert_int_equal(INT_MAX, abs(INT_MAX)); + assert_int_equal(1, abs(-1)); // labs assert_true(labs(0) == 0); assert_true(labs(1) == 1);
Use assert_int_equal not assert_true where possible
mit
kristapsk/resclib,kristapsk/resclib,kristapsk/reclib,kristapsk/reclib
4ebe6c82223445eaf08ef58f8abb031c8b5297b9
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessageUnknown, WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, WMFWKScriptMessageArticleState }; @interface WKScriptMessage (WMFScriptMessage) + (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name; + (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type; @end
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, WMFWKScriptMessageArticleState, WMFWKScriptMessageUnknown }; @interface WKScriptMessage (WMFScriptMessage) + (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name; + (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type; @end
--- +++ @@ -1,6 +1,7 @@ #import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { + WMFWKScriptMessageUnknown, WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, @@ -9,8 +10,7 @@ WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, - WMFWKScriptMessageArticleState, - WMFWKScriptMessageUnknown + WMFWKScriptMessageArticleState }; @interface WKScriptMessage (WMFScriptMessage)
Move unknown enum entry to top.
mit
anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios
188806ede0679466bb5890f3ec1b52736d7ccc49
#import "CoreDataAdditions/NSManagedObject+TDTAdditions.h" #import "CoreDataAdditions/NSManagedObjectContext+TDTAdditions.h" #import "CoreDataAdditions/TDTCoreDataUtilityMacros.h" #import "TargetConditionals.h" #if TARGET_OS_IPHONE #import "CoreDataAdditions/NSFetchedResultsController+TDTAdditions.h" #endif
#import "CoreDataAdditions/NSManagedObject+TDTAdditions.h" #import "CoreDataAdditions/NSManagedObjectContext+TDTAdditions.h" #import "CoreDataAdditions/TDTCoreDataUtilityMacros.h" #ifdef TARGET_IPHONE_OS #import "CoreDataAdditions/NSFetchedResultsController+TDTAdditions.h" #endif
--- +++ @@ -2,6 +2,7 @@ #import "CoreDataAdditions/NSManagedObjectContext+TDTAdditions.h" #import "CoreDataAdditions/TDTCoreDataUtilityMacros.h" -#ifdef TARGET_IPHONE_OS +#import "TargetConditionals.h" +#if TARGET_OS_IPHONE #import "CoreDataAdditions/NSFetchedResultsController+TDTAdditions.h" #endif
Fix conditional compilation mechanism for ios
bsd-3-clause
talk-to/Chocolate,talk-to/Chocolate
486c59553f64771f7bc1c984324b71442b45dfa2
/*------------------------------------------------------------------------- * * pqsignal.c * reliable BSD-style signal(2) routine stolen from RWW who stole it * from Stevens... * * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.16 2002/11/04 14:27:21 tgl Exp $ * * NOTES * This shouldn't be in libpq, but the monitor and some other * things need it... * *------------------------------------------------------------------------- */ #include "pqsignal.h" #include <signal.h> pqsigfunc pqsignal(int signo, pqsigfunc func) { #if !defined(HAVE_POSIX_SIGNALS) return signal(signo, func); #else struct sigaction act, oact; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (signo != SIGALRM) act.sa_flags |= SA_RESTART; if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; #endif /* !HAVE_POSIX_SIGNALS */ }
/*------------------------------------------------------------------------- * * pqsignal.c * reliable BSD-style signal(2) routine stolen from RWW who stole it * from Stevens... * * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.15 2002/06/20 20:29:54 momjian Exp $ * * NOTES * This shouldn't be in libpq, but the monitor and some other * things need it... * *------------------------------------------------------------------------- */ #include <stdlib.h> #include <signal.h> #include "pqsignal.h" pqsigfunc pqsignal(int signo, pqsigfunc func) { #if !defined(HAVE_POSIX_SIGNALS) return signal(signo, func); #else struct sigaction act, oact; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (signo != SIGALRM) act.sa_flags |= SA_RESTART; if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; #endif /* !HAVE_POSIX_SIGNALS */ }
--- +++ @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.15 2002/06/20 20:29:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.16 2002/11/04 14:27:21 tgl Exp $ * * NOTES * This shouldn't be in libpq, but the monitor and some other @@ -17,10 +17,9 @@ * *------------------------------------------------------------------------- */ -#include <stdlib.h> +#include "pqsignal.h" + #include <signal.h> - -#include "pqsignal.h" pqsigfunc pqsignal(int signo, pqsigfunc func)
Fix inclusion order, per Andreas.
apache-2.0
ahachete/gpdb,lintzc/gpdb,janebeckman/gpdb,zaksoup/gpdb,CraigHarris/gpdb,Quikling/gpdb,kaknikhil/gpdb,kmjungersen/PostgresXL,jmcatamney/gpdb,rubikloud/gpdb,rvs/gpdb,ovr/postgres-xl,greenplum-db/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,randomtask1155/gpdb,techdragon/Postgres-XL,rvs/gpdb,Quikling/gpdb,50wu/gpdb,ahachete/gpdb,snaga/postgres-xl,postmind-net/postgres-xl,xinzweb/gpdb,rubikloud/gpdb,xuegang/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,tangp3/gpdb,Postgres-XL/Postgres-XL,foyzur/gpdb,xinzweb/gpdb,yuanzhao/gpdb,yazun/postgres-xl,Quikling/gpdb,atris/gpdb,yazun/postgres-xl,lintzc/gpdb,xuegang/gpdb,janebeckman/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,Chibin/gpdb,cjcjameson/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,Chibin/gpdb,adam8157/gpdb,edespino/gpdb,greenplum-db/gpdb,lpetrov-pivotal/gpdb,chrishajas/gpdb,randomtask1155/gpdb,50wu/gpdb,cjcjameson/gpdb,rubikloud/gpdb,lintzc/gpdb,greenplum-db/gpdb,kmjungersen/PostgresXL,yuanzhao/gpdb,lisakowen/gpdb,foyzur/gpdb,Postgres-XL/Postgres-XL,atris/gpdb,ovr/postgres-xl,rvs/gpdb,greenplum-db/gpdb,snaga/postgres-xl,kaknikhil/gpdb,arcivanov/postgres-xl,0x0FFF/gpdb,royc1/gpdb,kmjungersen/PostgresXL,yazun/postgres-xl,postmind-net/postgres-xl,cjcjameson/gpdb,0x0FFF/gpdb,xuegang/gpdb,kaknikhil/gpdb,ahachete/gpdb,janebeckman/gpdb,ahachete/gpdb,royc1/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,kaknikhil/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,xuegang/gpdb,Chibin/gpdb,Chibin/gpdb,lintzc/gpdb,tpostgres-projects/tPostgres,tangp3/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,techdragon/Postgres-XL,tangp3/gpdb,chrishajas/gpdb,zaksoup/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,Chibin/gpdb,foyzur/gpdb,xuegang/gpdb,tangp3/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,pavanvd/postgres-xl,tpostgres-projects/tPostgres,ahachete/gpdb,xinzweb/gpdb,tangp3/gpdb,zaksoup/gpdb,CraigHarris/gpdb,jmcatamney/gpdb,foyzur/gpdb,ahachete/gpdb,kmjungersen/PostgresXL,zeroae/postgres-xl,arcivanov/postgres-xl,Quikling/gpdb,yuanzhao/gpdb,tangp3/gpdb,snaga/postgres-xl,atris/gpdb,ashwinstar/gpdb,CraigHarris/gpdb,rvs/gpdb,chrishajas/gpdb,janebeckman/gpdb,CraigHarris/gpdb,Quikling/gpdb,lisakowen/gpdb,adam8157/gpdb,atris/gpdb,0x0FFF/gpdb,ahachete/gpdb,lintzc/gpdb,50wu/gpdb,jmcatamney/gpdb,lpetrov-pivotal/gpdb,50wu/gpdb,zeroae/postgres-xl,yuanzhao/gpdb,chrishajas/gpdb,jmcatamney/gpdb,atris/gpdb,rubikloud/gpdb,royc1/gpdb,tangp3/gpdb,Quikling/gpdb,Chibin/gpdb,adam8157/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,xuegang/gpdb,ashwinstar/gpdb,xuegang/gpdb,xinzweb/gpdb,royc1/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,adam8157/gpdb,atris/gpdb,edespino/gpdb,randomtask1155/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,oberstet/postgres-xl,randomtask1155/gpdb,edespino/gpdb,chrishajas/gpdb,kaknikhil/gpdb,royc1/gpdb,yuanzhao/gpdb,rvs/gpdb,0x0FFF/gpdb,edespino/gpdb,janebeckman/gpdb,adam8157/gpdb,rvs/gpdb,CraigHarris/gpdb,janebeckman/gpdb,randomtask1155/gpdb,janebeckman/gpdb,50wu/gpdb,yuanzhao/gpdb,oberstet/postgres-xl,arcivanov/postgres-xl,Quikling/gpdb,lisakowen/gpdb,jmcatamney/gpdb,chrishajas/gpdb,xuegang/gpdb,foyzur/gpdb,Chibin/gpdb,snaga/postgres-xl,Chibin/gpdb,tpostgres-projects/tPostgres,CraigHarris/gpdb,0x0FFF/gpdb,adam8157/gpdb,chrishajas/gpdb,rubikloud/gpdb,Postgres-XL/Postgres-XL,cjcjameson/gpdb,kaknikhil/gpdb,Chibin/gpdb,lpetrov-pivotal/gpdb,ovr/postgres-xl,xinzweb/gpdb,lisakowen/gpdb,rvs/gpdb,royc1/gpdb,janebeckman/gpdb,xinzweb/gpdb,adam8157/gpdb,yuanzhao/gpdb,edespino/gpdb,arcivanov/postgres-xl,0x0FFF/gpdb,lisakowen/gpdb,royc1/gpdb,CraigHarris/gpdb,adam8157/gpdb,chrishajas/gpdb,pavanvd/postgres-xl,rubikloud/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,lintzc/gpdb,Chibin/gpdb,lintzc/gpdb,zeroae/postgres-xl,Postgres-XL/Postgres-XL,atris/gpdb,tangp3/gpdb,oberstet/postgres-xl,lpetrov-pivotal/gpdb,zaksoup/gpdb,atris/gpdb,zaksoup/gpdb,rvs/gpdb,zaksoup/gpdb,lisakowen/gpdb,xinzweb/gpdb,arcivanov/postgres-xl,lpetrov-pivotal/gpdb,oberstet/postgres-xl,xuegang/gpdb,foyzur/gpdb,50wu/gpdb,techdragon/Postgres-XL,0x0FFF/gpdb,ashwinstar/gpdb,foyzur/gpdb,rubikloud/gpdb,ashwinstar/gpdb,snaga/postgres-xl,lintzc/gpdb,lisakowen/gpdb,randomtask1155/gpdb,pavanvd/postgres-xl,pavanvd/postgres-xl,rvs/gpdb,Quikling/gpdb,edespino/gpdb,zaksoup/gpdb,edespino/gpdb,ahachete/gpdb,zeroae/postgres-xl,edespino/gpdb,Quikling/gpdb,foyzur/gpdb,ovr/postgres-xl,edespino/gpdb,50wu/gpdb,kaknikhil/gpdb,lisakowen/gpdb,ashwinstar/gpdb,janebeckman/gpdb,jmcatamney/gpdb,janebeckman/gpdb,50wu/gpdb,royc1/gpdb,rvs/gpdb,Quikling/gpdb,lpetrov-pivotal/gpdb,kmjungersen/PostgresXL,edespino/gpdb,Postgres-XL/Postgres-XL,lpetrov-pivotal/gpdb,tpostgres-projects/tPostgres,kaknikhil/gpdb,zeroae/postgres-xl,ashwinstar/gpdb,greenplum-db/gpdb,ovr/postgres-xl,zaksoup/gpdb,lintzc/gpdb,cjcjameson/gpdb,postmind-net/postgres-xl,lpetrov-pivotal/gpdb,kaknikhil/gpdb,postmind-net/postgres-xl,rubikloud/gpdb,yazun/postgres-xl,0x0FFF/gpdb,yazun/postgres-xl
04eb41980945926927e8dd22b420182ab7a47bc2
//@author A0094446X #pragma once #ifndef YOU_GUI_STDAFX_H_ #define YOU_GUI_STDAFX_H_ #include <memory> #include <QApplication> #include <QList> #include <QWidget> #include <QtWidgets> #include <boost/date_time/gregorian/greg_month.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #endif // YOU_GUI_STDAFX_H_
//@author A0094446X #pragma once #ifndef YOU_GUI_STDAFX_H_ #define YOU_GUI_STDAFX_H_ #include <QtWidgets> #endif // YOU_GUI_STDAFX_H_
--- +++ @@ -2,5 +2,14 @@ #pragma once #ifndef YOU_GUI_STDAFX_H_ #define YOU_GUI_STDAFX_H_ + +#include <memory> +#include <QApplication> +#include <QList> +#include <QWidget> #include <QtWidgets> + +#include <boost/date_time/gregorian/greg_month.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> + #endif // YOU_GUI_STDAFX_H_
Add more files to the PCH for faster compiles.
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
3a7937af55780e9b2d38ff234d8ddbda90578313
/* * This file is part of buxton. * * Copyright (C) 2013 Intel Corporation * * buxton 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. */ #pragma once #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define buxton_debug(...) buxton_log(__VA_ARGS__) #else #define buxton_debug(...) do {} while(0); #endif /* DEBUG */ void buxton_log(const char* fmt, ...); /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
/* * This file is part of buxton. * * Copyright (C) 2013 Intel Corporation * * buxton 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. */ #pragma once #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define buxton_debug() buxton_log() #else #define buxton_debug do {} while(0); #endif /* DEBUG */ void buxton_log(const char* fmt, ...); /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
--- +++ @@ -16,9 +16,9 @@ #endif #ifdef DEBUG -#define buxton_debug() buxton_log() +#define buxton_debug(...) buxton_log(__VA_ARGS__) #else -#define buxton_debug do {} while(0); +#define buxton_debug(...) do {} while(0); #endif /* DEBUG */ void buxton_log(const char* fmt, ...);
Fix the buxton_debug macro to support arguments
lgpl-2.1
sofar/buxton,sofar/buxton
b0183a9c878d330245437728c658360eb84e895d
#import <Foundation/Foundation.h> #import "NMBExceptionCapture.h" #import "DSL.h" FOUNDATION_EXPORT double NimbleVersionNumber; FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
#import <Foundation/Foundation.h> #import <Nimble/NMBExceptionCapture.h> #import <Nimble/DSL.h> FOUNDATION_EXPORT double NimbleVersionNumber; FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
--- +++ @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -#import <Nimble/NMBExceptionCapture.h> -#import <Nimble/DSL.h> +#import "NMBExceptionCapture.h" +#import "DSL.h" FOUNDATION_EXPORT double NimbleVersionNumber; FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
Convert module-based imports to relative
apache-2.0
dgdosen/Nimble,dgdosen/Nimble,Quick/Nimble,phatblat/Nimble,AnthonyMDev/Nimble,DanielAsher/Nimble,ashfurrow/Nimble,AnthonyMDev/Nimble,abbeycode/Nimble,phatblat/Nimble,feinstruktur/Nimble,ashfurrow/Nimble,phatblat/Nimble,ashfurrow/Nimble,jeffh/Nimble,twobitlabs/Nimble,abbeycode/Nimble,jeffh/Nimble,DanielAsher/Nimble,jeffh/Nimble,dgdosen/Nimble,Quick/Nimble,DanielAsher/Nimble,mishimay/Nimble,jeffh/Nimble,abbeycode/Nimble,feinstruktur/Nimble,abbeycode/Nimble,AnthonyMDev/Nimble,dgdosen/Nimble,mishimay/Nimble,mishimay/Nimble,Quick/Nimble,twobitlabs/Nimble,twobitlabs/Nimble,feinstruktur/Nimble
abd003aaf24b0f4e7d5d815e492282bca5ed70fb
/* * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) \ && !OPENSSL_API_1_1_0 void ENGINE_setup_bsd_cryptodev(void) { } #endif
/* * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { /* Some ENGINEs need this */ OPENSSL_cpuid_setup(); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) \ && !OPENSSL_API_1_1_0 void ENGINE_setup_bsd_cryptodev(void) { } #endif
--- +++ @@ -12,9 +12,6 @@ void ENGINE_load_builtin_engines(void) { - /* Some ENGINEs need this */ - OPENSSL_cpuid_setup(); - OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); }
Remove superfluous call to OPENSSL_cpuid_setup Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Kurt Roeckx <bb87b47479d83cec3c76132206933257ded727b2@roeckx.be> Reviewed-by: Matt Caswell <1fa2ef4755a9226cb9a0a4840bd89b158ac71391@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9417)
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
29ce3458d8474870805dd1439cf857d19519bfb1
#include <kernel/x86/apic.h> #include <kernel/port/mmio.h> void apic_timer_init(uint8_t int_no, uint8_t divisor, uint8_t mode) { /** set the divisor: **/ uint32_t reg = get32(DIVIDE_CONF); reg &= ~0xf; /* The representation of the divisor in the divide configuration * register is... weird. We're normalizing it a bit here; it's split up * within the register, and for some reason 7 is divide by 1, where as * the rest are a perfect 2^(n-1). See the intel manual for the * details. */ if (divisor == 0) divisor = 7; else divisor -= 1; /* Clear the low 4 bits; the rest is reserved and shouldn't be touched. */ reg &= ~0xf; reg |= (divisor & 0x3) | ((divisor & 0x4)<<1); put32(DIVIDE_CONF, reg); /** set the lvt entry: **/ LVTEnt lvt_ent; lvt_ent.raw = get32(LVT_TIMER); lvt_ent.v.timer_mode = mode; lvt_ent.v.vector = int_no; lvt_ent.v.masked = 0; put32(LVT_TIMER, lvt_ent.raw); } void apic_timer_set(uint32_t value) { put32(INITIAL_COUNT, value); }
#include <kernel/x86/apic.h> #include <kernel/port/mmio.h> void apic_timer_init(uint8_t int_no, uint8_t divisor, uint8_t mode) { /** set the divisor: **/ uint32_t reg = get32(DIVIDE_CONF); reg &= ~0xf; /* The representation of the divisor in the divide configuration * register is... weird. We're normalizing it a bit here; it's split up * within the register, and for some reason 7 is divide by 1, where as * the rest are a perfect 2^(n-1). See the intel manual for the * details. */ if (divisor == 0) divisor = 7; else divisor -= 1; reg |= (divisor & 0x3) | ((divisor & 0x4)<<1); put32(DIVIDE_CONF, reg); /** set the lvt entry: **/ LVTEnt lvt_ent; lvt_ent.raw = get32(LVT_TIMER); lvt_ent.v.timer_mode = mode; lvt_ent.v.vector = int_no; lvt_ent.v.masked = 0; put32(LVT_TIMER, lvt_ent.raw); } void apic_timer_set(uint32_t value) { put32(INITIAL_COUNT, value); }
--- +++ @@ -14,7 +14,11 @@ * details. */ if (divisor == 0) divisor = 7; else divisor -= 1; + + /* Clear the low 4 bits; the rest is reserved and shouldn't be touched. */ + reg &= ~0xf; reg |= (divisor & 0x3) | ((divisor & 0x4)<<1); + put32(DIVIDE_CONF, reg); /** set the lvt entry: **/
timer: Clear existing divisor before setting it. This is just a case of being slightly more diligent; there is not currently observed behavior change.
isc
zenhack/zero,zenhack/zero,zenhack/zero
b9ecedf51225867a3060d4de155186855c7de6b7
#pragma once namespace me { // basic optional implementation. template<class T> class Optional { T *m_object; public: Optional() : m_object(0) { } // copy constructor Optional(const Optional<T>& other) : m_object(new T(*other)) { } // move constructor Optional(Optional<T>&& other) : m_object(other.m_object) { other.m_object = 0; } Optional(const T& other) : m_object(new T(other)) { } // destructor ~Optional() { delete m_object; // delete 0 is a no-op, so we are fine here. } // copy assignment operator Optional& operator=(const Optional<T>& other) { delete m_object; // delete 0 is a no-op m_object = new T(*other); return *this; } Optional& operator=(const T& other) { delete m_object; // delete 0 is a no-op m_object = new T(other); return *this; } // move assignment operator Optional& operator=(Optional<T>&& other) { delete m_object; // delete 0 is a no-op m_object = other.m_object; other.m_object = 0; return *this; } operator bool() const { return m_object != 0; } T& operator *() const { return *m_object; } T* operator ->() const { return m_object; } T* pointer() const { return m_object; } }; // splitting. std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems); std::vector<std::string> split(const std::string &s, char delim); }
#pragma once namespace me { template<class T> class Optional { T *m_object; public: Optional() : m_object(0) {} Optional(const T& other) : m_object(new T(other)) {} Optional& operator=(const T& other) { if (m_object != 0) { delete m_object; } m_object = new T(other); return *this; } operator bool() const { return m_object != 0; } T& operator *() const { return *m_object; } T* operator ->() const { return m_object; } T* pointer() const { return m_object; } }; // splitting. std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems); std::vector<std::string> split(const std::string &s, char delim); }
--- +++ @@ -1,19 +1,47 @@ #pragma once namespace me { + // basic optional implementation. template<class T> class Optional { T *m_object; + public: - Optional() : m_object(0) {} + Optional() : m_object(0) { } - Optional(const T& other) : m_object(new T(other)) {} + // copy constructor + Optional(const Optional<T>& other) : m_object(new T(*other)) { } + + // move constructor + Optional(Optional<T>&& other) : m_object(other.m_object) { + other.m_object = 0; + } + + Optional(const T& other) : m_object(new T(other)) { } + + // destructor + ~Optional() { + delete m_object; // delete 0 is a no-op, so we are fine here. + } + + // copy assignment operator + Optional& operator=(const Optional<T>& other) { + delete m_object; // delete 0 is a no-op + m_object = new T(*other); + return *this; + } Optional& operator=(const T& other) { - if (m_object != 0) { - delete m_object; - } + delete m_object; // delete 0 is a no-op m_object = new T(other); + return *this; + } + + // move assignment operator + Optional& operator=(Optional<T>&& other) { + delete m_object; // delete 0 is a no-op + m_object = other.m_object; + other.m_object = 0; return *this; }
Use move semantics in Optional implementation.
mit
ckarmann/TrackCommit,ckarmann/TrackCommit
34d2be5fddf51413062f0995bfcb3b9401ffcef1
#include "nb_simp.c" struct arrayProb* gibbsC_shim(struct arrayProb* topic_prior_b, struct arrayProb* word_prior_c, struct arrayNat* z_d, struct arrayNat* w_e, struct arrayNat* doc_f, unsigned int docUpdate_g) { struct arrayProb* res = (struct arrayProb*)malloc(sizeof(struct arrayProb)); *res = gibbsC(*topic_prior_b, *word_prior_c, *z_d, *w_e, *doc_f, docUpdate_g); return res; }
#include "nb_simp.c" struct arrayProb* gibbsC_shim(struct arrayProb* topic_prior_b, struct arrayProb* word_prior_c, struct arrayNat* z_d, struct arrayNat* w_e, struct arrayNat* doc_f, unsigned int docUpdate_g) { struct arrayProb* res = (struct arrayProb*)malloc(sizeof(struct arrayProb*)); *res = gibbsC(*topic_prior_b, *word_prior_c, *z_d, *w_e, *doc_f, docUpdate_g); return res; }
--- +++ @@ -7,7 +7,7 @@ struct arrayNat* doc_f, unsigned int docUpdate_g) { - struct arrayProb* res = (struct arrayProb*)malloc(sizeof(struct arrayProb*)); + struct arrayProb* res = (struct arrayProb*)malloc(sizeof(struct arrayProb)); *res = gibbsC(*topic_prior_b, *word_prior_c, *z_d, *w_e, *doc_f, docUpdate_g); return res; }
Fix size error in malloc call
bsd-3-clause
zaxtax/naive_bayes,zaxtax/naive_bayes,zaxtax/naive_bayes,zaxtax/naive_bayes
acb699bec196566a5dba364b97b83ae28a9b1a80
// // FLEXNetworkObserver.h // Derived from: // // PDAFNetworkDomainController.h // PonyDebugger // // Created by Mike Lewis on 2/27/12. // // Licensed to Square, Inc. under one or more contributor license agreements. // See the LICENSE file distributed with this work for the terms under // which Square, Inc. licenses this file to you. // #import <Foundation/Foundation.h> FOUNDATION_EXTERN NSString *const kFLEXNetworkObserverEnabledStateChangedNotification; /// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system. /// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies. @interface FLEXNetworkObserver : NSObject /// Swizzling occurs when the observer is enabled for the first time. /// This reduces the impact of FLEX if network debugging is not desired. /// NOTE: this setting persists between launches of the app. + (void)setEnabled:(BOOL)enabled; + (BOOL)isEnabled; @end
// // FLEXNetworkObserver.h // Derived from: // // PDAFNetworkDomainController.h // PonyDebugger // // Created by Mike Lewis on 2/27/12. // // Licensed to Square, Inc. under one or more contributor license agreements. // See the LICENSE file distributed with this work for the terms under // which Square, Inc. licenses this file to you. // #import <Foundation/Foundation.h> extern NSString *const kFLEXNetworkObserverEnabledStateChangedNotification; /// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system. /// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies. @interface FLEXNetworkObserver : NSObject /// Swizzling occurs when the observer is enabled for the first time. /// This reduces the impact of FLEX if network debugging is not desired. /// NOTE: this setting persists between launches of the app. + (void)setEnabled:(BOOL)enabled; + (BOOL)isEnabled; @end
--- +++ @@ -14,7 +14,7 @@ #import <Foundation/Foundation.h> -extern NSString *const kFLEXNetworkObserverEnabledStateChangedNotification; +FOUNDATION_EXTERN NSString *const kFLEXNetworkObserverEnabledStateChangedNotification; /// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system. /// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies.
Use FOUNDATION_EXTERN for global variable Global variables that can be accessed from both C (or Objective-C) and C++ (or Objective-C++) source files should be marked `extern "C"` when in C++ mode (which is what `FOUNDATION_EXTERN` does), to ensure consistent access across languages.
bsd-3-clause
Flipboard/FLEX,NSExceptional/FLEX,Xiaobin0860/FLEX,Flipboard/FLEX,NSExceptional/FLEX
ed49a4fc89281608f41bebd3d09b8e0e1f2ea4c8
// // Mapping.h // Menu // // Created by Matt on 21/07/15. // Copyright (c) 2015 Blue Rocket. All rights reserved. // #import <BRMenu/UI/BRMenuBackBarButtonItemView.h> #import <BRMenu/UI/BRMenuBarButtonItemView.h> #import <BRMenu/UI/BRMenuPlusMinusButton.h> #import <BRMenu/UI/BRMenuStepper.h> #import <BRMenu/UI/BRMenuUIStyle.h>
// // Mapping.h // Menu // // Created by Matt on 21/07/15. // Copyright (c) 2015 Blue Rocket. All rights reserved. // #import <BRMenu/UI/BRMenuPlusMinusButton.h> #import <BRMenu/UI/BRMenuStepper.h> #import <BRMenu/UI/BRMenuUIStyle.h>
--- +++ @@ -6,6 +6,8 @@ // Copyright (c) 2015 Blue Rocket. All rights reserved. // +#import <BRMenu/UI/BRMenuBackBarButtonItemView.h> +#import <BRMenu/UI/BRMenuBarButtonItemView.h> #import <BRMenu/UI/BRMenuPlusMinusButton.h> #import <BRMenu/UI/BRMenuStepper.h> #import <BRMenu/UI/BRMenuUIStyle.h>
Include latest class additions in umbrella include.
apache-2.0
Blue-Rocket/BRMenu,Blue-Rocket/BRMenu,Blue-Rocket/BRMenu,Blue-Rocket/BRMenu,Blue-Rocket/BRMenu
41b1fefc4ecf7317d4e8ca4529edde1d5fad6ac0