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
/* * USART.h * * Created: 2016/9/10 16:30:30 * Author: dusch */ #ifndef USART_H_ #define USART_H_ #define BAUD 9600 #define F_CPU 8000000UL #include <avr/interrupt.h> void USART_Init(void); void USART_Transmit(unsigned char data); unsigned char USART_Receive(void); #endif /* USART_H_ */
/* * USART.h * * Created: 2016/9/10 16:30:30 * Author: dusch */ #ifndef USART_H_ #define USART_H_ #define BAUD 9600 #define F_CPU 12000000UL #include <avr/interrupt.h> void USART_Init(void); void USART_Transmit(unsigned char data); unsigned char USART_Receive(void); #endif /* USART_H_ */
--- +++ @@ -10,7 +10,7 @@ #define USART_H_ #define BAUD 9600 -#define F_CPU 12000000UL +#define F_CPU 8000000UL #include <avr/interrupt.h> void USART_Init(void);
Change default F_CPU from 12000000 to 8000000
bsd-3-clause
Schummacher/AVR_SCLib,Schummacher/AVR_SCLib
76df39bdfbc3eaa67abde2a413b0610a29502520
/* * Copyright 2013 Couchbase, 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 SRC_CONFIG_H #define SRC_CONFIG_H 1 #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <assert.h> #include <platform/platform.h> typedef uint8_t cbsasl_uint8_t; typedef uint16_t cbsasl_uint16_t; typedef uint32_t cbsasl_uint32_t; #endif /* SRC_CONFIG_H */
/* * Copyright 2013 Couchbase, 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 SRC_CONFIG_H #define SRC_CONFIG_H 1 #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <assert.h> #ifdef _WIN32 #include <windows.h> typedef unsigned __int8 cbsasl_uint8_t; typedef unsigned __int16 cbsasl_uint16_t; typedef unsigned __int32 cbsasl_uint32_t; #else #include <unistd.h> #include <stdint.h> typedef uint8_t cbsasl_uint8_t; typedef uint16_t cbsasl_uint16_t; typedef uint32_t cbsasl_uint32_t; #endif #endif /* SRC_CONFIG_H */
--- +++ @@ -23,18 +23,10 @@ #include <string.h> #include <ctype.h> #include <assert.h> +#include <platform/platform.h> -#ifdef _WIN32 -#include <windows.h> -typedef unsigned __int8 cbsasl_uint8_t; -typedef unsigned __int16 cbsasl_uint16_t; -typedef unsigned __int32 cbsasl_uint32_t; -#else -#include <unistd.h> -#include <stdint.h> typedef uint8_t cbsasl_uint8_t; typedef uint16_t cbsasl_uint16_t; typedef uint32_t cbsasl_uint32_t; -#endif #endif /* SRC_CONFIG_H */
Include platform.h instead of ifdef'ing Change-Id: I23b3202563623b46d94c10459837581be231f58e Reviewed-on: http://review.couchbase.org/30386 Reviewed-by: Michael Wiederhold <[email protected]> Tested-by: Trond Norbye <[email protected]>
apache-2.0
couchbase/cbsasl
de4c5acd59de654cd1b16cf74ae94f1bd128652a
#include "ring.h" /* OpenGL 2.1 Extension Copyright (c) 2017 Mahmoud Fayed <[email protected]> */ #include <GL/glew.h> #include <GL/glut.h> RING_FUNC(ring_glAccum) { if ( RING_API_PARACOUNT != 2 ) { RING_API_ERROR(RING_API_MISS2PARA); return ; } if ( ! RING_API_ISNUMBER(1) ) { RING_API_ERROR(RING_API_BADPARATYPE); return ; } if ( ! RING_API_ISNUMBER(2) ) { RING_API_ERROR(RING_API_BADPARATYPE); return ; } glAccum( (GLenum ) (int) RING_API_GETNUMBER(1), (GLfloat ) RING_API_GETNUMBER(2)); } RING_API void ringlib_init(RingState *pRingState) { ring_vm_funcregister("glaccum",ring_glAccum); }
#include "ring.h" /* OpenGL 2.1 Extension Copyright (c) 2017 Mahmoud Fayed <[email protected]> */ #include <GL/glew.h> #include <GL/glut.h> RING_API void ringlib_init(RingState *pRingState) { }
--- +++ @@ -10,6 +10,25 @@ #include <GL/glew.h> #include <GL/glut.h> + +RING_FUNC(ring_glAccum) +{ + if ( RING_API_PARACOUNT != 2 ) { + RING_API_ERROR(RING_API_MISS2PARA); + return ; + } + if ( ! RING_API_ISNUMBER(1) ) { + RING_API_ERROR(RING_API_BADPARATYPE); + return ; + } + if ( ! RING_API_ISNUMBER(2) ) { + RING_API_ERROR(RING_API_BADPARATYPE); + return ; + } + glAccum( (GLenum ) (int) RING_API_GETNUMBER(1), (GLfloat ) RING_API_GETNUMBER(2)); +} + RING_API void ringlib_init(RingState *pRingState) { + ring_vm_funcregister("glaccum",ring_glAccum); }
Update RingOpenGL - Add Function (Source Code) : void glAccum(GLenum op,GLfloat value)
mit
ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring
e263b70f1126b4fdb1ade836aacd547ad0e3e3b2
#include <unordered_set> #include "../src/include/gc_obj.h" class BinaryTreeNode : public gc_obj { public: BinaryTreeNode(const int id); int size() const; void curtailToLevel(const int lvl); void extendToLevel(const int size); void addLeftChild(BinaryTreeNode* leftChild); void addRightChild(BinaryTreeNode* rightChild); virtual void finalize(); virtual std::unordered_set<gc_obj*> getManagedChildren(); private: int id; BinaryTreeNode* leftChild; BinaryTreeNode* rightChild; };
#include <unordered_set> #include "../src/include/gc_obj.h" #include "../src/include/collector.h" class BinaryTreeNode : public gc_obj { public: BinaryTreeNode(const int id); ~BinaryTreeNode() = delete; int size() const; void curtailToLevel(const int lvl); void extendToLevel(const int size,Collector* collector); void addLeftChild(BinaryTreeNode* leftChild); void addRightChild(BinaryTreeNode* rightChild); virtual void finalize(); virtual std::unordered_set<gc_obj*> getManagedChildren(); private: int id; BinaryTreeNode* leftChild; BinaryTreeNode* rightChild; };
--- +++ @@ -1,15 +1,13 @@ #include <unordered_set> #include "../src/include/gc_obj.h" -#include "../src/include/collector.h" class BinaryTreeNode : public gc_obj { public: BinaryTreeNode(const int id); - ~BinaryTreeNode() = delete; int size() const; void curtailToLevel(const int lvl); - void extendToLevel(const int size,Collector* collector); + void extendToLevel(const int size); void addLeftChild(BinaryTreeNode* leftChild); void addRightChild(BinaryTreeNode* rightChild); virtual void finalize();
Remove manual addObject usage from the collector
mit
henfredemars/simple-collector
15c7a4f2089b5688f7ff3be22fd349d8e3530267
#import <Foundation/Foundation.h> @interface NSString (TDTAdditions) /** @return A string representing a newly generated version 4 random UUID */ + (instancetype)randomUUID; /** @return The SHA1 of the receiver */ - (NSString *)sha1Digest; /** @return A new string by trimming non alphanumeric characters from the receiver */ - (NSString *)stringByTrimmingNonAlphaNumericCharacters; /** @return `nil` if the receiver is blank, otherwise returns the receiver. */ - (NSString *)stringByNillingBlanks; /** There is no platform agnostic format specifier for an `NSUInteger`. Ergo this. */ + (NSString *)stringWithUnsignedInteger:(NSUInteger)uInteger; @end
#import <Foundation/Foundation.h> @interface NSString (TDTAdditions) /** @return a string representing a newly generated version 4 random UUID */ + (instancetype)randomUUID; /** @return The SHA1 of the receiver */ - (NSString *)sha1Digest; /** @return a new string by trimming non alphanumeric characters from the receiver */ - (NSString *)stringByTrimmingNonAlphaNumericCharacters; /** @return `nil` if the receiver is blank, otherwise returns the receiver. */ - (NSString *)stringByNillingBlanks; /** There is no platform agnostic format specifier for an `NSUInteger`. Ergo this. */ + (NSString *)stringWithUnsignedInteger:(NSUInteger)uInteger; @end
--- +++ @@ -3,7 +3,7 @@ @interface NSString (TDTAdditions) /** - @return a string representing a newly generated version 4 random UUID + @return A string representing a newly generated version 4 random UUID */ + (instancetype)randomUUID; @@ -13,7 +13,7 @@ - (NSString *)sha1Digest; /** - @return a new string by trimming non alphanumeric characters from the receiver + @return A new string by trimming non alphanumeric characters from the receiver */ - (NSString *)stringByTrimmingNonAlphaNumericCharacters;
Fix initial case for header documentation sentences
bsd-3-clause
talk-to/Chocolate,talk-to/Chocolate
acd3a4a5b459b405418b1651f59c38bca4fa0050
#include <stdio.h> #include "libsass/sass_interface.h" int main(int argc, char** argv) { int ret; if (argc < 2) { printf("Usage: sassc [INPUT FILE]\n"); return 0; } struct sass_file_context* ctx = sass_new_file_context(); ctx->options.include_paths = ""; ctx->options.image_path = "images"; ctx->options.output_style = SASS_STYLE_NESTED; ctx->input_path = argv[1]; sass_compile_file(ctx); if (ctx->error_status) { if (ctx->error_message) fprintf(stderr, "%s", ctx->error_message); else fprintf(stderr, "An error occured; no error message available.\n"); ret = 1; } else if (ctx->output_string) { printf("%s", ctx->output_string); ret = 0; } else { fprintf(stderr, "Unknown internal error.\n"); ret = 2; } sass_free_file_context(ctx); return ret; }
#include <stdio.h> #include "libsass/sass_interface.h" int main(int argc, char** argv) { int ret; if (argc < 2) { printf("Usage: sassc [INPUT FILE]\n"); return 0; } struct sass_file_context* ctx = sass_new_file_context(); ctx->options.include_paths = ""; ctx->options.image_path = "images"; ctx->options.output_style = SASS_STYLE_NESTED; ctx->input_path = argv[1]; sass_compile_file(ctx); if (ctx->error_status) { if (ctx->error_message) printf("%s", ctx->error_message); else printf("An error occured; no error message available.\n"); ret = 1; } else if (ctx->output_string) { printf("%s", ctx->output_string); ret = 0; } else { printf("Unknown internal error.\n"); ret = 2; } sass_free_file_context(ctx); return ret; }
--- +++ @@ -20,9 +20,9 @@ if (ctx->error_status) { if (ctx->error_message) - printf("%s", ctx->error_message); + fprintf(stderr, "%s", ctx->error_message); else - printf("An error occured; no error message available.\n"); + fprintf(stderr, "An error occured; no error message available.\n"); ret = 1; } else if (ctx->output_string) { @@ -30,7 +30,7 @@ ret = 0; } else { - printf("Unknown internal error.\n"); + fprintf(stderr, "Unknown internal error.\n"); ret = 2; }
Print error messages to stderr.
mit
saper/sassc,am11/sassc,am11/sassc,djam90/sassc,rightisleft/sassc,saper/sassc,am11/sassc,saper/sassc,rightisleft/sassc,djam90/sassc,rightisleft/sassc,djam90/sassc
8348847ba77a85167f591e7c97db6d205b0a3f62
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_COMPILER_XLA_SERVICE_SCATTER_EXPANDER_H_ #define TENSORFLOW_COMPILER_XLA_SERVICE_SCATTER_EXPANDER_H_ #include "tensorflow/compiler/xla/service/hlo_pass_interface.h" namespace xla { class ScatterExpander : public HloModulePass { public: absl::string_view name() const override { return "scatter_expander"; } StatusOr<bool> Run(HloModule* module) override; protected: StatusOr<HloInstruction*> ExpandScatter(HloInstruction* scatter); }; } // namespace xla #endif // TENSORFLOW_COMPILER_XLA_SERVICE_SCATTER_EXPANDER_H_
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_COMPILER_XLA_SERVICE_SCATTER_EXPANDER_H_ #define TENSORFLOW_COMPILER_XLA_SERVICE_SCATTER_EXPANDER_H_ #include "tensorflow/compiler/xla/service/hlo_pass_interface.h" namespace xla { class ScatterExpander : public HloModulePass { public: absl::string_view name() const override { return "scatter_expander"; } StatusOr<bool> Run(HloModule* module) override; private: StatusOr<HloInstruction*> ExpandScatter(HloInstruction* scatter); }; } // namespace xla #endif // TENSORFLOW_COMPILER_XLA_SERVICE_SCATTER_EXPANDER_H_
--- +++ @@ -25,7 +25,7 @@ absl::string_view name() const override { return "scatter_expander"; } StatusOr<bool> Run(HloModule* module) override; - private: + protected: StatusOr<HloInstruction*> ExpandScatter(HloInstruction* scatter); };
[XLA] Make ScatterExpander methods 'protected' to enable overriding them in a subclass. PiperOrigin-RevId: 217914138
apache-2.0
apark263/tensorflow,seanli9jan/tensorflow,jhseu/tensorflow,ghchinoy/tensorflow,theflofly/tensorflow,gunan/tensorflow,dongjoon-hyun/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,kevin-coder/tensorflow-fork,ghchinoy/tensorflow,kevin-coder/tensorflow-fork,hfp/tensorflow-xsmm,tensorflow/tensorflow-pywrap_saved_model,chemelnucfin/tensorflow,adit-chandra/tensorflow,gautam1858/tensorflow,brchiu/tensorflow,xzturn/tensorflow,DavidNorman/tensorflow,alshedivat/tensorflow,jbedorf/tensorflow,gunan/tensorflow,jhseu/tensorflow,gautam1858/tensorflow,brchiu/tensorflow,ppwwyyxx/tensorflow,asimshankar/tensorflow,aam-at/tensorflow,alsrgv/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,Intel-tensorflow/tensorflow,hehongliang/tensorflow,yongtang/tensorflow,alshedivat/tensorflow,annarev/tensorflow,apark263/tensorflow,aldian/tensorflow,jbedorf/tensorflow,dongjoon-hyun/tensorflow,tensorflow/tensorflow-pywrap_saved_model,brchiu/tensorflow,seanli9jan/tensorflow,cxxgtxy/tensorflow,theflofly/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jbedorf/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,jendap/tensorflow,DavidNorman/tensorflow,ghchinoy/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,hehongliang/tensorflow,asimshankar/tensorflow,theflofly/tensorflow,freedomtan/tensorflow,Bismarrck/tensorflow,arborh/tensorflow,Intel-Corporation/tensorflow,xzturn/tensorflow,alshedivat/tensorflow,sarvex/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,jendap/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,freedomtan/tensorflow,theflofly/tensorflow,annarev/tensorflow,jendap/tensorflow,hfp/tensorflow-xsmm,jendap/tensorflow,Intel-tensorflow/tensorflow,ageron/tensorflow,jbedorf/tensorflow,jendap/tensorflow,aam-at/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,ppwwyyxx/tensorflow,davidzchen/tensorflow,xzturn/tensorflow,kevin-coder/tensorflow-fork,gunan/tensorflow,theflofly/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,jendap/tensorflow,gunan/tensorflow,hehongliang/tensorflow,annarev/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,ageron/tensorflow,hehongliang/tensorflow,yongtang/tensorflow,freedomtan/tensorflow,arborh/tensorflow,alshedivat/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,sarvex/tensorflow,jbedorf/tensorflow,xzturn/tensorflow,petewarden/tensorflow,chemelnucfin/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,brchiu/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,aldian/tensorflow,alsrgv/tensorflow,adit-chandra/tensorflow,frreiss/tensorflow-fred,karllessard/tensorflow,brchiu/tensorflow,jbedorf/tensorflow,hehongliang/tensorflow,annarev/tensorflow,arborh/tensorflow,seanli9jan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,hfp/tensorflow-xsmm,tensorflow/tensorflow-pywrap_tf_optimizer,ageron/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,kevin-coder/tensorflow-fork,jbedorf/tensorflow,alshedivat/tensorflow,paolodedios/tensorflow,davidzchen/tensorflow,kevin-coder/tensorflow-fork,xzturn/tensorflow,paolodedios/tensorflow,hehongliang/tensorflow,xzturn/tensorflow,adit-chandra/tensorflow,alsrgv/tensorflow,Bismarrck/tensorflow,petewarden/tensorflow,sarvex/tensorflow,chemelnucfin/tensorflow,alshedivat/tensorflow,dongjoon-hyun/tensorflow,seanli9jan/tensorflow,karllessard/tensorflow,annarev/tensorflow,yongtang/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jbedorf/tensorflow,sarvex/tensorflow,hfp/tensorflow-xsmm,petewarden/tensorflow,tensorflow/tensorflow,freedomtan/tensorflow,arborh/tensorflow,seanli9jan/tensorflow,theflofly/tensorflow,brchiu/tensorflow,aldian/tensorflow,ghchinoy/tensorflow,aldian/tensorflow,ghchinoy/tensorflow,freedomtan/tensorflow,ghchinoy/tensorflow,ageron/tensorflow,asimshankar/tensorflow,davidzchen/tensorflow,jendap/tensorflow,gautam1858/tensorflow,arborh/tensorflow,renyi533/tensorflow,kevin-coder/tensorflow-fork,chemelnucfin/tensorflow,davidzchen/tensorflow,hfp/tensorflow-xsmm,gautam1858/tensorflow,petewarden/tensorflow,DavidNorman/tensorflow,asimshankar/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,arborh/tensorflow,renyi533/tensorflow,gautam1858/tensorflow,xzturn/tensorflow,asimshankar/tensorflow,seanli9jan/tensorflow,alshedivat/tensorflow,alsrgv/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Bismarrck/tensorflow,apark263/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,kevin-coder/tensorflow-fork,alsrgv/tensorflow,petewarden/tensorflow,gunan/tensorflow,asimshankar/tensorflow,Intel-Corporation/tensorflow,davidzchen/tensorflow,jhseu/tensorflow,petewarden/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,karllessard/tensorflow,hehongliang/tensorflow,seanli9jan/tensorflow,asimshankar/tensorflow,alsrgv/tensorflow,gunan/tensorflow,renyi533/tensorflow,Bismarrck/tensorflow,asimshankar/tensorflow,jendap/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,ageron/tensorflow,gautam1858/tensorflow,jbedorf/tensorflow,dongjoon-hyun/tensorflow,dongjoon-hyun/tensorflow,theflofly/tensorflow,freedomtan/tensorflow,Intel-Corporation/tensorflow,petewarden/tensorflow,aldian/tensorflow,jhseu/tensorflow,jendap/tensorflow,apark263/tensorflow,Bismarrck/tensorflow,ghchinoy/tensorflow,jhseu/tensorflow,hfp/tensorflow-xsmm,asimshankar/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow,jbedorf/tensorflow,alsrgv/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,Bismarrck/tensorflow,ppwwyyxx/tensorflow,sarvex/tensorflow,adit-chandra/tensorflow,aam-at/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,DavidNorman/tensorflow,paolodedios/tensorflow,apark263/tensorflow,frreiss/tensorflow-fred,theflofly/tensorflow,jhseu/tensorflow,chemelnucfin/tensorflow,apark263/tensorflow,xzturn/tensorflow,arborh/tensorflow,alshedivat/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,arborh/tensorflow,aam-at/tensorflow,dongjoon-hyun/tensorflow,chemelnucfin/tensorflow,gunan/tensorflow,brchiu/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,dongjoon-hyun/tensorflow,hfp/tensorflow-xsmm,adit-chandra/tensorflow,dongjoon-hyun/tensorflow,ppwwyyxx/tensorflow,dongjoon-hyun/tensorflow,DavidNorman/tensorflow,ageron/tensorflow,Bismarrck/tensorflow,chemelnucfin/tensorflow,yongtang/tensorflow,alshedivat/tensorflow,Intel-Corporation/tensorflow,ppwwyyxx/tensorflow,seanli9jan/tensorflow,paolodedios/tensorflow,adit-chandra/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,renyi533/tensorflow,alsrgv/tensorflow,aam-at/tensorflow,kevin-coder/tensorflow-fork,frreiss/tensorflow-fred,seanli9jan/tensorflow,Intel-tensorflow/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,yongtang/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ghchinoy/tensorflow,arborh/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow,ageron/tensorflow,theflofly/tensorflow,annarev/tensorflow,ghchinoy/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,apark263/tensorflow,paolodedios/tensorflow,ppwwyyxx/tensorflow,petewarden/tensorflow,jhseu/tensorflow,hfp/tensorflow-xsmm,brchiu/tensorflow,gunan/tensorflow,gautam1858/tensorflow,apark263/tensorflow,theflofly/tensorflow,davidzchen/tensorflow,xzturn/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow,annarev/tensorflow,arborh/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,asimshankar/tensorflow,apark263/tensorflow,aldian/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Bismarrck/tensorflow,Bismarrck/tensorflow,renyi533/tensorflow,theflofly/tensorflow,jhseu/tensorflow,freedomtan/tensorflow,aldian/tensorflow,kevin-coder/tensorflow-fork,annarev/tensorflow,apark263/tensorflow,Bismarrck/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,alsrgv/tensorflow,adit-chandra/tensorflow,davidzchen/tensorflow,alsrgv/tensorflow,jhseu/tensorflow,Intel-tensorflow/tensorflow,renyi533/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,tensorflow/tensorflow,ppwwyyxx/tensorflow,karllessard/tensorflow,cxxgtxy/tensorflow,sarvex/tensorflow,Intel-tensorflow/tensorflow,aam-at/tensorflow,seanli9jan/tensorflow,Bismarrck/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,petewarden/tensorflow,jendap/tensorflow,davidzchen/tensorflow,ppwwyyxx/tensorflow,arborh/tensorflow,paolodedios/tensorflow,renyi533/tensorflow,cxxgtxy/tensorflow,alshedivat/tensorflow,davidzchen/tensorflow,chemelnucfin/tensorflow,cxxgtxy/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jhseu/tensorflow,adit-chandra/tensorflow,ageron/tensorflow,alsrgv/tensorflow,chemelnucfin/tensorflow,ageron/tensorflow,adit-chandra/tensorflow,sarvex/tensorflow,ageron/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,ppwwyyxx/tensorflow,aam-at/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow,alsrgv/tensorflow,renyi533/tensorflow,hfp/tensorflow-xsmm,cxxgtxy/tensorflow,dongjoon-hyun/tensorflow,annarev/tensorflow,kevin-coder/tensorflow-fork,hfp/tensorflow-xsmm,DavidNorman/tensorflow,brchiu/tensorflow,Intel-tensorflow/tensorflow,seanli9jan/tensorflow,yongtang/tensorflow,chemelnucfin/tensorflow,xzturn/tensorflow,dongjoon-hyun/tensorflow,brchiu/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow,DavidNorman/tensorflow,asimshankar/tensorflow,renyi533/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,kevin-coder/tensorflow-fork,cxxgtxy/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jendap/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,apark263/tensorflow,freedomtan/tensorflow,karllessard/tensorflow,theflofly/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,frreiss/tensorflow-fred,jbedorf/tensorflow,hfp/tensorflow-xsmm,aam-at/tensorflow,DavidNorman/tensorflow,alshedivat/tensorflow,ghchinoy/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,ghchinoy/tensorflow,ageron/tensorflow,paolodedios/tensorflow,gunan/tensorflow,sarvex/tensorflow,ageron/tensorflow,davidzchen/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_saved_model,renyi533/tensorflow,DavidNorman/tensorflow,jhseu/tensorflow,brchiu/tensorflow,paolodedios/tensorflow,ghchinoy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,karllessard/tensorflow,arborh/tensorflow
34b1c5f6bc22dbb512f5d0462153042ffc6407fa
// itickable.h // // Interface definition of an object that is updated during the tick cycle. // #ifndef DEMO_ITICKABLE_H #define DEMO_ITICKABLE_H namespace demo { namespace obj { class ITickable { public: // CONSTRUCTORS /** * Destruct the tickable. */ ~ITickable(); // MEMBER FUNCTIONS /** * Prepare for the next tick cycle. */ virtual void preTick() = 0; /** * Update the object. * @param dt The elapsed time in seconds. */ virtual void tick( float dt ) = 0; /** * Clean up after the tick cycle. */ virtual void postTick() = 0; }; // CONSTRUCTORS inline ITickable::~ITickable() { } } // End nspc obj } // End nspc demo #endif // DEMO_ITICKABLE_H
// itickable.h // // Interface definition of an object that is updated during the tick cycle. // #ifndef DEMO_ITICKABLE_H #define DEMO_ITICKABLE_H namespace demo { namespace obj { class ITickable { public: // CONSTRUCTORS ~ITickable(); // MEMBER FUNCTIONS /** * Prepare for the next tick cycle. */ virtual void preTick() = 0; /** * Update the object. * @param dt The elapsed time. */ virtual void tick( float dt ) = 0; /** * Clean up after the tick cycle. */ virtual void postTick() = 0; }; // CONSTRUCTORS ITickable::~ITickable() { } } // End nspc obj } // End nspc demo #endif // DEMO_ITICKABLE_H
--- +++ @@ -15,6 +15,9 @@ { public: // CONSTRUCTORS + /** + * Destruct the tickable. + */ ~ITickable(); // MEMBER FUNCTIONS @@ -25,7 +28,7 @@ /** * Update the object. - * @param dt The elapsed time. + * @param dt The elapsed time in seconds. */ virtual void tick( float dt ) = 0; @@ -36,6 +39,7 @@ }; // CONSTRUCTORS +inline ITickable::~ITickable() { }
Clean up the tickable definition.
mit
invaderjon/demo,invaderjon/demo
57617193daeecc6ec6adf1057dbd687464558259
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 * NOTE TO FreeBSD users. Install libexecinfo from * ports/devel/libexecinfo and add -lexecinfo to LDFLAGS * to add backtrace support. */ #include "e.h" #include <execinfo.h> /* a tricky little devil, requires e and it's libs to be built * with the -rdynamic flag to GCC for any sort of decent output. */ void e_sigseg_act(int x, siginfo_t *info, void *data){ void *array[255]; size_t size; write(2, "**** SEGMENTATION FAULT ****\n", 29); write(2, "**** Printing Backtrace... *****\n\n", 34); size = backtrace(array, 255); backtrace_symbols_fd(array, size, 2); exit(-11); }
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #include "e.h" #include <execinfo.h> /* a tricky little devil, requires e and it's libs to be built * with the -rdynamic flag to GCC for any sort of decent output. */ void e_sigseg_act(int x, siginfo_t *info, void *data){ void *array[255]; size_t size; write(2, "**** SEGMENTATION FAULT ****\n", 29); write(2, "**** Printing Backtrace... *****\n\n", 34); size = backtrace(array, 255); backtrace_symbols_fd(array, size, 2); exit(-11); }
--- +++ @@ -1,5 +1,8 @@ /* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + * NOTE TO FreeBSD users. Install libexecinfo from + * ports/devel/libexecinfo and add -lexecinfo to LDFLAGS + * to add backtrace support. */ #include "e.h" #include <execinfo.h>
Add note to help FreeBSD users.
bsd-2-clause
jordemort/e17,jordemort/e17,jordemort/e17
4bd45e4d59931a8aa4873f40ddb77b5142fb175f
/* ArgParser - C++ Argument Parser reflecting the python module ArgParse. Copyright (C) 2014-2015 Matthew Scott Krafczyk This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ARGPARSE_ArgParse_HDR #define ARGPARSE_ArgParse_HDR #include "ArgParse/Message.h" #include "ArgParse/Argument.h" #include "ArgParse/ArgParser.h" #endif
/* ArgParser - C++ Argument Parser reflecting the python module ArgParse. Copyright (C) 2014-2015 Matthew Scott Krafczyk This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ARGPARSE_ArgParse_HDR #define ARGPARSE_ArgParse_HDR #include "ArgParse/Message.h" #include "ArgParse/Option.h" #include "ArgParse/ArgParser.h" #endif
--- +++ @@ -20,7 +20,7 @@ #define ARGPARSE_ArgParse_HDR #include "ArgParse/Message.h" -#include "ArgParse/Option.h" +#include "ArgParse/Argument.h" #include "ArgParse/ArgParser.h" #endif
Change an old Option.h to Argument.h
mit
krafczyk/ArgParse,krafczyk/ArgParse
e8fb39c9a7aaa172a528142fb5b24aa03e224083
//PARAM: --enable ana.int.interval --enable ana.int.enums --exp.privatization "write" -v #include<pthread.h> // Test case that shows how avoiding reading integral globals can reduce the number of solver evaluations. // Avoiding to evaluate integral globals when setting them reduced the number of necessary evaluations from 62 to 20 in this test case. pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int glob = 10; void* t_fun(void* ptr) { pthread_mutex_lock(&mutex); glob = 3; glob = 4; glob = 1; pthread_mutex_unlock(&mutex); return NULL; } void bar() { glob = 2; } int main() { pthread_t t; pthread_create(&t, NULL, t_fun, NULL); pthread_mutex_lock(&mutex); bar(); pthread_mutex_unlock(&mutex); pthread_join(t, NULL); assert(glob >= 1); assert(glob <= 10); return 0; }
//PARAM: --enable ana.int.interval --enable ana.int.enums --exp.privatization "write" -v #include<pthread.h> // Test case that shows how avoiding reading integral globals can reduce the number of solver evaluations. // Avoiding to evaluate integral globals when setting them reduced the number of necessary evaluations from 62 to 21 in this test case. pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int glob = 10; void* t_fun(void* ptr) { pthread_mutex_lock(&mutex); glob = 3; glob = 4; glob = 1; pthread_mutex_unlock(&mutex); return NULL; } void bar() { glob = 2; } int main() { pthread_t t; pthread_create(&t, NULL, t_fun, NULL); pthread_mutex_lock(&mutex); bar(); pthread_mutex_unlock(&mutex); pthread_join(t, NULL); assert(glob >= 1); assert(glob <= 2); //UNKNOWN assert(glob <= 10); return 0; }
--- +++ @@ -3,7 +3,7 @@ #include<pthread.h> // Test case that shows how avoiding reading integral globals can reduce the number of solver evaluations. -// Avoiding to evaluate integral globals when setting them reduced the number of necessary evaluations from 62 to 21 in this test case. +// Avoiding to evaluate integral globals when setting them reduced the number of necessary evaluations from 62 to 20 in this test case. pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int glob = 10; @@ -30,7 +30,6 @@ pthread_mutex_unlock(&mutex); pthread_join(t, NULL); assert(glob >= 1); - assert(glob <= 2); //UNKNOWN assert(glob <= 10); return 0; }
Remove confusing assert from test case
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
5e00c825d43914ce6ae0d859f72ffbef07794a6c
changeLibraryOrLibraryName: stuffCheckBox # #Exit the checkbox. Go to Field [ ] # #Set default layouts for a reference library. If [ tempSetup::InventoryLibaryYN = "" ] Set Field [ tempSetup::layoutLtagK; "" ] Set Field [ tempSetup::layoutRtagK; "" ] Set Field [ tempSetup::layoutLtagN; "" ] Set Field [ tempSetup::layoutRtagN; "" ] # #Designate library as a reference library. Set Field [ sectionAttributionInfo::order; "" ] Else # #Set default layouts for a stuff/inventory library. Set Field [ tempSetup::layoutLtagK; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagK; "moreReferenceMenu2SkeywordOrNode1" ] Set Field [ tempSetup::layoutLtagN; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagN; "moreReferenceMenu2SkeywordOrNode1" ] # #Designate library as a stuff/inventory library. Set Field [ sectionAttributionInfo::order; 1 ] End If December 27, ଘ౮27 19:05:50 Library.fp7 - stuffCheckBox -1-
testScreens: setup: stuffCheckBox Go to Field [ ] If [ tempSetup::InventoryLibaryYN = "" ] Set Field [ tempSetup::layoutLtagK; "" ] Set Field [ tempSetup::layoutRtagK; "" ] Set Field [ tempSetup::layoutLtagN; "" ] Set Field [ tempSetup::layoutRtagN; "" ] Else Set Field [ tempSetup::layoutLtagK; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagK; "moreReferenceMenu2SkeywordOrNode1" ] Set Field [ tempSetup::layoutLtagN; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagN; "moreReferenceMenu2SkeywordOrNode1" ] End If May 4, 平成27 21:28:07 Library.fp7 - stuffCheckBox -1-
--- +++ @@ -1,14 +1,26 @@ -testScreens: setup: stuffCheckBox +changeLibraryOrLibraryName: stuffCheckBox +# +#Exit the checkbox. Go to Field [ ] +# +#Set default layouts for a reference library. If [ tempSetup::InventoryLibaryYN = "" ] Set Field [ tempSetup::layoutLtagK; "" ] Set Field [ tempSetup::layoutRtagK; "" ] Set Field [ tempSetup::layoutLtagN; "" ] Set Field [ tempSetup::layoutRtagN; "" ] +# +#Designate library as a reference library. +Set Field [ sectionAttributionInfo::order; "" ] Else +# +#Set default layouts for a stuff/inventory library. Set Field [ tempSetup::layoutLtagK; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagK; "moreReferenceMenu2SkeywordOrNode1" ] Set Field [ tempSetup::layoutLtagN; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagN; "moreReferenceMenu2SkeywordOrNode1" ] +# +#Designate library as a stuff/inventory library. +Set Field [ sectionAttributionInfo::order; 1 ] End If -May 4, 平成27 21:28:07 Library.fp7 - stuffCheckBox -1- +December 27, ଘ౮27 19:05:50 Library.fp7 - stuffCheckBox -1-
Make library type checkbox part of the library record.
apache-2.0
HelpGiveThanks/Library,HelpGiveThanks/Library
2ff0d3cfdd0920c179616e8d0738c376f787d22a
// Taken from https://gist.github.com/arvidsson/7231973 #ifndef BITCOIN_REVERSE_ITERATOR_H #define BITCOIN_REVERSE_ITERATOR_H /** * Template used for reverse iteration in C++11 range-based for loops. * * std::vector<int> v = {1, 2, 3, 4, 5}; * for (auto x : reverse_iterate(v)) * std::cout << x << " "; */ template <typename T> class reverse_range { T &m_x; public: reverse_range(T &x) : m_x(x) {} auto begin() const -> decltype(this->m_x.rbegin()) { return m_x.rbegin(); } auto end() const -> decltype(this->m_x.rend()) { return m_x.rend(); } }; template <typename T> reverse_range<T> reverse_iterate(T &x) { return reverse_range<T>(x); } #endif // BITCOIN_REVERSE_ITERATOR_H
// Taken from https://gist.github.com/arvidsson/7231973 #ifndef BITCOIN_REVERSE_ITERATOR_HPP #define BITCOIN_REVERSE_ITERATOR_HPP /** * Template used for reverse iteration in C++11 range-based for loops. * * std::vector<int> v = {1, 2, 3, 4, 5}; * for (auto x : reverse_iterate(v)) * std::cout << x << " "; */ template <typename T> class reverse_range { T &x; public: reverse_range(T &x) : x(x) {} auto begin() const -> decltype(this->x.rbegin()) { return x.rbegin(); } auto end() const -> decltype(this->x.rend()) { return x.rend(); } }; template <typename T> reverse_range<T> reverse_iterate(T &x) { return reverse_range<T>(x); } #endif // BITCOIN_REVERSE_ITERATOR_HPP
--- +++ @@ -1,7 +1,7 @@ // Taken from https://gist.github.com/arvidsson/7231973 -#ifndef BITCOIN_REVERSE_ITERATOR_HPP -#define BITCOIN_REVERSE_ITERATOR_HPP +#ifndef BITCOIN_REVERSE_ITERATOR_H +#define BITCOIN_REVERSE_ITERATOR_H /** * Template used for reverse iteration in C++11 range-based for loops. @@ -14,19 +14,19 @@ template <typename T> class reverse_range { - T &x; + T &m_x; public: - reverse_range(T &x) : x(x) {} + reverse_range(T &x) : m_x(x) {} - auto begin() const -> decltype(this->x.rbegin()) + auto begin() const -> decltype(this->m_x.rbegin()) { - return x.rbegin(); + return m_x.rbegin(); } - auto end() const -> decltype(this->x.rend()) + auto end() const -> decltype(this->m_x.rend()) { - return x.rend(); + return m_x.rend(); } }; @@ -36,4 +36,4 @@ return reverse_range<T>(x); } -#endif // BITCOIN_REVERSE_ITERATOR_HPP +#endif // BITCOIN_REVERSE_ITERATOR_H
Rename member field according to the style guide.
mit
Justaphf/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited
33a5982e32963ed1e0e86608acc9ef116006e32a
// // TWTValidationLocalization.h // TWTValidation // // Created by Prachi Gauriar on 4/3/2014. // Copyright (c) 2014 Two Toasters, LLC. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #define TWTLocalizedString(key) \ [[NSBundle bundleForClass:[self class]] localizedStringForKey:(key) value:@"" table:@"TWTValidation"]
// // TWTValidationLocalization.h // TWTValidation // // Created by Prachi Gauriar on 4/3/2014. // Copyright (c) 2014 Two Toasters, LLC. All rights reserved. // #define TWTLocalizedString(key) \ [[NSBundle bundleForClass:[self class]] localizedStringForKey:(key) value:@"" table:@"TWTValidation"]
--- +++ @@ -3,7 +3,25 @@ // TWTValidation // // Created by Prachi Gauriar on 4/3/2014. -// Copyright (c) 2014 Two Toasters, LLC. All rights reserved. +// Copyright (c) 2014 Two Toasters, LLC. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. // #define TWTLocalizedString(key) \
Add license to localization header
mit
twotoasters/TWTValidation,twotoasters/TWTValidation,twotoasters/TWTValidation
f412fab9497a47ca77eece623fe53927302948c0
// RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s void f0(void *a, void *b) { __clear_cache(a,b); // CHECK: call {{.*}} @__clear_cache } // CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a) unsigned rbit(unsigned a) { return __builtin_arm_rbit(a); } // CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a) unsigned long long rbit64(unsigned long long a) { return __builtin_arm_rbit64(a); }
// RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s void f0(void *a, void *b) { __clear_cache(a,b); // CHECK: call {{.*}} @__clear_cache } // CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a) void rbit(unsigned a) { __builtin_arm_rbit(a); } // CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a) void rbit64(unsigned long long a) { __builtin_arm_rbit64(a); }
--- +++ @@ -6,11 +6,11 @@ } // CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a) -void rbit(unsigned a) { - __builtin_arm_rbit(a); +unsigned rbit(unsigned a) { + return __builtin_arm_rbit(a); } // CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a) -void rbit64(unsigned long long a) { - __builtin_arm_rbit64(a); +unsigned long long rbit64(unsigned long long a) { + return __builtin_arm_rbit64(a); }
AArch64: Fix silly think-o in tests. rdar://9283021 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@211064 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
53f7a342568c675b686f817f2a11392e486d2e8d
// // arch/x86_64/rsp/vmov.c // // This file is subject to the terms and conditions defined in // 'LICENSE', which is part of this source code package. // #include "common.h" #include "rsp/cpu.h" #include "rsp/rsp.h" __m128i rsp_vmov(struct rsp *rsp, unsigned src, unsigned e, unsigned dest, rsp_vect_t vt_shuffle) { uint16_t data; // Copy element into data memcpy(&data, (e & 0x7) + (uint16_t *)&vt_shuffle, sizeof(uint16_t)); // Write out the upper part of the result. rsp->cp2.regs[dest].e[e & 0x7] = data; return rsp_vect_load_unshuffled_operand(rsp->cp2.regs[dest].e); }
// // arch/x86_64/rsp/vmov.c // // This file is subject to the terms and conditions defined in // 'LICENSE', which is part of this source code package. // #include "common.h" #include "rsp/cpu.h" #include "rsp/rsp.h" __m128i rsp_vmov(struct rsp *rsp, unsigned src, unsigned e, unsigned dest, rsp_vect_t vt_shuffle) { uint16_t data; // Copy element into data memcpy(&data, (e & 0x7) + (uint16_t *)&vt_shuffle, sizeof(uint16_t)); printf("src %d dest %d el %x data %x\n", src, dest, e, data); fflush(stdout); // Write out the upper part of the result. rsp->cp2.regs[dest].e[e & 0x7] = data; return rsp_vect_load_unshuffled_operand(rsp->cp2.regs[dest].e); }
--- +++ @@ -16,9 +16,6 @@ // Copy element into data memcpy(&data, (e & 0x7) + (uint16_t *)&vt_shuffle, sizeof(uint16_t)); - printf("src %d dest %d el %x data %x\n", src, dest, e, data); - fflush(stdout); - // Write out the upper part of the result. rsp->cp2.regs[dest].e[e & 0x7] = data; return rsp_vect_load_unshuffled_operand(rsp->cp2.regs[dest].e);
Remove debug information from VMOV code
bsd-3-clause
tj90241/cen64,tj90241/cen64
3b879e32d7063b4b83867fac9a8c38f042a0fc2b
#ifndef LEPTONICA__STDIO_H #define LEPTONICA__STDIO_H #ifndef BUILD_HOST #include <stdio.h> #include <stdint.h> typedef struct cookie_io_functions_t { ssize_t (*read)(void *cookie, char *buf, size_t n); ssize_t (*write)(void *cookie, const char *buf, size_t n); int (*seek)(void *cookie, off_t *pos, int whence); int (*close)(void *cookie); } cookie_io_functions_t; FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t functions); FILE *fmemopen(void *buf, size_t size, const char *mode); FILE *open_memstream(char **buf, size_t *size); FILE *__sfp(void); int __sflags(const char *, int *); #endif #endif /* LEPTONICA__STDIO_H */
#ifndef LEPTONICA__STDIO_H #define LEPTONICA__STDIO_H #ifndef BUILD_HOST #include <stdio.h> #include <stdint.h> typedef struct cookie_io_functions_t { ssize_t (*read)(void *cookie, char *buf, size_t n); ssize_t (*write)(void *cookie, const char *buf, size_t n); int (*seek)(void *cookie, off_t *pos, int whence); int (*close)(void *cookie); } cookie_io_functions_t; FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t functions); FILE *fmemopen(void *buf, size_t size, const char *mode); FILE *open_memstream(char **buf, size_t *size); #endif #endif /* LEPTONICA__STDIO_H */
--- +++ @@ -19,6 +19,9 @@ FILE *open_memstream(char **buf, size_t *size); +FILE *__sfp(void); +int __sflags(const char *, int *); + #endif #endif /* LEPTONICA__STDIO_H */
Fix clang warning about implicit function declaration
apache-2.0
surensth/tess-two,surensth/tess-two,bhargavbhegde7/tess-two,didldum/tess-two,bhargavbhegde7/tess-two,renard314/tess-two,doo/tess-two,panzerfahrer/tess-two,rmtheis/tess-two,rxl194/tess-two,doo/tess-two,rxl194/tess-two,michyliao/tess-two,rmtheis/tess-two,Drakefrog/tess-two,bhargavbhegde7/tess-two,AlanFor301/tess-two,rmtheis/tess-two,didldum/tess-two,rmtheis/tess-two,zoyvever/tess-two,KrtinN/Scion,renard314/tess-two,didldum/tess-two,yummy222/tess-two,rxl194/tess-two,rxl194/tess-two,sirojnurulum/tess-two,didldum/tess-two,yummy222/tess-two,demonquark/tess-two,doo/tess-two,demonquark/tess-two,demonquark/tess-two,wordsforthewise/tess-two,CaveSven/TessTwo,rmtheis/tess-two,wordsforthewise/tess-two,CaveSven/TessTwo,didldum/tess-two,renard314/tess-two,garoxas/tess-two,CaveSven/TessTwo,surensth/tess-two,demonquark/tess-two,bhargavbhegde7/tess-two,michyliao/tess-two,lpalonek/tess-two,JackFan-Z/tess-two,lpalonek/tess-two,KrtinN/Scion,CaveSven/TessTwo,panzerfahrer/tess-two,demonquark/tess-two,doo/tess-two,yummy222/tess-two,bhargavbhegde7/tess-two,JackFan-Z/tess-two,michyliao/tess-two,sirojnurulum/tess-two,AlanFor301/tess-two,sirojnurulum/tess-two,lpalonek/tess-two,doo/tess-two,zoyvever/tess-two,yummy222/tess-two,JackFan-Z/tess-two,doo/tess-two,didldum/tess-two,Drakefrog/tess-two,Drakefrog/tess-two,wordsforthewise/tess-two,panzerfahrer/tess-two,lpalonek/tess-two,KrtinN/Scion,michyliao/tess-two,AlanFor301/tess-two,renard314/tess-two,garoxas/tess-two,CaveSven/TessTwo,AlanFor301/tess-two,JackFan-Z/tess-two,wordsforthewise/tess-two,lpalonek/tess-two,wordsforthewise/tess-two,Drakefrog/tess-two,rmtheis/tess-two,surensth/tess-two,yummy222/tess-two,Drakefrog/tess-two,michyliao/tess-two,yummy222/tess-two,surensth/tess-two,AlanFor301/tess-two,renard314/tess-two,KrtinN/Scion,panzerfahrer/tess-two,sirojnurulum/tess-two,Drakefrog/tess-two,rmtheis/tess-two,CaveSven/TessTwo,bhargavbhegde7/tess-two,sirojnurulum/tess-two,garoxas/tess-two,renard314/tess-two,AlanFor301/tess-two,doo/tess-two,JackFan-Z/tess-two,JackFan-Z/tess-two,garoxas/tess-two,KrtinN/Scion,KrtinN/Scion,michyliao/tess-two,rxl194/tess-two,panzerfahrer/tess-two,garoxas/tess-two,surensth/tess-two,panzerfahrer/tess-two,sirojnurulum/tess-two,rxl194/tess-two,demonquark/tess-two,lpalonek/tess-two,wordsforthewise/tess-two
dd84148bdaa2bbecf0be3385a6423e21edbdb690
#pragma once // This header mainly contains functions needed by both Cpu and Debugger #include "Base.h" #include <type_traits> // Convenience cast functions template <typename T> constexpr int16_t S16(T v) { return static_cast<int16_t>(static_cast<std::make_signed_t<T>>(v)); } template <typename T> constexpr uint16_t U16(T v) { return static_cast<uint16_t>(v); } template <typename T> constexpr uint32_t U32(T v) { return static_cast<uint32_t>(v); } template <typename T> constexpr uint8_t U8(T v) { return static_cast<uint8_t>(v); } // Combine two 8-bit values into a 16-bit value constexpr uint16_t CombineToU16(uint8_t msb, uint8_t lsb) { return U16(msb) << 8 | U16(lsb); } constexpr int16_t CombineToS16(uint8_t msb, uint8_t lsb) { return static_cast<int16_t>(CombineToU16(msb, lsb)); }
#pragma once // This header mainly contains functions needed by both Cpu and Debugger #include "Base.h" // Convenience cast functions template <typename T> constexpr int16_t S16(T v) { return static_cast<int16_t>(v); } template <typename T> constexpr uint16_t U16(T v) { return static_cast<uint16_t>(v); } template <typename T> constexpr uint32_t U32(T v) { return static_cast<uint32_t>(v); } template <typename T> constexpr uint8_t U8(T v) { return static_cast<uint8_t>(v); } // Combine two 8-bit values into a 16-bit value constexpr uint16_t CombineToU16(uint8_t msb, uint8_t lsb) { return U16(msb) << 8 | U16(lsb); } constexpr int16_t CombineToS16(uint8_t msb, uint8_t lsb) { return static_cast<int16_t>(CombineToU16(msb, lsb)); }
--- +++ @@ -3,11 +3,12 @@ // This header mainly contains functions needed by both Cpu and Debugger #include "Base.h" +#include <type_traits> // Convenience cast functions template <typename T> constexpr int16_t S16(T v) { - return static_cast<int16_t>(v); + return static_cast<int16_t>(static_cast<std::make_signed_t<T>>(v)); } template <typename T> constexpr uint16_t U16(T v) {
Cpu: Fix indexed mode instructions failing to add negative offset because value would not be correctly sign extended
mit
amaiorano/vectrexy,amaiorano/vectrexy,amaiorano/vectrexy
51889a9376cf256830db71764c72ef337e644094
/** * @file WidgetTimeInput.h * @author Volodymyr Shymanskyy * @license This project is released under the MIT License (MIT) * @copyright Copyright (c) 2015 Volodymyr Shymanskyy * @date Aug 2016 * @brief * */ #ifndef WidgetTimeInput_h #define WidgetTimeInput_h #include <Blynk/BlynkApi.h> #include <utility/BlynkDateTime.h> class TimeInputParam { public: TimeInputParam(const BlynkParam& param) { if (strlen(param[0].asStr())) { mStart = param[0].asLong(); } if (strlen(param[1].asStr())) { mStop = param[1].asLong(); } mTZ = param[2].asLong(); } BlynkTime& getStart() { return mStart; } BlynkTime& getStop() { return mStop; } long getTZ() const { return mTZ; } private: BlynkTime mStart; BlynkTime mStop; long mTZ; }; #endif
/** * @file WidgetTimeInput.h * @author Volodymyr Shymanskyy * @license This project is released under the MIT License (MIT) * @copyright Copyright (c) 2015 Volodymyr Shymanskyy * @date Aug 2016 * @brief * */ #ifndef WidgetTimeInput_h #define WidgetTimeInput_h #include <Blynk/BlynkApi.h> #include <utility/BlynkDateTime.h> class TimeInputParam { public: TimeInputParam(const BlynkParam& param) : mStart (param[0].asLong()) , mStop (param[1].asLong()) { mTZ = param[2].asLong(); } BlynkDateTime& getStart() { return mStart; } BlynkDateTime& getStop() { return mStop; } long getTZ() const { return mTZ; } private: BlynkDateTime mStart; BlynkDateTime mStop; long mTZ; }; #endif
--- +++ @@ -19,19 +19,23 @@ public: TimeInputParam(const BlynkParam& param) - : mStart (param[0].asLong()) - , mStop (param[1].asLong()) { + if (strlen(param[0].asStr())) { + mStart = param[0].asLong(); + } + if (strlen(param[1].asStr())) { + mStop = param[1].asLong(); + } mTZ = param[2].asLong(); } - BlynkDateTime& getStart() { return mStart; } - BlynkDateTime& getStop() { return mStop; } + BlynkTime& getStart() { return mStart; } + BlynkTime& getStop() { return mStop; } long getTZ() const { return mTZ; } private: - BlynkDateTime mStart; - BlynkDateTime mStop; + BlynkTime mStart; + BlynkTime mStop; long mTZ; };
Switch to Time instead of DateTime
mit
ivankravets/blynk-library,blynkkk/blynk-library,blynkkk/blynk-library,ivankravets/blynk-library,blynkkk/blynk-library,blynkkk/blynk-library,ivankravets/blynk-library,ivankravets/blynk-library,ivankravets/blynk-library,blynkkk/blynk-library
dd54e6b9aded46da7a74eede6f935b289a979912
#ifndef SEARCHRESULTCOLOR_H #define SEARCHRESULTCOLOR_H #include <QColor> namespace Find { namespace Internal { class SearchResultColor{ public: QColor textBackground; QColor textForeground; QColor highlightBackground; QColor highlightForeground; }; } // namespace Internal } // namespace Find #endif // SEARCHRESULTCOLOR_H
#ifndef SEARCHRESULTCOLOR_H #define SEARCHRESULTCOLOR_H #include <QColor> namespace Find { namespace Internal { struct SearchResultColor{ QColor textBackground; QColor textForeground; QColor highlightBackground; QColor highlightForeground; }; } // namespace Internal } // namespace Find #endif // SEARCHRESULTCOLOR_H
--- +++ @@ -6,7 +6,8 @@ namespace Find { namespace Internal { -struct SearchResultColor{ +class SearchResultColor{ +public: QColor textBackground; QColor textForeground; QColor highlightBackground;
Fix warning about struct/class mismatch Change-Id: I832ea6ebf078e533623fb748809dd71b5abfb645 Reviewed-by: Eike Ziller <[email protected]>
lgpl-2.1
danimo/qt-creator,darksylinc/qt-creator,kuba1/qtcreator,amyvmiwei/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,amyvmiwei/qt-creator,maui-packages/qt-creator,darksylinc/qt-creator,xianian/qt-creator,richardmg/qtcreator,colede/qtcreator,danimo/qt-creator,duythanhphan/qt-creator,kuba1/qtcreator,duythanhphan/qt-creator,danimo/qt-creator,AltarBeastiful/qt-creator,amyvmiwei/qt-creator,Distrotech/qtcreator,danimo/qt-creator,AltarBeastiful/qt-creator,martyone/sailfish-qtcreator,maui-packages/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,danimo/qt-creator,duythanhphan/qt-creator,maui-packages/qt-creator,malikcjm/qtcreator,xianian/qt-creator,omniacreator/qtcreator,darksylinc/qt-creator,martyone/sailfish-qtcreator,darksylinc/qt-creator,xianian/qt-creator,Distrotech/qtcreator,martyone/sailfish-qtcreator,xianian/qt-creator,AltarBeastiful/qt-creator,amyvmiwei/qt-creator,kuba1/qtcreator,Distrotech/qtcreator,farseerri/git_code,xianian/qt-creator,darksylinc/qt-creator,AltarBeastiful/qt-creator,amyvmiwei/qt-creator,colede/qtcreator,AltarBeastiful/qt-creator,richardmg/qtcreator,colede/qtcreator,richardmg/qtcreator,farseerri/git_code,duythanhphan/qt-creator,darksylinc/qt-creator,richardmg/qtcreator,malikcjm/qtcreator,xianian/qt-creator,AltarBeastiful/qt-creator,martyone/sailfish-qtcreator,malikcjm/qtcreator,maui-packages/qt-creator,danimo/qt-creator,AltarBeastiful/qt-creator,colede/qtcreator,maui-packages/qt-creator,omniacreator/qtcreator,farseerri/git_code,malikcjm/qtcreator,colede/qtcreator,Distrotech/qtcreator,Distrotech/qtcreator,malikcjm/qtcreator,Distrotech/qtcreator,darksylinc/qt-creator,martyone/sailfish-qtcreator,kuba1/qtcreator,amyvmiwei/qt-creator,duythanhphan/qt-creator,farseerri/git_code,kuba1/qtcreator,kuba1/qtcreator,farseerri/git_code,kuba1/qtcreator,farseerri/git_code,omniacreator/qtcreator,amyvmiwei/qt-creator,farseerri/git_code,maui-packages/qt-creator,richardmg/qtcreator,omniacreator/qtcreator,omniacreator/qtcreator,richardmg/qtcreator,omniacreator/qtcreator,AltarBeastiful/qt-creator,danimo/qt-creator,kuba1/qtcreator,Distrotech/qtcreator,malikcjm/qtcreator,richardmg/qtcreator,amyvmiwei/qt-creator,xianian/qt-creator,duythanhphan/qt-creator,farseerri/git_code,kuba1/qtcreator,danimo/qt-creator,duythanhphan/qt-creator,danimo/qt-creator,martyone/sailfish-qtcreator,colede/qtcreator,darksylinc/qt-creator,maui-packages/qt-creator,martyone/sailfish-qtcreator,colede/qtcreator,omniacreator/qtcreator,malikcjm/qtcreator
9dfc4f8efb20c07e111c556843f914376187ba13
/*------------------------------------------------------------------------- * * fork_process.h * Exports from postmaster/fork_process.c. * * Copyright (c) 1996-2005, PostgreSQL Global Development Group * * $PostgreSQL: pgsql/src/include/postmaster/fork_process.h,v 1.2 2005/03/13 23:32:26 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef FORK_PROCESS_H #define FORK_PROCESS_H extern pid_t fork_process(void); #endif /* FORK_PROCESS_H */
#ifndef FORK_PROCESS_H #define FORK_PROCESS_H #include "postgres.h" extern pid_t fork_process(void); #endif /* ! FORK_PROCESS_H */
--- +++ @@ -1,8 +1,17 @@ +/*------------------------------------------------------------------------- + * + * fork_process.h + * Exports from postmaster/fork_process.c. + * + * Copyright (c) 1996-2005, PostgreSQL Global Development Group + * + * $PostgreSQL: pgsql/src/include/postmaster/fork_process.h,v 1.2 2005/03/13 23:32:26 tgl Exp $ + * + *------------------------------------------------------------------------- + */ #ifndef FORK_PROCESS_H #define FORK_PROCESS_H -#include "postgres.h" - extern pid_t fork_process(void); -#endif /* ! FORK_PROCESS_H */ +#endif /* FORK_PROCESS_H */
Add missing identification comment, remove entirely inappropriate include of postgres.h.
apache-2.0
50wu/gpdb,lisakowen/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,adam8157/gpdb,rubikloud/gpdb,zeroae/postgres-xl,cjcjameson/gpdb,xinzweb/gpdb,edespino/gpdb,oberstet/postgres-xl,ahachete/gpdb,lpetrov-pivotal/gpdb,adam8157/gpdb,rubikloud/gpdb,jmcatamney/gpdb,ahachete/gpdb,oberstet/postgres-xl,ovr/postgres-xl,xuegang/gpdb,yuanzhao/gpdb,royc1/gpdb,CraigHarris/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,snaga/postgres-xl,cjcjameson/gpdb,Quikling/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,rubikloud/gpdb,randomtask1155/gpdb,oberstet/postgres-xl,chrishajas/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,royc1/gpdb,50wu/gpdb,lintzc/gpdb,50wu/gpdb,greenplum-db/gpdb,yazun/postgres-xl,CraigHarris/gpdb,CraigHarris/gpdb,snaga/postgres-xl,kaknikhil/gpdb,lpetrov-pivotal/gpdb,rvs/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,royc1/gpdb,yuanzhao/gpdb,edespino/gpdb,Quikling/gpdb,foyzur/gpdb,atris/gpdb,techdragon/Postgres-XL,adam8157/gpdb,lintzc/gpdb,zaksoup/gpdb,tangp3/gpdb,tangp3/gpdb,ovr/postgres-xl,jmcatamney/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,Chibin/gpdb,rvs/gpdb,CraigHarris/gpdb,Chibin/gpdb,tangp3/gpdb,xinzweb/gpdb,tangp3/gpdb,lintzc/gpdb,Quikling/gpdb,kaknikhil/gpdb,zaksoup/gpdb,yuanzhao/gpdb,snaga/postgres-xl,yazun/postgres-xl,yuanzhao/gpdb,arcivanov/postgres-xl,zeroae/postgres-xl,Chibin/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,postmind-net/postgres-xl,xinzweb/gpdb,adam8157/gpdb,lisakowen/gpdb,randomtask1155/gpdb,rubikloud/gpdb,tangp3/gpdb,cjcjameson/gpdb,Postgres-XL/Postgres-XL,lpetrov-pivotal/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,ahachete/gpdb,tangp3/gpdb,lpetrov-pivotal/gpdb,ahachete/gpdb,foyzur/gpdb,edespino/gpdb,ahachete/gpdb,ahachete/gpdb,ovr/postgres-xl,janebeckman/gpdb,pavanvd/postgres-xl,janebeckman/gpdb,50wu/gpdb,randomtask1155/gpdb,rvs/gpdb,tangp3/gpdb,tpostgres-projects/tPostgres,tpostgres-projects/tPostgres,rvs/gpdb,jmcatamney/gpdb,lintzc/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,edespino/gpdb,greenplum-db/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,lintzc/gpdb,pavanvd/postgres-xl,atris/gpdb,0x0FFF/gpdb,Chibin/gpdb,Quikling/gpdb,oberstet/postgres-xl,janebeckman/gpdb,edespino/gpdb,xinzweb/gpdb,0x0FFF/gpdb,atris/gpdb,chrishajas/gpdb,oberstet/postgres-xl,lisakowen/gpdb,CraigHarris/gpdb,snaga/postgres-xl,lisakowen/gpdb,royc1/gpdb,Postgres-XL/Postgres-XL,zaksoup/gpdb,yazun/postgres-xl,yuanzhao/gpdb,cjcjameson/gpdb,chrishajas/gpdb,xuegang/gpdb,ashwinstar/gpdb,lisakowen/gpdb,chrishajas/gpdb,ashwinstar/gpdb,foyzur/gpdb,Chibin/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,xinzweb/gpdb,lintzc/gpdb,arcivanov/postgres-xl,Quikling/gpdb,Chibin/gpdb,chrishajas/gpdb,Postgres-XL/Postgres-XL,janebeckman/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,atris/gpdb,adam8157/gpdb,jmcatamney/gpdb,yazun/postgres-xl,cjcjameson/gpdb,edespino/gpdb,foyzur/gpdb,foyzur/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,jmcatamney/gpdb,CraigHarris/gpdb,lintzc/gpdb,randomtask1155/gpdb,xinzweb/gpdb,rvs/gpdb,tpostgres-projects/tPostgres,rubikloud/gpdb,rvs/gpdb,lpetrov-pivotal/gpdb,techdragon/Postgres-XL,CraigHarris/gpdb,50wu/gpdb,xuegang/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,janebeckman/gpdb,rubikloud/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,jmcatamney/gpdb,postmind-net/postgres-xl,royc1/gpdb,50wu/gpdb,pavanvd/postgres-xl,yuanzhao/gpdb,chrishajas/gpdb,CraigHarris/gpdb,janebeckman/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,randomtask1155/gpdb,xuegang/gpdb,janebeckman/gpdb,xuegang/gpdb,edespino/gpdb,adam8157/gpdb,50wu/gpdb,xuegang/gpdb,ashwinstar/gpdb,foyzur/gpdb,kaknikhil/gpdb,rvs/gpdb,yuanzhao/gpdb,Quikling/gpdb,cjcjameson/gpdb,tpostgres-projects/tPostgres,lintzc/gpdb,0x0FFF/gpdb,zeroae/postgres-xl,xuegang/gpdb,tpostgres-projects/tPostgres,xuegang/gpdb,ovr/postgres-xl,lpetrov-pivotal/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,adam8157/gpdb,rvs/gpdb,Quikling/gpdb,lisakowen/gpdb,kaknikhil/gpdb,zaksoup/gpdb,edespino/gpdb,edespino/gpdb,CraigHarris/gpdb,edespino/gpdb,royc1/gpdb,kaknikhil/gpdb,Quikling/gpdb,janebeckman/gpdb,Chibin/gpdb,yazun/postgres-xl,randomtask1155/gpdb,zaksoup/gpdb,foyzur/gpdb,Chibin/gpdb,ashwinstar/gpdb,xinzweb/gpdb,atris/gpdb,0x0FFF/gpdb,chrishajas/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,techdragon/Postgres-XL,0x0FFF/gpdb,greenplum-db/gpdb,arcivanov/postgres-xl,lisakowen/gpdb,Quikling/gpdb,Quikling/gpdb,xuegang/gpdb,zaksoup/gpdb,atris/gpdb,chrishajas/gpdb,zaksoup/gpdb,kaknikhil/gpdb,Chibin/gpdb,adam8157/gpdb,ovr/postgres-xl,snaga/postgres-xl,tangp3/gpdb,rvs/gpdb,royc1/gpdb,greenplum-db/gpdb,ahachete/gpdb,kaknikhil/gpdb,Chibin/gpdb,xinzweb/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,atris/gpdb,rubikloud/gpdb,rubikloud/gpdb,randomtask1155/gpdb,Postgres-XL/Postgres-XL,janebeckman/gpdb,royc1/gpdb,lintzc/gpdb,foyzur/gpdb,50wu/gpdb,ahachete/gpdb,greenplum-db/gpdb,techdragon/Postgres-XL,rvs/gpdb
bb4c88c29ab312e2be118ac857daa7c93399d6e1
/* KallistiOS ##version## newlib_isatty.c Copyright (C) 2004 Dan Potter Copyright (C) 2012 Lawrence Sebald */ #include <sys/reent.h> int isatty(int fd) { /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise they won't be set as line-buffered. */ if(fd >= 0 && fd <= 2) { return 1; } return 0; } int _isatty_r(struct _reent *reent, int fd) { /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise they won't be set as line-buffered.*/ if(fd >= 0 && fd <= 2) { return 1; } return 0; }
/* KallistiOS ##version## newlib_isatty.c Copyright (C)2004 Dan Potter */ #include <sys/reent.h> int isatty(int fd) { return 0; } int _isatty_r(struct _reent *reent, int fd) { return 0; }
--- +++ @@ -1,16 +1,29 @@ /* KallistiOS ##version## newlib_isatty.c - Copyright (C)2004 Dan Potter + Copyright (C) 2004 Dan Potter + Copyright (C) 2012 Lawrence Sebald */ #include <sys/reent.h> int isatty(int fd) { + /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise + they won't be set as line-buffered. */ + if(fd >= 0 && fd <= 2) { + return 1; + } + return 0; } int _isatty_r(struct _reent *reent, int fd) { + /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise + they won't be set as line-buffered.*/ + if(fd >= 0 && fd <= 2) { + return 1; + } + return 0; }
Make it so that stdin/stdout/stderr will be set as line buffered (newlib has to think they're ttys if we have fcntl, which we do now).
bsd-3-clause
DreamcastSDK/kos,DreamcastSDK/kos,DreamcastSDK/kos
a8904687f65f794ab5d01c58c6f9beeda5742325
//===- lld/ReaderWriter/YamlContext.h - object used in YAML I/O context ---===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_YAML_CONTEXT_H #define LLD_READER_WRITER_YAML_CONTEXT_H #include "lld/Core/LLVM.h" #include <functional> #include <memory> #include <vector> namespace lld { class File; class LinkingContext; namespace mach_o { namespace normalized { struct NormalizedFile; } } using lld::mach_o::normalized::NormalizedFile; /// When YAML I/O is used in lld, the yaml context always holds a YamlContext /// object. We need to support hetergenous yaml documents which each require /// different context info. This struct supports all clients. struct YamlContext { const LinkingContext *_ctx = nullptr; const Registry *_registry = nullptr; File *_file = nullptr; NormalizedFile *_normalizeMachOFile = nullptr; StringRef _path; }; } // end namespace lld #endif // LLD_READER_WRITER_YAML_CONTEXT_H
//===- lld/ReaderWriter/YamlContext.h - object used in YAML I/O context ---===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_YAML_CONTEXT_H #define LLD_READER_WRITER_YAML_CONTEXT_H #include "lld/Core/LLVM.h" #include <functional> #include <memory> #include <vector> namespace lld { class File; class LinkingContext; namespace mach_o { namespace normalized { struct NormalizedFile; } } using lld::mach_o::normalized::NormalizedFile; /// When YAML I/O is used in lld, the yaml context always holds a YamlContext /// object. We need to support hetergenous yaml documents which each require /// different context info. This struct supports all clients. struct YamlContext { YamlContext() : _ctx(nullptr), _registry(nullptr), _file(nullptr), _normalizeMachOFile(nullptr) {} const LinkingContext *_ctx; const Registry *_registry; File *_file; NormalizedFile *_normalizeMachOFile; StringRef _path; }; } // end namespace lld #endif // LLD_READER_WRITER_YAML_CONTEXT_H
--- +++ @@ -30,14 +30,10 @@ /// object. We need to support hetergenous yaml documents which each require /// different context info. This struct supports all clients. struct YamlContext { - YamlContext() - : _ctx(nullptr), _registry(nullptr), _file(nullptr), - _normalizeMachOFile(nullptr) {} - - const LinkingContext *_ctx; - const Registry *_registry; - File *_file; - NormalizedFile *_normalizeMachOFile; + const LinkingContext *_ctx = nullptr; + const Registry *_registry = nullptr; + File *_file = nullptr; + NormalizedFile *_normalizeMachOFile = nullptr; StringRef _path; };
Use C++11 non-static member initialization. git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@234648 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/lld,llvm-mirror/lld
bb71227a64ed0b093e31e0bddab4fa4d4462a0b6
/** * Win32 UTF-8 wrapper * * ---- * * main() entry point. * Compile or #include this file as part of your sources * if your program runs in the console subsystem. */ #include "src/entry.h" #undef main int __cdecl wmain(void) { return win32_utf8_entry(win32_utf8_main); } // If both main() and wmain() are defined... // Visual Studio (or more specifically, LINK.EXE) defaults to main() // Pelles C defaults to wmain(), without even printing a "ambiguous entry // point" warning // MinGW/GCC doesn't care, and expects wmain() if you specify -municode, // and main() by default. // Thus, we keep main() as a convenience fallback for GCC. #ifndef _MSC_VER int __cdecl main(void) { return win32_utf8_entry(win32_utf8_main); } #endif
/** * Win32 UTF-8 wrapper * * ---- * * main() entry point. * Compile or #include this file as part of your sources * if your program runs in the console subsystem. */ #include "src/entry.h" #undef main int __cdecl main(void) { return win32_utf8_entry(win32_utf8_main); }
--- +++ @@ -11,7 +11,24 @@ #include "src/entry.h" #undef main +int __cdecl wmain(void) +{ + return win32_utf8_entry(win32_utf8_main); +} + +// If both main() and wmain() are defined... +// Visual Studio (or more specifically, LINK.EXE) defaults to main() +// Pelles C defaults to wmain(), without even printing a "ambiguous entry +// point" warning +// MinGW/GCC doesn't care, and expects wmain() if you specify -municode, +// and main() by default. +// Thus, we keep main() as a convenience fallback for GCC. + +#ifndef _MSC_VER + int __cdecl main(void) { return win32_utf8_entry(win32_utf8_main); } + +#endif
Define wmain() in addition to main(). Saving those precious nanoseconds that the C runtime would otherwise waste with needlessly converting the command line from UTF-16 to the ANSI codepage. Y'know, I figured it might raise questions if I omit this, and maybe you don't want to have that feel of tainting your build with an unnecessary ANSI function… But yeah, entry point precedence *was* a question I had when writing these wrappers, so at least it serves as documentation now. But yeah, main() ultimately *is* the superior choice, due to both being cross-platform and requiring less build configuration. Now, if GCC had a #pragma to control its entry point selection behavior, it would be awesome and I'd be gushing with praise at this marvelous piece of compiler technology. This is still pretty nice though.
unlicense
thpatch/win32_utf8
f9a4ae765c2d0f2b20b8520119610ae3b97f342f
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base58 entry widget validator. Corrects near-miss characters and refuses characters that are not part of base58. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressValidator(QObject *parent = 0); State validate(QString &input, int &pos) const; static const int MaxAddressLength = 35; }; #endif // BITCOINADDRESSVALIDATOR_H
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base48 entry widget validator. Corrects near-miss characters and refuses characters that are no part of base48. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressValidator(QObject *parent = 0); State validate(QString &input, int &pos) const; static const int MaxAddressLength = 35; }; #endif // BITCOINADDRESSVALIDATOR_H
--- +++ @@ -3,8 +3,8 @@ #include <QValidator> -/** Base48 entry widget validator. - Corrects near-miss characters and refuses characters that are no part of base48. +/** Base58 entry widget validator. + Corrects near-miss characters and refuses characters that are not part of base58. */ class BitcoinAddressValidator : public QValidator {
Fix typo in a comment: it's base58, not base48.
mit
cinnamoncoin/Feathercoin,nanocoins/mycoin,nanocoins/mycoin,cinnamoncoin/Feathercoin,saydulk/Feathercoin,cinnamoncoin/Feathercoin,nanocoins/mycoin,ghostlander/Feathercoin,enlighter/Feathercoin,saydulk/Feathercoin,cqtenq/Feathercoin,enlighter/Feathercoin,cqtenq/Feathercoin,cinnamoncoin/Feathercoin,nanocoins/mycoin,ghostlander/Feathercoin,enlighter/Feathercoin,ghostlander/Feathercoin,nanocoins/mycoin,enlighter/Feathercoin,cinnamoncoin/Feathercoin,ghostlander/Feathercoin,ghostlander/Feathercoin,enlighter/Feathercoin,cqtenq/Feathercoin,saydulk/Feathercoin,saydulk/Feathercoin,cqtenq/Feathercoin,cqtenq/Feathercoin,saydulk/Feathercoin
a4d60fe0ef77abcc9d91cdca0c6f276e5a7fb627
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_ #define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_ #include <map> #include <memory> #include "atom/browser/api/atom_api_menu.h" #include "base/memory/weak_ptr.h" #include "ui/display/screen.h" #include "ui/views/controls/menu/menu_runner.h" namespace atom { namespace api { class MenuViews : public Menu { public: MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper); protected: void PopupAt( Window* window, int x, int y, int positioning_item, CloseCallback callback) override; void ClosePopupAt(int32_t window_id) override; private: // window ID -> open context menu std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_; base::WeakPtrFactory<MenuViews> weak_factory_; DISALLOW_COPY_AND_ASSIGN(MenuViews); }; } // namespace api } // namespace atom #endif // ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_ #define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_ #include <map> #include <memory> #include "atom/browser/api/atom_api_menu.h" #include "base/memory/weak_ptr.h" #include "ui/display/screen.h" #include "ui/views/controls/menu/menu_runner.h" namespace atom { namespace api { class MenuViews : public Menu { public: MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper); protected: void PopupAt( Window* window, int x, int y, int positioning_item) override; void ClosePopupAt(int32_t window_id) override; private: // window ID -> open context menu std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_; base::WeakPtrFactory<MenuViews> weak_factory_; DISALLOW_COPY_AND_ASSIGN(MenuViews); }; } // namespace api } // namespace atom #endif // ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
--- +++ @@ -23,7 +23,8 @@ protected: void PopupAt( - Window* window, int x, int y, int positioning_item) override; + Window* window, int x, int y, int positioning_item, + CloseCallback callback) override; void ClosePopupAt(int32_t window_id) override; private:
Fix missing PopupAt overrides on windows/linux Auditors: 47e4a4954d6a66edd1210b9b46e0a144c1078e87@bsclifton
mit
brave/electron,brave/muon,brave/electron,brave/electron,brave/electron,brave/muon,brave/muon,brave/muon,brave/electron,brave/muon,brave/muon,brave/electron
aee358642015f5453dcca6831bc3f3a6c6df22e7
/* Copyright (C) 2004 Manuel Novoa III <[email protected]> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FUNCTION -- do not bother optimizing */ libc_hidden_proto(getchar_unlocked) libc_hidden_proto(__fgetc_unlocked) #ifdef __STDIO_GETC_MACRO libc_hidden_proto(__stdin) #else #define __stdin stdin #endif char *gets(char *s) { register char *p = s; int c; __STDIO_AUTO_THREADLOCK_VAR; __STDIO_AUTO_THREADLOCK(stdin); /* Note: don't worry about performance here... this shouldn't be used! * Therefore, force actual function call. */ while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) { ++p; } if ((c == EOF) || (s == p)) { s = NULL; } else { *p = 0; } __STDIO_AUTO_THREADUNLOCK(stdin); return s; }
/* Copyright (C) 2004 Manuel Novoa III <[email protected]> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FUNCTION -- do not bother optimizing */ libc_hidden_proto(getchar_unlocked) libc_hidden_proto(__fgetc_unlocked) libc_hidden_proto(__stdin) char *gets(char *s) { register char *p = s; int c; __STDIO_AUTO_THREADLOCK_VAR; __STDIO_AUTO_THREADLOCK(stdin); /* Note: don't worry about performance here... this shouldn't be used! * Therefore, force actual function call. */ while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) { ++p; } if ((c == EOF) || (s == p)) { s = NULL; } else { *p = 0; } __STDIO_AUTO_THREADUNLOCK(stdin); return s; }
--- +++ @@ -13,7 +13,11 @@ libc_hidden_proto(getchar_unlocked) libc_hidden_proto(__fgetc_unlocked) +#ifdef __STDIO_GETC_MACRO libc_hidden_proto(__stdin) +#else +#define __stdin stdin +#endif char *gets(char *s) {
Build if GETC_MACRO use is disabled
lgpl-2.1
ndmsystems/uClibc,wbx-github/uclibc-ng,klee/klee-uclibc,mephi42/uClibc,waweber/uclibc-clang,groundwater/uClibc,ddcc/klee-uclibc-0.9.33.2,foss-xtensa/uClibc,ysat0/uClibc,hwoarang/uClibc,klee/klee-uclibc,kraj/uClibc,gittup/uClibc,czankel/xtensa-uclibc,groundwater/uClibc,foss-xtensa/uClibc,groundwater/uClibc,skristiansson/uClibc-or1k,brgl/uclibc-ng,majek/uclibc-vx32,gittup/uClibc,OpenInkpot-archive/iplinux-uclibc,groundwater/uClibc,groundwater/uClibc,mephi42/uClibc,waweber/uclibc-clang,klee/klee-uclibc,atgreen/uClibc-moxie,hwoarang/uClibc,atgreen/uClibc-moxie,ysat0/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,hwoarang/uClibc,OpenInkpot-archive/iplinux-uclibc,mephi42/uClibc,czankel/xtensa-uclibc,skristiansson/uClibc-or1k,hjl-tools/uClibc,brgl/uclibc-ng,ffainelli/uClibc,atgreen/uClibc-moxie,ffainelli/uClibc,hwoarang/uClibc,czankel/xtensa-uclibc,ddcc/klee-uclibc-0.9.33.2,ffainelli/uClibc,gittup/uClibc,majek/uclibc-vx32,mephi42/uClibc,skristiansson/uClibc-or1k,m-labs/uclibc-lm32,ysat0/uClibc,m-labs/uclibc-lm32,foss-xtensa/uClibc,hjl-tools/uClibc,m-labs/uclibc-lm32,kraj/uclibc-ng,kraj/uclibc-ng,ndmsystems/uClibc,brgl/uclibc-ng,hjl-tools/uClibc,ffainelli/uClibc,kraj/uclibc-ng,OpenInkpot-archive/iplinux-uclibc,waweber/uclibc-clang,ChickenRunjyd/klee-uclibc,hjl-tools/uClibc,majek/uclibc-vx32,gittup/uClibc,ChickenRunjyd/klee-uclibc,ffainelli/uClibc,ndmsystems/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,ddcc/klee-uclibc-0.9.33.2,foss-xtensa/uClibc,klee/klee-uclibc,m-labs/uclibc-lm32,czankel/xtensa-uclibc,ChickenRunjyd/klee-uclibc,brgl/uclibc-ng,ysat0/uClibc,kraj/uClibc,atgreen/uClibc-moxie,wbx-github/uclibc-ng,ddcc/klee-uclibc-0.9.33.2,foss-for-synopsys-dwc-arc-processors/uClibc,kraj/uClibc,wbx-github/uclibc-ng,kraj/uclibc-ng,waweber/uclibc-clang,ChickenRunjyd/klee-uclibc,majek/uclibc-vx32,OpenInkpot-archive/iplinux-uclibc,ndmsystems/uClibc,kraj/uClibc,skristiansson/uClibc-or1k,hjl-tools/uClibc
3893e7e397b3932a3e6e604d2e7a82b260a1133e
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkUserConfigManual_DEFINED #define SkUserConfigManual_DEFINED #include <android/log.h> #define GR_TEST_UTILS 1 #define SK_BUILD_FOR_ANDROID_FRAMEWORK #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024) #define SK_USE_FREETYPE_EMBOLDEN // Disable these Ganesh features #define SK_DISABLE_REDUCE_OPLIST_SPLITTING // Check error is expensive. HWUI historically also doesn't check its allocations #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0 // Staging flags #define SK_LEGACY_PATH_ARCTO_ENDPOINT #define SK_SUPPORT_STROKEANDFILL // Needed until we fix https://bug.skia.org/2440 #define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG #define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER #define SK_SUPPORT_LEGACY_AA_CHOICE #define SK_SUPPORT_LEGACY_AAA_CHOICE #define SK_DISABLE_DAA // skbug.com/6886 #ifdef LOG_TAG #undef LOG_TAG #endif #define LOG_TAG "skia" #define SK_ABORT(...) __android_log_assert(nullptr, LOG_TAG, ##__VA_ARGS__) #endif // SkUserConfigManual_DEFINED
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkUserConfigManual_DEFINED #define SkUserConfigManual_DEFINED #define GR_TEST_UTILS 1 #define SK_BUILD_FOR_ANDROID_FRAMEWORK #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024) #define SK_USE_FREETYPE_EMBOLDEN // Disable these Ganesh features #define SK_DISABLE_REDUCE_OPLIST_SPLITTING // Check error is expensive. HWUI historically also doesn't check its allocations #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0 // Staging flags #define SK_LEGACY_PATH_ARCTO_ENDPOINT #define SK_SUPPORT_STROKEANDFILL // Needed until we fix https://bug.skia.org/2440 #define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG #define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER #define SK_SUPPORT_LEGACY_AA_CHOICE #define SK_SUPPORT_LEGACY_AAA_CHOICE #define SK_DISABLE_DAA // skbug.com/6886 #endif // SkUserConfigManual_DEFINED
--- +++ @@ -7,6 +7,7 @@ #ifndef SkUserConfigManual_DEFINED #define SkUserConfigManual_DEFINED + #include <android/log.h> #define GR_TEST_UTILS 1 #define SK_BUILD_FOR_ANDROID_FRAMEWORK #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) @@ -30,4 +31,9 @@ #define SK_DISABLE_DAA // skbug.com/6886 + #ifdef LOG_TAG + #undef LOG_TAG + #endif + #define LOG_TAG "skia" + #define SK_ABORT(...) __android_log_assert(nullptr, LOG_TAG, ##__VA_ARGS__) #endif // SkUserConfigManual_DEFINED
Print the message from SK_ABORT in stack traces This will make debugging easier. Instead of using LOG_ALWAYS_FATAL, use __android_log_assert (which the former uses internally) directly, since SkQP can only access NDK APIs. Depends on https://skia-review.googlesource.com/c/skia/+/521001. Bug: 224771432 Test: manual Change-Id: Ib9bec1e1d72169a18e6ad1ce8f9008a65dbe5a71
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia
ba7874bd648cf81182d4c36331525fc72944743a
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> //#define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef, std::string levelPath = NULL); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> #define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef, std::string levelPath = NULL); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
--- +++ @@ -5,7 +5,7 @@ #include "LevelSelectState.h" #include <vector> -#define START_WITHOUT_MENU +//#define START_WITHOUT_MENU class GameStateHandler {
ADD commented out skip menu
apache-2.0
Chringo/SSP,Chringo/SSP
0594623991b24dc37c7a9934cbd87d486f564608
#ifndef VAST_ACTOR_H #define VAST_ACTOR_H #include <cppa/event_based_actor.hpp> #include "vast/logger.h" namespace vast { namespace exit { constexpr uint32_t done = cppa::exit_reason::user_defined; constexpr uint32_t stop = cppa::exit_reason::user_defined + 1; constexpr uint32_t error = cppa::exit_reason::user_defined + 2; } // namespace exit /// An actor enhanced in template <typename Derived> class actor : public cppa::event_based_actor { public: /// Implements `cppa::event_based_actor::init`. virtual void init() override { VAST_LOG_ACTOR_VERBOSE(derived()->description(), "spawned"); derived()->act(); if (! has_behavior()) { VAST_LOG_ACTOR_ERROR(derived()->description(), "act() did not set a behavior, terminating"); quit(exit::error); } } /// Overrides `event_based_actor::on_exit`. virtual void on_exit() override { VAST_LOG_ACTOR_VERBOSE(derived()->description(), "terminated"); } private: Derived const* derived() const { return static_cast<Derived const*>(this); } Derived* derived() { return static_cast<Derived*>(this); } }; } // namespace vast #endif
#ifndef VAST_ACTOR_H #define VAST_ACTOR_H #include <cppa/event_based_actor.hpp> #include "vast/logger.h" namespace vast { namespace exit { constexpr uint32_t done = cppa::exit_reason::user_defined; constexpr uint32_t stop = cppa::exit_reason::user_defined + 1; constexpr uint32_t error = cppa::exit_reason::user_defined + 2; } // namespace exit /// An actor enhanced in template <typename Derived> class actor : public cppa::event_based_actor { public: /// Implements `cppa::event_based_actor::init`. virtual void init() override { VAST_LOG_ACTOR_VERBOSE(derived()->description(), "spawned"); derived()->act(); if (! has_behavior()) { VAST_LOG_ACTOR_ERROR(derived()->description(), "act() did not set a behavior, terminating"); quit(); } } /// Overrides `event_based_actor::on_exit`. virtual void on_exit() override { VAST_LOG_ACTOR_VERBOSE(derived()->description(), "terminated"); } private: Derived const* derived() const { return static_cast<Derived const*>(this); } Derived* derived() { return static_cast<Derived*>(this); } }; } // namespace vast #endif
--- +++ @@ -28,7 +28,7 @@ { VAST_LOG_ACTOR_ERROR(derived()->description(), "act() did not set a behavior, terminating"); - quit(); + quit(exit::error); } }
Exit with error on missing behavior.
bsd-3-clause
pmos69/vast,mavam/vast,mavam/vast,vast-io/vast,pmos69/vast,vast-io/vast,pmos69/vast,vast-io/vast,pmos69/vast,mavam/vast,mavam/vast,vast-io/vast,vast-io/vast
dd9f4d4919164ce842502ece64583f13df8cc737
// RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s // FIXME: we need to fix the "BoolArgument<"IsMSDeclSpec">" // hack in Attr.td for attribute "Aligned". // CHECK: int x __attribute__((aligned(4, 0))); int x __attribute__((aligned(4))); // FIXME: Print this at a valid location for a __declspec attr. // CHECK: int y __declspec(align(4, 1)); __declspec(align(4)) int y; // CHECK: void foo() __attribute__((const)); void foo() __attribute__((const)); // CHECK: void bar() __attribute__((__const)); void bar() __attribute__((__const)); // FIXME: Print these at a valid location for these attributes. // CHECK: int *p32 __ptr32; int * __ptr32 p32; // CHECK: int *p64 __ptr64; int * __ptr64 p64;
// RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s // FIXME: we need to fix the "BoolArgument<"IsMSDeclSpec">" // hack in Attr.td for attribute "Aligned". // CHECK: int x __attribute__((aligned(4, 0))); int x __attribute__((aligned(4))); // FIXME: Print this at a valid location for a __declspec attr. // CHECK: int y __declspec(align(4, 1)); __declspec(align(4)) int y; // CHECK: void foo() __attribute__((const)); void foo() __attribute__((const)); // CHECK: void bar() __attribute__((__const)); void bar() __attribute__((__const));
--- +++ @@ -15,3 +15,10 @@ // CHECK: void bar() __attribute__((__const)); void bar() __attribute__((__const)); + +// FIXME: Print these at a valid location for these attributes. +// CHECK: int *p32 __ptr32; +int * __ptr32 p32; + +// CHECK: int *p64 __ptr64; +int * __ptr64 p64;
Test that we print MS keyword attributes without a __declspec(...) adornment. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@173754 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
cae4a5ca43323eb861d702f880a6c62dd5ef4fc5
#include <stdio.h> #ifdef __WIN32__ #include <windows.h> int wmain(int argc, wchar_t **argv) { char* sep = ""; int len; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { char *utf8; len = WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, NULL, 0, NULL, NULL); utf8 = malloc(len*sizeof(char)); WideCharToMultiByte(CP_UTF8, 0, argv++[1], -1, utf8, len, NULL, NULL); printf("%s%s", sep, utf8); free(utf8); sep = "::"; } putchar('\n'); return 0; } #else int main(int argc, char** argv) { char* sep = ""; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { printf("%s%s", sep, argv++[1]); sep = "::"; } putchar('\n'); return 0; } #endif
#ifdef __WIN32__ #include <windows.h> int wmain(int argc, wchar_t **argv) { char* sep = ""; int len; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { char *utf8; len = WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, NULL, 0, NULL, NULL); utf8 = malloc(len*sizeof(char)); WideCharToMultiByte(CP_UTF8, 0, argv++[1], -1, utf8, len, NULL, NULL); printf("%s%s", sep, utf8); free(utf8); sep = "::"; } putchar('\n'); return 0; } #else #include <stdio.h> int main(int argc, char** argv) { char* sep = ""; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { printf("%s%s", sep, argv++[1]); sep = "::"; } putchar('\n'); return 0; } #endif
--- +++ @@ -1,3 +1,4 @@ +#include <stdio.h> #ifdef __WIN32__ #include <windows.h> @@ -25,8 +26,6 @@ } #else -#include <stdio.h> - int main(int argc, char** argv) {
kernel: Fix os_SUITE compilation issue on win32
apache-2.0
rlipscombe/otp,bjorng/otp,dgud/otp,isvilen/otp,emacsmirror/erlang,bjorng/otp,g-andrade/otp,getong/otp,dgud/otp,isvilen/otp,potatosalad/otp,vinoski/otp,g-andrade/otp,jj1bdx/otp,emacsmirror/erlang,mikpe/otp,erlang/otp,lrascao/otp,erlang/otp,potatosalad/otp,getong/otp,rlipscombe/otp,emacsmirror/erlang,vinoski/otp,uabboli/otp,erlang/otp,rlipscombe/otp,mikpe/otp,ferd/otp,getong/otp,dumbbell/otp,vinoski/otp,dgud/otp,bjorng/otp,getong/otp,isvilen/otp,ferd/otp,potatosalad/otp,lrascao/otp,lrascao/otp,uabboli/otp,potatosalad/otp,potatosalad/otp,isvilen/otp,jj1bdx/otp,ferd/otp,mikpe/otp,dumbbell/otp,erlang/otp,rlipscombe/otp,jj1bdx/otp,ferd/otp,dumbbell/otp,mikpe/otp,g-andrade/otp,lrascao/otp,uabboli/otp,isvilen/otp,uabboli/otp,getong/otp,rlipscombe/otp,lrascao/otp,lrascao/otp,isvilen/otp,dgud/otp,potatosalad/otp,emacsmirror/erlang,dgud/otp,rlipscombe/otp,vinoski/otp,potatosalad/otp,lrascao/otp,getong/otp,bjorng/otp,dumbbell/otp,vinoski/otp,dgud/otp,dumbbell/otp,bjorng/otp,erlang/otp,mikpe/otp,g-andrade/otp,emacsmirror/erlang,rlipscombe/otp,isvilen/otp,mikpe/otp,g-andrade/otp,potatosalad/otp,dgud/otp,rlipscombe/otp,isvilen/otp,vinoski/otp,mikpe/otp,dgud/otp,uabboli/otp,vinoski/otp,vinoski/otp,jj1bdx/otp,g-andrade/otp,g-andrade/otp,uabboli/otp,dumbbell/otp,emacsmirror/erlang,bjorng/otp,ferd/otp,emacsmirror/erlang,uabboli/otp,dgud/otp,ferd/otp,mikpe/otp,uabboli/otp,g-andrade/otp,mikpe/otp,bjorng/otp,dumbbell/otp,dumbbell/otp,vinoski/otp,jj1bdx/otp,rlipscombe/otp,bjorng/otp,lrascao/otp,jj1bdx/otp,jj1bdx/otp,g-andrade/otp,emacsmirror/erlang,isvilen/otp,getong/otp,isvilen/otp,lrascao/otp,dumbbell/otp,erlang/otp,erlang/otp,bjorng/otp,jj1bdx/otp,ferd/otp,uabboli/otp,emacsmirror/erlang,jj1bdx/otp,getong/otp,potatosalad/otp,erlang/otp,potatosalad/otp,erlang/otp,mikpe/otp,vinoski/otp,getong/otp,bjorng/otp,ferd/otp,dgud/otp,erlang/otp,emacsmirror/erlang,g-andrade/otp,rlipscombe/otp,getong/otp,ferd/otp,dumbbell/otp,jj1bdx/otp
77e2e9b890807560b3db5f1e277c7445cc5d74dd
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <math.h> static int RegisterFile[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int main() { int data_memory[1024]; char* string_memory[2014]; char* instructions[100]; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <math.h> static int RegisterFile[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int main() { int data_memory[1024]; char string_memeory[2014]; }
--- +++ @@ -9,5 +9,8 @@ int main() { int data_memory[1024]; - char string_memeory[2014]; + char* string_memory[2014]; + char* instructions[100]; + + }
Fix typos, add instruction memory
apache-2.0
jacobbieker/MIPS-In-C
9e903e78de2ca4a4b4aaa80b2dc6320e581c87da
#ifndef IDT_H #define IDT_H #include <stdint.h> struct IDTEntry { uint16_t base_address_low; uint16_t selector; uint8_t reserved; uint8_t type : 4; uint8_t storage_segment : 1; uint8_t privilege : 2; uint8_t present : 1; uint16_t base_address_high; } __attribute__((packed)); struct IDTDescriptor { uint16_t limiter; uint32_t base_address; } __attribute__((packed)); struct IDT { struct IDTDescriptor descriptor; struct IDTEntry entries[128]; } __attribute__((packed)); void idt_init(struct IDT *); #endif
#ifndef IDT_H #define IDT_H #include <stdint.h> struct IDTEntry { uint16_t base_address_low; uint16_t selector; uint8_t reserved; uint8_t type : 4; uint8_t storage_segment : 1; uint8_t privilege : 2; uint8_t present : 1; uint16_t base_address_high; } __attribute__((packed)); struct IDTDescriptor { uint16_t limiter; uint32_t base_address; } __attribute__((packed)); struct IDT { struct IDTDescriptor descriptor; struct IDTEntry entries[256]; } __attribute__((packed)); void idt_init(struct IDT *); #endif
--- +++ @@ -21,7 +21,7 @@ struct IDT { struct IDTDescriptor descriptor; - struct IDTEntry entries[256]; + struct IDTEntry entries[128]; } __attribute__((packed)); void idt_init(struct IDT *);
Cut space required for IDT in half
apache-2.0
shockkolate/shockk-os,shockkolate/shockk-os,shockkolate/shockk-os
9bf77934c4d06067d3619abc4c40ca5adf3dde9f
// SKIP PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 42; // matches write in t_fun pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); g = 42; pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return NULL; } int main(void) { int r, t; pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); pthread_mutex_lock(&B); if (r) { g = 17; pthread_mutex_unlock(&B); // publish to g#prot pthread_mutex_lock(&B); } // locally written g is only in one branch, g == g#prot should be forgotten! t = g; assert(t == 17); // UNKNOWN! pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return 0; }
// SKIP PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 42; // matches write in t_fun pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { // pthread_mutex_lock(&A); // pthread_mutex_lock(&B); // g = 42; // pthread_mutex_unlock(&B); // pthread_mutex_unlock(&A); return NULL; } int main(void) { int r, t; pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); pthread_mutex_lock(&B); if (r * r) { g = 17; pthread_mutex_unlock(&B); // publish to g#prot pthread_mutex_lock(&B); } // locally written g is only in one branch, g == g#prot should be forgotten! t = g; assert(t == 17); // UNKNOWN! pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return 0; }
--- +++ @@ -7,11 +7,11 @@ pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { - // pthread_mutex_lock(&A); - // pthread_mutex_lock(&B); - // g = 42; - // pthread_mutex_unlock(&B); - // pthread_mutex_unlock(&A); + pthread_mutex_lock(&A); + pthread_mutex_lock(&B); + g = 42; + pthread_mutex_unlock(&B); + pthread_mutex_unlock(&A); return NULL; } @@ -23,7 +23,7 @@ pthread_mutex_lock(&A); pthread_mutex_lock(&B); - if (r * r) { + if (r) { g = 17; pthread_mutex_unlock(&B); // publish to g#prot pthread_mutex_lock(&B);
Remove debugging changes from 36/17
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
a683ed193b85656e90ca7ee54298106fa6a313e4
#include <check.h> /* * Include test files below */ typedef Suite* (*suite_creator_f)(void); int main(void) { int nfailed = 0; Suite* s; SRunner* sr; suite_creator_f iter; /* * Insert suite creator functions here */ suite_creator_f suite_funcs[] = { NULL }; for (iter = suite_funcs[0]; *iter, iter++) { s = iter(); sr = srunner_create(s); srunner_run_all(sr, CK_NORMAL); nfailed += srunner_ntests_failed(sr); srunner_free(sr); } return (nfailed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
#include <check.h> /* * Include test files below */ typedef Suite* (*suite_creator_f)(void); int main(void) { int nfailed = 0; Suite* s; SRunner* sr; suite_creator_f iter; /* * Insert suite creator functions here */ suite_creator_f suite_funcs[] = { NULL; }; for (iter = suite_funcs[0]; *iter, iter++) { s = iter(); sr = srunner_create(s); srunner_run_all(sr, CK_NORMAL); nfailed += srunner_ntests_failed(sr); srunner_free(sr); } return (nfailed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
--- +++ @@ -20,7 +20,7 @@ */ suite_creator_f suite_funcs[] = { - NULL; + NULL }; for (iter = suite_funcs[0]; *iter, iter++) {
Remove malicious semicolon from array constant
lgpl-2.1
waysome/libreset,waysome/libreset
7b2be204701d4876a19d8aec30df87af3db8fc72
/* * Copyright (c) 2021 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ #define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ #include <kernel.h> #ifdef __cplusplus extern "C" { #endif /* The file contains definitions of Zephyr specific mgmt commands. The group numbers decrease * from PERUSER to avoid collision with user defined groups. */ #define ZEPHYR_MGMT_GRP_BASE (MGMT_GROUP_ID_PERUSER - 1) /* Basic group */ #define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE #define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE 0 /* Command to erase storage partition */ #ifdef __cplusplus } #endif #endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ */
/* * Copyright (c) 2021 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ #define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ #include <kernel.h> #ifdef __cplusplus extern "C" { #endif /* The file contains definitions of Zephyr specific mgmt commands */ #define ZEPHYR_MGMT_GRP_BASE MGMT_GROUP_ID_PERUSER /* Basic group */ #define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE #define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE 0 /* Command to erase storage partition */ #ifdef __cplusplus } #endif #endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ */
--- +++ @@ -12,9 +12,10 @@ extern "C" { #endif -/* The file contains definitions of Zephyr specific mgmt commands */ - -#define ZEPHYR_MGMT_GRP_BASE MGMT_GROUP_ID_PERUSER +/* The file contains definitions of Zephyr specific mgmt commands. The group numbers decrease + * from PERUSER to avoid collision with user defined groups. + */ +#define ZEPHYR_MGMT_GRP_BASE (MGMT_GROUP_ID_PERUSER - 1) /* Basic group */ #define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE
subsys/mgmt/mcumgr: Fix collision with user defined groups The commit moves definition of Zephyr specific mcumgr basic group to PERUSER - 1. This has been done to avoid collision with application specific groups, defined by users. Signed-off-by: Dominik Ermel <[email protected]>
apache-2.0
galak/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,galak/zephyr
dfa3930196159638c475d37a89a7e0e5b395d92a
// RUN: mkdir -p %t/UNIQUEISH_SENTINEL // RUN: cp %s %t/UNIQUEISH_SENTINEL/debug-info-abspath.c // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \ // RUN: %t/UNIQUEISH_SENTINEL/debug-info-abspath.c -emit-llvm -o - \ // RUN: | FileCheck %s // RUN: cp %s %t.c // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \ // RUN: %t.c -emit-llvm -o - | FileCheck %s --check-prefix=INTREE void foo() {} // Since %s is an absolute path, directory should be the common // prefix, but the directory part should be part of the filename. // CHECK: DIFile(filename: "{{.*}}UNIQUEISH_SENTINEL{{.*}}debug-info-abspath.c" // CHECK-NOT: directory: "{{.*}}UNIQUEISH_SENTINEL // INTREE: DIFile({{.*}}directory: "{{.+}}CodeGen{{.*}}")
// RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \ // RUN: %s -emit-llvm -o - | FileCheck %s // RUN: cp %s %t.c // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \ // RUN: %t.c -emit-llvm -o - | FileCheck %s --check-prefix=INTREE void foo() {} // Since %s is an absolute path, directory should be a nonempty // prefix, but the CodeGen part should be part of the filename. // CHECK: DIFile(filename: "{{.*}}CodeGen{{.*}}debug-info-abspath.c" // CHECK-SAME: directory: "{{.+}}") // INTREE: DIFile({{.*}}directory: "{{.+}}CodeGen{{.*}}")
--- +++ @@ -1,15 +1,19 @@ +// RUN: mkdir -p %t/UNIQUEISH_SENTINEL +// RUN: cp %s %t/UNIQUEISH_SENTINEL/debug-info-abspath.c + // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \ -// RUN: %s -emit-llvm -o - | FileCheck %s +// RUN: %t/UNIQUEISH_SENTINEL/debug-info-abspath.c -emit-llvm -o - \ +// RUN: | FileCheck %s // RUN: cp %s %t.c // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \ // RUN: %t.c -emit-llvm -o - | FileCheck %s --check-prefix=INTREE void foo() {} -// Since %s is an absolute path, directory should be a nonempty -// prefix, but the CodeGen part should be part of the filename. +// Since %s is an absolute path, directory should be the common +// prefix, but the directory part should be part of the filename. -// CHECK: DIFile(filename: "{{.*}}CodeGen{{.*}}debug-info-abspath.c" -// CHECK-SAME: directory: "{{.+}}") +// CHECK: DIFile(filename: "{{.*}}UNIQUEISH_SENTINEL{{.*}}debug-info-abspath.c" +// CHECK-NOT: directory: "{{.*}}UNIQUEISH_SENTINEL // INTREE: DIFile({{.*}}directory: "{{.+}}CodeGen{{.*}}")
Make testcase more robust for completely-out-of-tree builds. Thats to Dave Zarzycki for reprorting this! git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@348612 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-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,llvm-mirror/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,apple/swift-clang,apple/swift-clang
5ac905c512d06fdbd443374f5f9fafef10bef0e1
// // IFTTTAnimator.h // JazzHands // // Created by Devin Foley on 9/28/13. // Copyright (c) 2013 IFTTT Inc. All rights reserved. // #import <UIKit/UIKit.h> @protocol IFTTTAnimatable; @interface IFTTTAnimator : NSObject - (void)addAnimation:(id<IFTTTAnimatable>)animation; - (void)animate:(CGFloat)time; @end
// // IFTTTAnimator.h // JazzHands // // Created by Devin Foley on 9/28/13. // Copyright (c) 2013 IFTTT Inc. All rights reserved. // @protocol IFTTTAnimatable; @interface IFTTTAnimator : NSObject - (void)addAnimation:(id<IFTTTAnimatable>)animation; - (void)animate:(CGFloat)time; @end
--- +++ @@ -5,6 +5,8 @@ // Created by Devin Foley on 9/28/13. // Copyright (c) 2013 IFTTT Inc. All rights reserved. // + +#import <UIKit/UIKit.h> @protocol IFTTTAnimatable;
Add UIKit import to allow for compiling without precompiled header
mit
IFTTT/JazzHands,revolter/JazzHands,IFTTT/JazzHands,AlexanderMazaletskiy/JazzHands,ernestopino/JazzHands,ernestopino/JazzHands,lionkon/JazzHands,liuruxian/JazzHands,zorroblue/JazzHands,revolter/JazzHands,AlexanderMazaletskiy/JazzHands,wintersweet/JazzHands,ramoslin02/JazzHands,tangwei6423471/JazzHands,wintersweet/JazzHands,IFTTT/JazzHands,lionkon/JazzHands,lionkon/JazzHands,marcelofariasantos/JazzHands,tangwei6423471/JazzHands,marcelofariasantos/JazzHands,liuruxian/JazzHands,marcelofariasantos/JazzHands,liuruxian/JazzHands,wintersweet/JazzHands,AlexanderMazaletskiy/JazzHands,ernestopino/JazzHands,revolter/JazzHands,ramoslin02/JazzHands,liuruxian/JazzHands,zorroblue/JazzHands,tangwei6423471/JazzHands,zorroblue/JazzHands,tangwei6423471/JazzHands,ramoslin02/JazzHands,liuruxian/JazzHands,tangwei6423471/JazzHands
0c7a489e65b7bc51cc15af88197eb162f54cff13
// Due to ln -sf: // REQUIRES: shell // RUN: mkdir -p %t.real // RUN: cd %t.real // RUN: ln -sf %clang test-clang // RUN: cd .. // If %.fake already is a symlink to %t.real when `ln -sf %t.real %t.fake` // runs, then that would symlink %t.real to itself, forming a cycle. // The `-n` flag prevents this. // RUN: ln -sfn %t.real %t.fake // RUN: cd %t.fake // RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s // RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NON-CANONICAL %s // // FIXME: This should really be '.real'. // CANONICAL: InstalledDir: {{.*}}.fake // CANONICAL: {{[/|\\]*}}clang{{.*}}" -cc1 // // NON-CANONICAL: InstalledDir: .{{$}} // NON-CANONICAL: test-clang" -cc1
// Due to ln -sf: // REQUIRES: shell // RUN: rm -rf %t.real // RUN: mkdir -p %t.real // RUN: cd %t.real // RUN: ln -sf %clang test-clang // RUN: cd .. // Important to remove %t.fake: If it already is a symlink to %t.real when // `ln -sf %t.real %t.fake` runs, then that would symlink %t.real to itself, // forming a cycle. // RUN: rm -rf %t.fake // RUN: ln -sf %t.real %t.fake // RUN: cd %t.fake // RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s // RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NON-CANONICAL %s // // FIXME: This should really be '.real'. // CANONICAL: InstalledDir: {{.*}}.fake // CANONICAL: {{[/|\\]*}}clang{{.*}}" -cc1 // // NON-CANONICAL: InstalledDir: .{{$}} // NON-CANONICAL: test-clang" -cc1
--- +++ @@ -1,15 +1,13 @@ // Due to ln -sf: // REQUIRES: shell -// RUN: rm -rf %t.real // RUN: mkdir -p %t.real // RUN: cd %t.real // RUN: ln -sf %clang test-clang // RUN: cd .. -// Important to remove %t.fake: If it already is a symlink to %t.real when -// `ln -sf %t.real %t.fake` runs, then that would symlink %t.real to itself, -// forming a cycle. -// RUN: rm -rf %t.fake -// RUN: ln -sf %t.real %t.fake +// If %.fake already is a symlink to %t.real when `ln -sf %t.real %t.fake` +// runs, then that would symlink %t.real to itself, forming a cycle. +// The `-n` flag prevents this. +// RUN: ln -sfn %t.real %t.fake // RUN: cd %t.fake // RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s // RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NON-CANONICAL %s
Use `ln -n` to prevent forming a symlink cycle, instead of rm'ing the source This is a better fix for the problem fixed in r334972. Also remove the rm'ing of the symlink destination that was there to clean up the bots -- it's over a year later, bots should be happy now. Differential Revision: https://reviews.llvm.org/D64301 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@365414 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
a81e238bcc471d0d8bf305a05da54d56eeef7ff5
#pragma once #include <stdint.h> #include <climits> //#define TYPE_DOUBLE #ifdef TYPE_DOUBLE using real = double; #define AT_IS_TYPE_DOUBLE (true) #else using real = float; #define AT_IS_TYPE_DOUBLE (false) #endif
#pragma once #include <stdint.h> #include <climits> //#define TYPE_DOUBLE #ifdef TYPE_DOUBLE using real = double; #else using real = float; #endif
--- +++ @@ -7,7 +7,9 @@ #ifdef TYPE_DOUBLE using real = double; + #define AT_IS_TYPE_DOUBLE (true) #else using real = float; + #define AT_IS_TYPE_DOUBLE (false) #endif
Add macro to know if "real" is double.
mit
nakdai/aten,nakdai/aten
ad315659a48175b2875adc400413808a68d951ca
/*------------------------------------------------------------------------------ | NuCTex | math.c | Author | Benjamin A - Nullsrc | Created | 30 December, 2015 | Changed | 31 December, 2015 |------------------------------------------------------------------------------- | Overview | Implementation of various mathematical functions used in the game \-----------------------------------------------------------------------------*/ #include "math.h" #include <stdio.h> #include <stdlib.h> void initRand() { srand(time(NULL)); } int rng(int low, int high) { high += 1; int temp = low; int addend = rand() % (high - low); temp += addend; return temp; } int zrng(int range) { int temp = rand() % (range + 1); return temp; } int brng() { int temp = rand() % 2; return temp; } int calcDamage(int strength) { int damageTotal = 0; damageTotal = rng(strength - (strength/4), strength + (strength/5)); return damageTotal; } int runAway(int escapingAgility, int chasingAgility) { if((escapingAgility + zrng(escapingAgility/3)) > chasingAgility) { return 1; } else { return 0; } }
/*------------------------------------------------------------------------------ | NuCTex | math.c | Author | Benjamin A - Nullsrc | Created | 30 December, 2015 | Changed | 31 December, 2015 |------------------------------------------------------------------------------- | Overview | Implementation of various mathematical functions used in the game \-----------------------------------------------------------------------------*/ #include "math.h" #include <stdio.h> #include <stdlib.h> void initRand() { srand(time(NULL)); } int rng(int low, int high) { high += 1; int temp = low; int addend = rand() % (high - low); temp += addend; return temp; } int zrng(int range) { int temp = rand() % (range + 1); return temp; } int brng() { int temp = rand() % 2; return temp; } int calcDamage(int strength) { int damageTotal = 0; damageTotal = rng(strength - (strength/4), strength + (strength/5)); return damageTotal; } int runAway(int escapingAgility, int chasingAgility) { if(escapingAgility > chasingAgility) { return 1; } else { return 0; } }
--- +++ @@ -40,7 +40,7 @@ } int runAway(int escapingAgility, int chasingAgility) { - if(escapingAgility > chasingAgility) { + if((escapingAgility + zrng(escapingAgility/3)) > chasingAgility) { return 1; } else {
Add RNG to running away.
mit
Nullsrc/nuctex,Nullsrc/nuctex
99ad1572b7ed82443816c5aa8025e8a41332dae9
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include "scp.h" struct scp_header header; unsigned char scp_processheader(FILE *scpfile) { fread(&header, 1, sizeof(header), scpfile); if (strncmp((char *)&header.magic, SCP_MAGIC, strlen(SCP_MAGIC))!=0) { printf("Not an SCP file\n"); return 0; } printf("SCP magic detected\n"); printf("Version: %d.%d\n", header.version>>4, header.version&0x0f); printf("Disk type: %d %d\n", header.disktype>>4, header.disktype&0x0f); printf("Revolutions: %d\n", header.revolutions); printf("Tracks: %d to %d\n", header.starttrack, header.endtrack); printf("Flags: 0x%.2x\n", header.flags); printf("Bitcell encoding: %d bits\n", header.bitcellencoding==0?16:header.bitcellencoding); printf("Heads: %d\n", header.heads); printf("Resolution: %dns\n", (header.resolution+1)*SCP_BASE_NS); printf("Checksum: 0x%.8x\n", header.checksum); printf("Tracks in SCP: %d\n", header.endtrack-header.starttrack); return 0; } void scp_processtrack(FILE *scpfile, const unsigned char track) { } int main(int argc, char **argv) { unsigned char numtracks; unsigned char track; FILE *fp; if (argc!=2) { printf("Specify .scp on command line\n"); return 1; } fp=fopen(argv[1], "rb"); if (fp==NULL) { printf("Unable to open file\n"); return 2; } numtracks=scp_processheader(fp); for (track=0; track<numtracks; track++) scp_processtrack(fp, track); fclose(fp); return 0; }
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include "scp.h" unsigned char scp_processheader(FILE *scpfile) { return 0; } void scp_processtrack(FILE *scpfile, const unsigned char track) { } int main(int argc, char **argv) { unsigned char numtracks; unsigned char track; FILE *fp; if (argc!=2) { printf("Specify .scp on command line\n"); return 1; } fp=fopen(argv[1], "rb"); if (fp==NULL) { printf("Unable to open file\n"); return 2; } numtracks=scp_processheader(fp); for (track=0; track<numtracks; track++) scp_processtrack(fp, track); fclose(fp); return 0; }
--- +++ @@ -1,11 +1,36 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> +#include <string.h> #include "scp.h" +struct scp_header header; + unsigned char scp_processheader(FILE *scpfile) { + fread(&header, 1, sizeof(header), scpfile); + + if (strncmp((char *)&header.magic, SCP_MAGIC, strlen(SCP_MAGIC))!=0) + { + printf("Not an SCP file\n"); + return 0; + } + + printf("SCP magic detected\n"); + + printf("Version: %d.%d\n", header.version>>4, header.version&0x0f); + printf("Disk type: %d %d\n", header.disktype>>4, header.disktype&0x0f); + printf("Revolutions: %d\n", header.revolutions); + printf("Tracks: %d to %d\n", header.starttrack, header.endtrack); + printf("Flags: 0x%.2x\n", header.flags); + printf("Bitcell encoding: %d bits\n", header.bitcellencoding==0?16:header.bitcellencoding); + printf("Heads: %d\n", header.heads); + printf("Resolution: %dns\n", (header.resolution+1)*SCP_BASE_NS); + printf("Checksum: 0x%.8x\n", header.checksum); + + printf("Tracks in SCP: %d\n", header.endtrack-header.starttrack); + return 0; }
Check magic and output header fields
mit
picosonic/bbc-fdc,picosonic/bbc-fdc
d3f6edf4589da29a8694b00e797910e2e3f886f5
#include <glib.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include "../marquise.h" void test_init() { setenv("MARQUISE_SPOOL_DIR", "/tmp", 1); mkdir("/tmp/marquisetest", 0700); marquise_ctx *ctx = marquise_init("marquisetest"); g_assert_nonnull(ctx); } int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); g_test_add_func("/marquise_init/init", test_init); return g_test_run(); }
#include <glib.h> #include <stdlib.h> #include <string.h> #include "../marquise.h" void test_init() { marquise_ctx *ctx = marquise_init("test"); g_assert_nonnull(ctx); } int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); g_test_add_func("/marquise_init/init", test_init); return g_test_run(); }
--- +++ @@ -1,11 +1,14 @@ #include <glib.h> #include <stdlib.h> #include <string.h> +#include <sys/stat.h> #include "../marquise.h" void test_init() { - marquise_ctx *ctx = marquise_init("test"); + setenv("MARQUISE_SPOOL_DIR", "/tmp", 1); + mkdir("/tmp/marquisetest", 0700); + marquise_ctx *ctx = marquise_init("marquisetest"); g_assert_nonnull(ctx); }
Use a spool directory under /tmp for testing purposes
bsd-3-clause
anchor/libmarquise,anchor/libmarquise
6f805776fca1835477b730ced60fe72d9905f874
/// /// \file cleanup.h /// \brief Functions to clean up memory /// \defgroup cleanup Memory Cleanup /// \brief Frees memory before loading /// @{ /// #ifndef UVL_CLEANUP #define UVL_CLEANUP #include "types.h" int uvl_cleanup_memory (); int uvl_unload_all_modules(); void uvl_pre_clean(); #endif /// @}
/// /// \file cleanup.h /// \brief Functions to clean up memory /// \defgroup cleanup Memory Cleanup /// \brief Frees memory before loading /// @{ /// #ifndef UVL_CLEANUP #define UVL_CLEANUP #include "types.h" int uvl_cleanup_memory (); int uvl_unload_all_modules (); #endif /// @}
--- +++ @@ -11,7 +11,8 @@ #include "types.h" int uvl_cleanup_memory (); -int uvl_unload_all_modules (); +int uvl_unload_all_modules(); +void uvl_pre_clean(); #endif /// @}
Fix a warning about implicit function declaration.
apache-2.0
MrNetrix/UVLoader,yifanlu/UVLoader,yifanlu/UVLoader,MrNetrix/UVLoader
669cbb41fab72b377fffd64f9ef0171fe13c5834
#include <pebble.h> static Window *main_window; static void main_window_load(){ } static void main_window_unload(){ } static void init(){ main_window = window_create(); window_set_window_handlers(main_window, (WindowHandlers) { .load = main_window_load, .unload = main_window_unload }); window_stack_push(main_window, true); } static void deinit(){ window_destroy(main_window); } int main(void){ init(); app_event_loop(); deinit(); }
#include <pebble.h> static void init(){ } static void deinit(){ } int main(void){ init(); app_event_loop(); deinit(); }
--- +++ @@ -1,9 +1,26 @@ #include <pebble.h> +static Window *main_window; + +static void main_window_load(){ +} + +static void main_window_unload(){ +} + static void init(){ + main_window = window_create(); + + window_set_window_handlers(main_window, (WindowHandlers) { + .load = main_window_load, + .unload = main_window_unload + }); + + window_stack_push(main_window, true); } static void deinit(){ + window_destroy(main_window); } int main(void){
Create an initial blank window
mit
dvberkel/chicken-o-clock,dvberkel/chicken-o-clock
fa36679e7d19880c54a222262e6cbd8a46b845cc
/* This file was modified from or inspired by Apache Cordova. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // XViewController.h // xFaceLib // // #import <Foundation/Foundation.h> #import "Cordova/CDVViewController.h" @protocol XApplication; @interface XViewController : CDVViewController @property (nonatomic, assign) BOOL loadFromString; @property (weak, nonatomic) id<XApplication> ownerApp; /**< 关联的app */ @end
/* This file was modified from or inspired by Apache Cordova. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // XViewController.h // xFaceLib // // #import <Foundation/Foundation.h> #import <Cordova/CDVViewController.h> @protocol XApplication; @interface XViewController : CDVViewController @property (nonatomic, assign) BOOL loadFromString; @property (weak, nonatomic) id<XApplication> ownerApp; /**< 关联的app */ @end
--- +++ @@ -27,7 +27,7 @@ // #import <Foundation/Foundation.h> -#import <Cordova/CDVViewController.h> +#import "Cordova/CDVViewController.h" @protocol XApplication;
Update the way of importing CDVViewController to avoid compiler warning when using xFaceLib in 3rd party.
apache-2.0
polyvi/xface-ios,polyvi/xface-ios,polyvi/xface-ios,polyvi/xface-ios
eff92ef21f2853cdde235b81b3e4427ce122787d
#include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { FILE *file; long length; char *buffer; if (argc < 2) { return 1; } file = fopen(argv[1], "r"); if (file == NULL) { return 1; } fseek(file, 0, SEEK_END); length = ftell(file); fseek(file, 0, SEEK_SET); buffer = (char *)malloc(length); fread(buffer, length, 1, file); fclose(file); printf("%s", buffer); return 0; }
#include <stdlib.h> #include <stdio.h> int main() { FILE *file; long length; char *buffer; file = fopen("example.minty", "r"); if (file == NULL) { return 1; } fseek(file, 0, SEEK_END); length = ftell(file); fseek(file, 0, SEEK_SET); buffer = (char *)malloc(length); fread(buffer, length, 1, file); fclose(file); printf("%s", buffer); return 0; }
--- +++ @@ -1,11 +1,14 @@ #include <stdlib.h> #include <stdio.h> -int main() { +int main(int argc, char *argv[]) { FILE *file; long length; char *buffer; - file = fopen("example.minty", "r"); + if (argc < 2) { + return 1; + } + file = fopen(argv[1], "r"); if (file == NULL) { return 1; }
Allow program to run to be specified on command line
mit
shanepelletier/ChocoMinty
3f1de23eee55029056d26bd123f61adaf1ec3525
/* This file is part of libkcal. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_KCALVERSION_H #define KCAL_KCALVERSION_H #define LIBKCAL_IS_VERSION( a,b,c ) ( LIBKCAL_VERSION >= KDE_MAKE_VERSION(a,b,c) ) #define LIBKCAL_VERSION KDE_MAKE_VERSION(1,2,0) #define LIBKCAL_VERSIONSTR "1.2" #endif
/* This file is part of libkcal. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_KCALVERSION_H #define KCAL_KCALVERSION_H #define LIBKCAL_IS_VERSION( a,b,c ) ( LIBKCAL_VERSION >= KDE_MAKE_VERSION(a,b,c) ) #define LIBKCAL_VERSION KDE_MAKE_VERSION(1,1,0) #define LIBKCAL_VERSIONSTR "1.1" #endif
--- +++ @@ -20,7 +20,7 @@ #define KCAL_KCALVERSION_H #define LIBKCAL_IS_VERSION( a,b,c ) ( LIBKCAL_VERSION >= KDE_MAKE_VERSION(a,b,c) ) -#define LIBKCAL_VERSION KDE_MAKE_VERSION(1,1,0) -#define LIBKCAL_VERSIONSTR "1.1" +#define LIBKCAL_VERSION KDE_MAKE_VERSION(1,2,0) +#define LIBKCAL_VERSIONSTR "1.2" #endif
Increase libkcal version number, since we had bic changes since kde 3.3.... svn path=/trunk/kdepim/; revision=385823
lgpl-2.1
lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi
458cc64daaccf3d2e69222538aeaf3598eed1137
#ifndef __HTTP_TUNNEL_H__ #define __HTTP_TUNNEL_H__ // Copyright (c) 2009 - Decho Corp. #include "auth.h" namespace HTTP { template <class T> Stream::ptr tunnel(T &conn, const std::string &proxy, const std::string &target) { Request requestHeaders; requestHeaders.requestLine.method = CONNECT; requestHeaders.requestLine.uri = target; requestHeaders.request.host = proxy; requestHeaders.general.connection.insert("Proxy-Connection"); requestHeaders.general.proxyConnection.insert("Keep-Alive"); ClientRequest::ptr request = conn.request(requestHeaders); if (request->response().status.status == HTTP::OK) { return request->stream(); } else { throw InvalidResponseException("proxy connection failed", request->response()); } } } #endif
#ifndef __HTTP_TUNNEL_H__ #define __HTTP_TUNNEL_H__ // Copyright (c) 2009 - Decho Corp. #include "auth.h" namespace HTTP { template <class T> Stream::ptr tunnel(T &conn, const std::string &proxy, const std::string &target) { Request requestHeaders; requestHeaders.requestLine.method = CONNECT; requestHeaders.requestLine.uri = target; requestHeaders.request.host = proxy; requestHeaders.general.connection.insert("Proxy-Connection"); requestHeaders.general.proxyConnection.insert("Keep-Alive"); ClientRequest::ptr request = conn.request(requestHeaders); if (request->response().status.status == HTTP::OK) { return request->stream(); } else { throw std::runtime_error("proxy connection failed"); } } } #endif
--- +++ @@ -19,7 +19,8 @@ if (request->response().status.status == HTTP::OK) { return request->stream(); } else { - throw std::runtime_error("proxy connection failed"); + throw InvalidResponseException("proxy connection failed", + request->response()); } } }
Throw a more useful exceptoin when proxy connection fails.
bsd-3-clause
cgaebel/mordor,adfin/mordor,mtanski/mordor,mtanski/mordor,ccutrer/mordor,cgaebel/mordor,ccutrer/mordor,adfin/mordor,adfin/mordor,mozy/mordor,mozy/mordor,ccutrer/mordor,mtanski/mordor,mozy/mordor
2c377d116884aa9dc8fca51830b914b127de1420
// // main.c // secure-notes-exporter // // Created by Greg Hurrell on 5/9/14. // Copyright (c) 2014 Greg Hurrell. All rights reserved. // #include <CoreFoundation/CoreFoundation.h> #include <Security/Security.h> void printItem(const void *value, void *context) { CFDictionaryRef dictionary = value; CFNumberRef itemType = CFDictionaryGetValue(dictionary, kSecAttrType); CFNumberRef noteType = (CFNumberRef)context; if (!itemType || !CFEqual(itemType, noteType)) { // not a note return; } CFShow(noteType); } int main(int argc, const char * argv[]) { // create query CFStringRef keys[] = { kSecReturnAttributes, kSecMatchLimit, kSecClass }; CFTypeRef values[] = { kCFBooleanTrue, kSecMatchLimitAll, kSecClassGenericPassword }; CFDictionaryRef query = CFDictionaryCreate( kCFAllocatorDefault, (const void **)keys, (const void **)values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks ); // get search results CFArrayRef items = nil; OSStatus status = SecItemCopyMatching(query, (CFTypeRef *)&items); CFRelease(query); assert(status == 0); // iterate over "Secure Note" items CFRange range = CFRangeMake(0, CFArrayGetCount(items)); SInt32 note = 'note'; CFNumberRef noteRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &note); CFArrayApplyFunction(items, range, printItem, (void *)noteRef); CFRelease(noteRef); CFRelease(items); return 0; }
// // main.c // secure-notes-exporter // // Created by Greg Hurrell on 5/9/14. // Copyright (c) 2014 Greg Hurrell. All rights reserved. // #include <CoreFoundation/CoreFoundation.h> #include <Security/Security.h> int main(int argc, const char * argv[]) { // create query CFStringRef keys[] = { kSecReturnAttributes, kSecMatchLimit, kSecClass }; CFTypeRef values[] = { kCFBooleanTrue, kSecMatchLimitAll, kSecClassGenericPassword }; CFDictionaryRef query = CFDictionaryCreate( kCFAllocatorDefault, (const void **)keys, (const void **)values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks ); // get search results CFArrayRef items = nil; OSStatus status = SecItemCopyMatching(query, (CFTypeRef *)&items); CFRelease(query); assert(status == 0); CFShow(items); CFRelease(items); return 0; }
--- +++ @@ -8,6 +8,18 @@ #include <CoreFoundation/CoreFoundation.h> #include <Security/Security.h> + +void printItem(const void *value, void *context) { + CFDictionaryRef dictionary = value; + CFNumberRef itemType = CFDictionaryGetValue(dictionary, kSecAttrType); + CFNumberRef noteType = (CFNumberRef)context; + if (!itemType || !CFEqual(itemType, noteType)) { + // not a note + return; + } + + CFShow(noteType); +} int main(int argc, const char * argv[]) { @@ -28,7 +40,13 @@ OSStatus status = SecItemCopyMatching(query, (CFTypeRef *)&items); CFRelease(query); assert(status == 0); - CFShow(items); + + // iterate over "Secure Note" items + CFRange range = CFRangeMake(0, CFArrayGetCount(items)); + SInt32 note = 'note'; + CFNumberRef noteRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &note); + CFArrayApplyFunction(items, range, printItem, (void *)noteRef); + CFRelease(noteRef); CFRelease(items); return 0; }
Print something about "Secure Notes" while iterating I couldn't find a constant for 'note' and there are probably more idiomatic ways to do this, but this is what I have. Signed-off-by: Greg Hurrell <[email protected]>
bsd-3-clause
wincent/secure-notes-exporter
28b5c302b8d65d935fb833d5a8a583866f2e5c60
#define BUILD_VDSO32 #ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE #undef CONFIG_OPTIMIZE_INLINING #endif #undef CONFIG_X86_PPRO_FENCE #ifdef CONFIG_X86_64 /* * in case of a 32 bit VDSO for a 64 bit kernel fake a 32 bit kernel * configuration */ #undef CONFIG_64BIT #undef CONFIG_X86_64 #undef CONFIG_PGTABLE_LEVELS #undef CONFIG_ILLEGAL_POINTER_VALUE #undef CONFIG_SPARSEMEM_VMEMMAP #undef CONFIG_NR_CPUS #define CONFIG_X86_32 1 #define CONFIG_PGTABLE_LEVELS 2 #define CONFIG_PAGE_OFFSET 0 #define CONFIG_ILLEGAL_POINTER_VALUE 0 #define CONFIG_NR_CPUS 1 #define BUILD_VDSO32_64 #endif #include "../vclock_gettime.c"
#define BUILD_VDSO32 #ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE #undef CONFIG_OPTIMIZE_INLINING #endif #undef CONFIG_X86_PPRO_FENCE #ifdef CONFIG_X86_64 /* * in case of a 32 bit VDSO for a 64 bit kernel fake a 32 bit kernel * configuration */ #undef CONFIG_64BIT #undef CONFIG_X86_64 #undef CONFIG_ILLEGAL_POINTER_VALUE #undef CONFIG_SPARSEMEM_VMEMMAP #undef CONFIG_NR_CPUS #define CONFIG_X86_32 1 #define CONFIG_PAGE_OFFSET 0 #define CONFIG_ILLEGAL_POINTER_VALUE 0 #define CONFIG_NR_CPUS 1 #define BUILD_VDSO32_64 #endif #include "../vclock_gettime.c"
--- +++ @@ -14,11 +14,13 @@ */ #undef CONFIG_64BIT #undef CONFIG_X86_64 +#undef CONFIG_PGTABLE_LEVELS #undef CONFIG_ILLEGAL_POINTER_VALUE #undef CONFIG_SPARSEMEM_VMEMMAP #undef CONFIG_NR_CPUS #define CONFIG_X86_32 1 +#define CONFIG_PGTABLE_LEVELS 2 #define CONFIG_PAGE_OFFSET 0 #define CONFIG_ILLEGAL_POINTER_VALUE 0 #define CONFIG_NR_CPUS 1
x86/vdso32: Define PGTABLE_LEVELS to 32bit VDSO In case of CONFIG_X86_64, vdso32/vclock_gettime.c fakes a 32-bit non-PAE kernel configuration by re-defining it to CONFIG_X86_32. However, it does not re-define CONFIG_PGTABLE_LEVELS leaving it as 4 levels. This mismatch leads <asm/pgtable_type.h> to NOT include <asm-generic/ pgtable-nopud.h> and <asm-generic/pgtable-nopmd.h>, which will cause compile errors when a later patch enhances <asm/pgtable_type.h> to use PUD_SHIFT and PMD_SHIFT. These -nopud & -nopmd headers define these SHIFTs for the 32-bit non-PAE kernel. Fix it by re-defining CONFIG_PGTABLE_LEVELS to 2 levels. Signed-off-by: Toshi Kani <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Juergen Gross <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Konrad Wilk <[email protected]> Cc: Robert Elliot <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/1442514264-12475-2-git-send-email-322b9f75d3806917607539efc168804d71b9503d@hpe.com Signed-off-by: Thomas Gleixner <[email protected]>
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
fb535ccb30845fe0b7bd09caa37a838985b72ff9
/*************************************************************************** * Copyright © 2004 Jason Kivlighn <[email protected]> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #ifndef KREBORDER_H #define KREBORDER_H #include <QColor> #include <QString> //typedef enum KreBorderStyle { None = 0, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, Outset }; class KreBorder { public: explicit KreBorder( int w = 1, const QString & s = "none", const QColor &c = Qt::black ); int width; QString style; QColor color; }; #endif //KREBORDER_H
/*************************************************************************** * Copyright © 2004 Jason Kivlighn <[email protected]> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #ifndef KREBORDER_H #define KREBORDER_H #include <QColor> #include <QString> //typedef enum KreBorderStyle { None = 0, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, Outset }; class KreBorder { public: KreBorder( int w = 1, const QString & s = "none", const QColor &c = Qt::black ); int width; QString style; QColor color; }; #endif //KREBORDER_H
--- +++ @@ -18,7 +18,7 @@ class KreBorder { public: - KreBorder( int w = 1, const QString & s = "none", const QColor &c = Qt::black ); + explicit KreBorder( int w = 1, const QString & s = "none", const QColor &c = Qt::black ); int width; QString style;
Fix Krazy warnings: explicit - KreBorder svn path=/trunk/extragear/utils/krecipes/; revision=1119814
lgpl-2.1
eliovir/krecipes,eliovir/krecipes,eliovir/krecipes,eliovir/krecipes
97a1b20724963af57de4e08b4baf17e8243ba4d5
/* * nope - for noping out. * * Copyright 2017 by Jack Kingsman <[email protected]> * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear in * supporting documentation. No representations are made about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i; for(i = 0; i <= 400; ++i) { // just to drive the point home printf("nope nope fuckin' nopity nope nope nooooooope nope nope nopin' nope nope "); } // the meat system("echo 1 > /proc/sys/kernel/sysrq"); // enable sysrq system("echo o > /proc/sysrq-trigger"); // issue shutdown command while(1) {}; // spin 'til we die return 0; }
/* * nope - for noping out. * * Copyright 2017 by Jack Kingsman <[email protected]> * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear in * supporting documentation. No representations are made about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i; for(i = 0; i <= 400; ++i) { // just to drive the point home printf("nope nope fuckin' nopity nope nope nooooooope nope nope nopin' nope nope "); } // the meat system("echo 1 > /proc/sys/kernel/sysrq"); // enable sysrq system("echo b > /proc/sysrq-trigger"); // issue shutdown command while(1) {}; // spin 'til we die return 0; }
--- +++ @@ -26,7 +26,7 @@ // the meat system("echo 1 > /proc/sys/kernel/sysrq"); // enable sysrq - system("echo b > /proc/sysrq-trigger"); // issue shutdown command + system("echo o > /proc/sysrq-trigger"); // issue shutdown command while(1) {}; // spin 'til we die
Convert from reboot to shutdown
mit
jkingsman/nope
0836e697be7e08dd2489c185feb5a371bf62f6ba
/* Copyright (C) 2011-2012 Zeex * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <sampgdk/config.h> #include <sampgdk/a_samp.h> #include <sampgdk/export.h> #include "fakeamx.h" #include "native.h" #include "timer.h" #include "generated/a_samp-impl.c" SAMPGDK_NATIVE(int, SetTimer(int interval, bool repeat, TimerCallback callback, void *param)) { int timerid; if (timer_set(&timerid, interval, repeat, (timer_callback)callback, param) >= 0) { return timerid + 1; } return 0; } SAMPGDK_NATIVE(bool, KillTimer(int timerid)) { return timer_kill(timerid - 1) >= 0; }
/* Copyright (C) 2011-2012 Zeex * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <sampgdk/config.h> #include <sampgdk/a_samp.h> #include <sampgdk/export.h> #include "fakeamx.h" #include "native.h" #include "timer.h" #include "generated/a_samp-impl.c" SAMPGDK_NATIVE(int, SetTimer(int interval, bool repeat, TimerCallback callback, void *param)) { int timerid; if (timer_set(&timerid, interval, repeat, (timer_callback)callback, param) >= 0) { return timerid; } return -1; } SAMPGDK_NATIVE(bool, KillTimer(int timerid)) { return timer_kill(timerid) >= 0; }
--- +++ @@ -27,11 +27,12 @@ int timerid; if (timer_set(&timerid, interval, repeat, (timer_callback)callback, param) >= 0) { - return timerid; + return timerid + 1; } - return -1; + + return 0; } SAMPGDK_NATIVE(bool, KillTimer(int timerid)) { - return timer_kill(timerid) >= 0; + return timer_kill(timerid - 1) >= 0; }
Make timer ID's start with 1
apache-2.0
Zeex/sampgdk,WopsS/sampgdk,Zeex/sampgdk,WopsS/sampgdk,WopsS/sampgdk,Zeex/sampgdk
32a03501ea2030314b9b610ea0181f1f60bce11e
#include <string.h> #include "number.h" /** Format padding for a signed number. */ unsigned fmt_sign_pad(char* buffer, int sign, unsigned width, char pad) { char* s = buffer; if (buffer == 0) return width + (sign != 0); if (!width) { if (sign) *s++ = '-'; } else { if (pad != '0') { memset(s, pad, width); s += width; } if (sign) *s++ = '-'; if (pad == '0') { memset(s, pad, width); s += width; } } return s - buffer; } #ifdef SELFTEST_MAIN #include "selftest.c" void test(int sign, unsigned width, char pad) { char buf[10]; obuf_putu(&outbuf, fmt_sign_pad(0, sign, width, pad)); obuf_putc(&outbuf, ':'); buf[fmt_sign_pad(buf, sign, width, pad)] = 0; obuf_puts(&outbuf, buf); NL(); } MAIN { test(0, 0, 0); test(1, 0, 0); test(0, 4, 'x'); test(1, 4, 'x'); test(0, 4, '0'); test(1, 4, '0'); } #endif #ifdef SELFTEST_EXP 0: 1:- 4:xxxx 5:xxxx- 4:0000 5:-0000 #endif
#include <string.h> #include "number.h" /** Format padding for a signed number. */ unsigned fmt_sign_pad(char* buffer, int sign, unsigned width, char pad) { char* s = buffer; if (buffer == 0) return width + (sign != 0); if (!width) { if (sign) *s++ = '-'; } else { if (pad != '0') { memset(s, pad, width); s += width; } if (sign) *s++ = '-'; if (pad == '0') { memset(s, pad, width); s += width; } } return s - buffer; } #ifdef SELFTEST_MAIN #include "selftest.c" void test(int sign, unsigned width, char pad) { char buf[10]; buf[fmt_sign_pad(buf, sign, width, pad)] = 0; obuf_puts(&outbuf, buf); NL(); } MAIN { test(0, 0, 0); test(1, 0, 0); test(0, 4, 'x'); test(1, 4, 'x'); test(0, 4, '0'); test(1, 4, '0'); } #endif #ifdef SELFTEST_EXP - xxxx xxxx- 0000 -0000 #endif
--- +++ @@ -31,6 +31,8 @@ void test(int sign, unsigned width, char pad) { char buf[10]; + obuf_putu(&outbuf, fmt_sign_pad(0, sign, width, pad)); + obuf_putc(&outbuf, ':'); buf[fmt_sign_pad(buf, sign, width, pad)] = 0; obuf_puts(&outbuf, buf); NL(); @@ -47,10 +49,10 @@ } #endif #ifdef SELFTEST_EXP - -- -xxxx -xxxx- -0000 --0000 +0: +1:- +4:xxxx +5:xxxx- +4:0000 +5:-0000 #endif
Include the no-buffer length when testing this function.
lgpl-2.1
bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs
c3097e8290c50f7fc67920233a4d4a7a20d68dcb
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
--- +++ @@ -46,11 +46,6 @@ err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); - packet.data[0] = i++; - packet.data[1] = 0x12; - err_code = radio_send(&packet); - ASSUME_SUCCESS(err_code); - led_toggle(LED0); nrf_delay_us(1000000); }
Send only one packet at a time.
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
971068ecfa82cea5b21a3ccc962e95b7cdb5f38d
#ifndef _LOG_SINGLETON_H_ #define _LOG_SINGLETON_H_ #include "log.h" #include "basedefs.h" namespace anp { class LogSingleton: public anp::Log { public: static LogSingleton &getInstance(); static void releaseInstance(); private: LogSingleton() { } ~LogSingleton() { } static uint32 m_refCount; static LogSingleton *m_instance; }; /** Makes sure that LogSingleton::releaseInstance() gets called. */ class LogSingletonHelper { public: LogSingletonHelper(): m_log(LogSingleton::getInstance()) { } ~LogSingletonHelper() { LogSingleton::releaseInstance(); } void addMessage(const anp::dstring &message) { m_log.addMessage(message); } void operator()(const anp::dstring message) { m_log.addMessage(message); } private: LogSingleton &m_log; }; #define LOG_SINGLETON_MSG(message) LogSingleton::getInstance().addMessage(message);\ LogSingleton::releaseInstance(); } #endif // _LOG_SINGLETON_H_
#ifndef _LOG_SINGLETON_H_ #define _LOG_SINGLETON_H_ #include "log.h" #include "basedefs.h" namespace anp { class LogSingleton: public anp::Log { public: static LogSingleton &getInstance(); static void releaseInstance(); private: LogSingleton() { } ~LogSingleton() { } static uint32 m_refCount; static LogSingleton *m_instance; }; /** Makes sure that LogSingleton::releaseInstance() gets called. */ class LogSingletonHelper { public: LogSingletonHelper(): m_log(LogSingleton::getInstance()) { } ~LogSingletonHelper() { LogSingleton::releaseInstance(); } void addMessage(const anp::dstring &message) { m_log.addMessage(message); } private: LogSingleton &m_log; }; } #endif // _LOG_SINGLETON_H_
--- +++ @@ -39,10 +39,18 @@ { m_log.addMessage(message); } + + void operator()(const anp::dstring message) + { + m_log.addMessage(message); + } private: LogSingleton &m_log; }; +#define LOG_SINGLETON_MSG(message) LogSingleton::getInstance().addMessage(message);\ + LogSingleton::releaseInstance(); + } #endif // _LOG_SINGLETON_H_
Add overloaded () operator to LogSingletonHelper.
bsd-2-clause
antonp/anpcode,antonp/anpcode
7d8a38b200cd70bef0300ce482c0723e8d64406b
#include <stdlib.h> #ifndef __QUEUE_H__ #define __QUEUE_H__ struct Queue; typedef struct Queue Queue; Queue* Queue_Create(size_t n); void Queue_Destroy(Queue* q); void Queue_Enqueue(Queue* q, void* e); void* Queue_Dequeue(Queue* q); #endif
#include <stdlib.h> #ifndef __QUEUE_H__ #define __QUEUE_H__ struct Queue; typedef struct Queue Queue; #endif
--- +++ @@ -4,4 +4,8 @@ struct Queue; typedef struct Queue Queue; +Queue* Queue_Create(size_t n); +void Queue_Destroy(Queue* q); +void Queue_Enqueue(Queue* q, void* e); +void* Queue_Dequeue(Queue* q); #endif
Add basic operation function declaration
mit
MaxLikelihood/CADT
82f76d7cbaaa0839555e1054b246a5cc79b6b17d
#ifndef FTS_FILTER_PRIVATE_H #define FTS_FILTER_PRIVATE_H #define FTS_FILTER_CLASSES_NR 3 /* API that stemming providers (classes) must provide: The create() function is called to get an instance of a registered filter class. The filter() function is called with tokens for the specific filter. The destroy function is called to destroy an instance of a filter. */ struct fts_filter_vfuncs { int (*create)(const struct fts_language *lang, const char *const *settings, struct fts_filter **filter_r, const char **error_r); int (*filter)(struct fts_filter *filter, const char **token, const char **error_r); void (*destroy)(struct fts_filter *filter); }; struct fts_filter { const char *class_name; /* name of the class this is based on */ const struct fts_filter_vfuncs *v; int refcount; struct fts_filter *parent; }; #endif
#ifndef FTS_FILTER_PRIVATE_H #define FTS_FILTER_PRIVATE_H #define FTS_FILTER_CLASSES_NR 3 /* API that stemming providers (classes) must provide: The register() function is called when the class is registered via fts_filter_register() The create() function is called to get an instance of a registered filter class. The destroy function is called to destroy an instance of a filter. */ struct fts_filter_vfuncs { int (*create)(const struct fts_language *lang, const char *const *settings, struct fts_filter **filter_r, const char **error_r); int (*filter)(struct fts_filter *filter, const char **token, const char **error_r); void (*destroy)(struct fts_filter *filter); }; struct fts_filter { const char *class_name; /* name of the class this is based on */ const struct fts_filter_vfuncs *v; int refcount; struct fts_filter *parent; }; #endif
--- +++ @@ -4,11 +4,10 @@ #define FTS_FILTER_CLASSES_NR 3 /* - API that stemming providers (classes) must provide: The register() - function is called when the class is registered via - fts_filter_register() The create() function is called to get an - instance of a registered filter class. The destroy function is - called to destroy an instance of a filter. + API that stemming providers (classes) must provide: The create() + function is called to get an instance of a registered filter class. + The filter() function is called with tokens for the specific filter. + The destroy function is called to destroy an instance of a filter. */ struct fts_filter_vfuncs {
lib-fts: Correct comment in filter internal API.
mit
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
965703d6abaaf700e4c5307597b7f298843b0e32
#include <stdio.h> int isMagic(int n,int squere[n][n]) { int currSum = 0; int sum = 0; int i = 0; for(i=0;i<n;i++) { int j; for(j=0;j<n;j++) { currSum+=squere[i][j]; } if(i==0) { sum = currSum; } if(currSum != sum) { return 0; } currSum = 0; } currSum = 0; for(i=0;i<n;i++) { currSum += squere[i][i]; } if(currSum!=sum) { return 0; } currSum = 0; int j; for(i=0,j=n-1;i<n;i++,j--) { currSum += squere[i][j]; } if(currSum!=sum) { return 0; } return 1; } int main() { int n; scanf("%d",&n); int squere[n][n]; int i = 0; for(i=0;i<n;i++) { int j = 0; for(j=0;j<n;j++) { scanf("%d",&squere[i][j]); } } if(isMagic(n,squere)) { printf("Magicheki e\n"); } else { printf("ne e magicheski\n"); } }
#include <stdio.h> int isMagic(int squere[3][3]) { int currSum = 0; int sum = squere[0][0]+squere[0][1]+squere[0][2]; int i = 0; for(i=1;i<3;i++) { int j; for(j=0;j<3;j++) { currSum+=squere[i][j]; } if(currSum != sum) { return 0; } currSum = 0; } currSum = 0; for(i=0;i<3;i++) { currSum += squere[i][i]; } if(currSum!=sum) { return 0; } currSum = 0; int j; for(i=0,j=2;i<3;i++,j--) { currSum += squere[i][j]; } if(currSum!=sum) { return 0; } return 1; } int main() { int squere[3][3]; int i = 0; for(i=0;i<3;i++) { int j = 0; for(j=0;j<3;j++) { scanf("%d",&squere[i][j]); } } if(isMagic(squere)) { printf("Magicheki e\n"); } else { printf("ne e magicheski\n"); } }
--- +++ @@ -1,15 +1,19 @@ #include <stdio.h> -int isMagic(int squere[3][3]) +int isMagic(int n,int squere[n][n]) { int currSum = 0; - int sum = squere[0][0]+squere[0][1]+squere[0][2]; + int sum = 0; int i = 0; - for(i=1;i<3;i++) + for(i=0;i<n;i++) { int j; - for(j=0;j<3;j++) + for(j=0;j<n;j++) { currSum+=squere[i][j]; + } + if(i==0) + { + sum = currSum; } if(currSum != sum) { @@ -18,7 +22,7 @@ currSum = 0; } currSum = 0; - for(i=0;i<3;i++) + for(i=0;i<n;i++) { currSum += squere[i][i]; } @@ -28,7 +32,7 @@ } currSum = 0; int j; - for(i=0,j=2;i<3;i++,j--) + for(i=0,j=n-1;i<n;i++,j--) { currSum += squere[i][j]; } @@ -41,18 +45,20 @@ int main() { - int squere[3][3]; + int n; + scanf("%d",&n); + int squere[n][n]; int i = 0; - for(i=0;i<3;i++) + for(i=0;i<n;i++) { int j = 0; - for(j=0;j<3;j++) + for(j=0;j<n;j++) { scanf("%d",&squere[i][j]); } } - if(isMagic(squere)) + if(isMagic(n,squere)) { printf("Magicheki e\n"); }
Make squere.c to work with nXn
mit
AlexAndreev/po-homework,Georgigt23/po-homework,kriss960/po-homework,VVurbanov/po-homework,ivanmilevtues/po-homework,karakonjel/po-homework,vincho7012/po-homework,Verbo1806/po-homework
f22dcf3b7c3f0c49724cb3bb097cef56543b9523
#ifndef _CHAIR_AFFAIR_NOTE #define _CHAIR_AFFAIR_NOTE #include <inttypes.h> #include <config.h> #include <Arduino.h> typedef struct note_range_t { uint16_t start; uint16_t end; } note_range_t; class Note { public: Note(uint8_t aHue, uint16_t order, uint16_t ledCount); void setHue(uint8_t aHue); uint8_t hue(); void setPlaying(boolean flag); boolean isPlaying(); private: boolean _playing; uint8_t _hue; note_range_t _range; }; #endif
#ifndef _CHAIR_AFFAIR_NOTE #define _CHAIR_AFFAIR_NOTE #include <inttypes.h> #include <config.h> #include <FastLED.h> typedef struct note_range_t { uint16_t start; uint16_t end; } note_range_t; class Note { public: Note(CRGB aColor, uint16_t order, uint16_t ledCount); void setColor(CRGB aColor); private: CRGB _color; note_range_t _range; }; #endif
--- +++ @@ -3,7 +3,7 @@ #include <inttypes.h> #include <config.h> -#include <FastLED.h> +#include <Arduino.h> typedef struct note_range_t { uint16_t start; @@ -12,12 +12,17 @@ class Note { public: - Note(CRGB aColor, uint16_t order, uint16_t ledCount); + Note(uint8_t aHue, uint16_t order, uint16_t ledCount); - void setColor(CRGB aColor); + void setHue(uint8_t aHue); + uint8_t hue(); + + void setPlaying(boolean flag); + boolean isPlaying(); private: - CRGB _color; + boolean _playing; + uint8_t _hue; note_range_t _range; };
Use hue instead of color. Also added a property for activation of the Note
mit
NSBum/lachaise2
f2826431a1cc428fccc352d7af91d4b0b8955a9b
#define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { char* buf = (char*)arg; strcpy(buf, "hello"); return 0; } int main(int argc, char** argv) { // Stack for child. const int STACK_SIZE = 65536; char* stack = malloc(STACK_SIZE); if (!stack) { perror("malloc"); exit(1); } unsigned long flags = 0; if (argc > 1 && !strcmp(argv[1], "vm")) { flags |= CLONE_VM; } char buf[100] = {0}; if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, buf) == -1) { perror("clone"); exit(1); } int status; pid_t pid = waitpid(-1, &status, 0); if (pid == -1) { perror("waitpid"); exit(1); } printf("Child exited. buf = \"%s\"\n", buf); return 0; }
#define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { return 0; } int main(int argc, char** argv) { // Stack for child. const int STACK_SIZE = 65536; char* stack = malloc(STACK_SIZE); if (!stack) { perror("malloc"); exit(1); } unsigned long flags = 0; if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, NULL) == -1) { perror("clone"); exit(1); } int status; pid_t pid = waitpid(-1, &status, 0); if (pid == -1) { perror("waitpid"); exit(1); } printf(" Child PID=%ld\n", (long)pid); return 0; }
--- +++ @@ -8,6 +8,8 @@ #include <unistd.h> static int child_func(void* arg) { + char* buf = (char*)arg; + strcpy(buf, "hello"); return 0; } @@ -22,7 +24,12 @@ } unsigned long flags = 0; - if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, NULL) == -1) { + if (argc > 1 && !strcmp(argv[1], "vm")) { + flags |= CLONE_VM; + } + + char buf[100] = {0}; + if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, buf) == -1) { perror("clone"); exit(1); } @@ -34,7 +41,6 @@ exit(1); } - printf(" Child PID=%ld\n", (long)pid); - + printf("Child exited. buf = \"%s\"\n", buf); return 0; }
Clone with/without VM sample working now
unlicense
eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog
11782c7860ced878fed5db2d68d8c8fe3bdfdd1d
#include <stdlib.h> #include "MatMulC.h" void MatMulC(int rows, int len, double *a, double *bin, double *c) { int i,j,k; double *b = malloc(len * sizeof(double)); // Transpose bin with result in b. for(int n = 0; n < len; n++ ) { b[n] = bin[rows * (n % rows) + (n / rows)]; } for( i = 0; i < rows; i++ ) { for( j = 0; j < rows; j+=2 ) { double sum0 = 0.0; double sum1 = 0.0; for( k = 0; k < rows; k++ ) { sum0 += a[i*rows+k] * b[j*rows + k]; sum1 += a[i*rows+k] * b[(j + 1)*rows + k]; } c[i*rows + j] = sum0; c[i*rows + j+1] = sum1; } } free(b); }
#include <stdlib.h> #include "MatMulC.h" void MatMulC(int rows, int len, double *a, double *b, double *c) { int i,j,k; for( i = 0; i < rows; i++ ) { for( j = 0; j < rows; j+=2 ) { double sum0 = 0.0; double sum1 = 0.0; for( k = 0; k < rows; k++ ) { sum0 += a[i*rows+k] * b[k*rows + j]; sum1 += a[i*rows+k] * b[k*rows + j + 1]; } c[i*rows + j] = sum0; c[i*rows + j+1] = sum1; } } }
--- +++ @@ -1,20 +1,28 @@ #include <stdlib.h> #include "MatMulC.h" -void MatMulC(int rows, int len, double *a, double *b, double *c) +void MatMulC(int rows, int len, double *a, double *bin, double *c) { int i,j,k; + double *b = malloc(len * sizeof(double)); + + // Transpose bin with result in b. + for(int n = 0; n < len; n++ ) { + b[n] = bin[rows * (n % rows) + (n / rows)]; + } for( i = 0; i < rows; i++ ) { for( j = 0; j < rows; j+=2 ) { double sum0 = 0.0; double sum1 = 0.0; for( k = 0; k < rows; k++ ) { - sum0 += a[i*rows+k] * b[k*rows + j]; - sum1 += a[i*rows+k] * b[k*rows + j + 1]; + sum0 += a[i*rows+k] * b[j*rows + k]; + sum1 += a[i*rows+k] * b[(j + 1)*rows + k]; } c[i*rows + j] = sum0; c[i*rows + j+1] = sum1; } } + + free(b); }
Transpose the second matrix in the C reference for MatMul.
bsd-3-clause
emwap/feldspar-compiler,emwap/feldspar-compiler
03aa0b50b157b97af1dbaf93461c4941bc0bbfaa
/** * @file * * @brief tests if compilation works (include and build paths set correct, etc...) * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include <openssl/evp.h> EVP_CIPHER_CTX * nothing (void) { return NULL; } int main (void) { nothing (); return 0; }
/** * @file * * @brief tests if compilation works (include and build paths set correct, etc...) * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include <openssl/evp.h> int main (void) { EVP_CIPHER_CTX * opensslSpecificType; return 0; }
--- +++ @@ -9,8 +9,13 @@ #include <openssl/evp.h> +EVP_CIPHER_CTX * nothing (void) +{ + return NULL; +} + int main (void) { - EVP_CIPHER_CTX * opensslSpecificType; + nothing (); return 0; }
OpenSSL: Fix detection of lib if we use `-Werror` Before this update detecting OpenSSL would fail, if we treated warnings as errors (`-Werror`). The cause of this problem was that compiling `compile_openssl.cpp` produced a warning about an unused variable.
bsd-3-clause
petermax2/libelektra,e1528532/libelektra,petermax2/libelektra,BernhardDenner/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,e1528532/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,e1528532/libelektra,mpranj/libelektra,e1528532/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra
b13325f74d96d7e0a24c6f62b0910d6739835d47
#ifndef __KMS_UTILS_H__ #define __KMS_UTILS_H__ #include <gst/gst.h> #define KMS_DEBUG_PIPE(name) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS( \ GST_BIN(kms_get_pipeline()), \ GST_DEBUG_GRAPH_SHOW_ALL, name); \ GstElement* kms_get_pipeline(); void kms_dynamic_connection(GstElement *orig, GstElement *dest, const gchar *name); GstElement* kms_utils_get_element_for_caps(GstElementFactoryListType type, GstRank rank, const GstCaps *caps, GstPadDirection direction, gboolean subsetonly, const gchar *name); #endif /* __KMS_UTILS_H__ */
#ifndef __KMS_UTILS_H__ #define __KMS_UTILS_H__ #include <gst/gst.h> GstElement* kms_get_pipeline(); void kms_dynamic_connection(GstElement *orig, GstElement *dest, const gchar *name); GstElement* kms_utils_get_element_for_caps(GstElementFactoryListType type, GstRank rank, const GstCaps *caps, GstPadDirection direction, gboolean subsetonly, const gchar *name); #endif /* __KMS_UTILS_H__ */
--- +++ @@ -2,6 +2,10 @@ #define __KMS_UTILS_H__ #include <gst/gst.h> + +#define KMS_DEBUG_PIPE(name) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS( \ + GST_BIN(kms_get_pipeline()), \ + GST_DEBUG_GRAPH_SHOW_ALL, name); \ GstElement* kms_get_pipeline();
Create a macro for pipeline debugging
lgpl-2.1
lulufei/kurento-media-server,shelsonjava/kurento-media-server,shelsonjava/kurento-media-server,mparis/kurento-media-server,todotobe1/kurento-media-server,Kurento/kurento-media-server,Kurento/kurento-media-server,mparis/kurento-media-server,TribeMedia/kurento-media-server,TribeMedia/kurento-media-server,lulufei/kurento-media-server,todotobe1/kurento-media-server
ea154d7d98f4c6d1ded69031ff583b4f4c47118b
#ifndef SQREDIR_BLOCKLIST_H #define SQREDIR_BLOCKLIST_H #include <cstdio> #include <string> // reads the given configuration file // returns: true/false for success/failure bool read_config(std::string filename); // tries to match the Squid request & writes the response to the output stream // input: a request line as passed by Squid // output: response output stream (usually stdout) void match_and_reply(const char* input, FILE* output); #endif
#ifndef SQREDIR_BLOCKLIST_H #define SQREDIR_BLOCKLIST_H #include <cstdio> #include <string> using namespace std; // reads the given configuration file // returns: true/false for success/failure bool read_config(string filename); // tries to match the Squid request & writes the response to the output stream // input: a request line as passed by Squid // output: response output stream (usually stdout) void match_and_reply(const char* input, FILE* output); #endif
--- +++ @@ -5,11 +5,9 @@ #include <cstdio> #include <string> -using namespace std; - // reads the given configuration file // returns: true/false for success/failure -bool read_config(string filename); +bool read_config(std::string filename); // tries to match the Squid request & writes the response to the output stream // input: a request line as passed by Squid
Remove 'using' directive from header, explicitly qualify std namespace.
apache-2.0
hhoffstaette/sqredir
2d67979dc01cb98b74941246685e9853439dd4a8
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_ #define XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_ #include "xwalk/application/browser/application_system.h" namespace xwalk { class DBusManager; } namespace xwalk { namespace application { class ApplicationServiceProviderLinux; class ApplicationSystemLinux : public ApplicationSystem { public: explicit ApplicationSystemLinux(RuntimeContext* runtime_context); virtual ~ApplicationSystemLinux(); DBusManager& dbus_manager(); private: scoped_ptr<DBusManager> dbus_manager_; scoped_ptr<ApplicationServiceProviderLinux> service_provider_; DISALLOW_COPY_AND_ASSIGN(ApplicationSystemLinux); }; } // namespace application } // namespace xwalk #endif // XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_ #define XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_ #include "xwalk/application/browser/application_system.h" namespace xwalk { class DBusManager; } namespace xwalk { namespace application { class ApplicationServiceProviderLinux; class ApplicationSystemLinux : public ApplicationSystem { public: explicit ApplicationSystemLinux(RuntimeContext* runtime_context); virtual ~ApplicationSystemLinux(); DBusManager& dbus_manager(); private: scoped_ptr<ApplicationServiceProviderLinux> service_provider_; scoped_ptr<DBusManager> dbus_manager_; DISALLOW_COPY_AND_ASSIGN(ApplicationSystemLinux); }; } // namespace application } // namespace xwalk #endif // XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_
--- +++ @@ -24,8 +24,8 @@ DBusManager& dbus_manager(); private: + scoped_ptr<DBusManager> dbus_manager_; scoped_ptr<ApplicationServiceProviderLinux> service_provider_; - scoped_ptr<DBusManager> dbus_manager_; DISALLOW_COPY_AND_ASSIGN(ApplicationSystemLinux); };
[Application][D-Bus] Fix crash when shutting down DBusManager owns the Bus connection and was being destroyed before the service provider that uses it. TEST=Loaded xwalk --run-as-service and xwalkctl <APP_ID> then closed the window. The first process should not crash but exit cleanly.
bsd-3-clause
tedshroyer/crosswalk,minggangw/crosswalk,axinging/crosswalk,xzhan96/crosswalk,RafuCater/crosswalk,tedshroyer/crosswalk,stonegithubs/crosswalk,dreamsxin/crosswalk,Bysmyyr/crosswalk,crosswalk-project/crosswalk-efl,siovene/crosswalk,RafuCater/crosswalk,axinging/crosswalk,darktears/crosswalk,chinakids/crosswalk,xzhan96/crosswalk,darktears/crosswalk,ZhengXinCN/crosswalk,dreamsxin/crosswalk,stonegithubs/crosswalk,PeterWangIntel/crosswalk,chuan9/crosswalk,chuan9/crosswalk,fujunwei/crosswalk,chuan9/crosswalk,bestwpw/crosswalk,chuan9/crosswalk,lincsoon/crosswalk,tedshroyer/crosswalk,jpike88/crosswalk,lincsoon/crosswalk,weiyirong/crosswalk-1,huningxin/crosswalk,siovene/crosswalk,amaniak/crosswalk,chinakids/crosswalk,jpike88/crosswalk,qjia7/crosswalk,minggangw/crosswalk,crosswalk-project/crosswalk-efl,bestwpw/crosswalk,shaochangbin/crosswalk,tomatell/crosswalk,jpike88/crosswalk,crosswalk-project/crosswalk-efl,crosswalk-project/crosswalk-efl,minggangw/crosswalk,siovene/crosswalk,tedshroyer/crosswalk,hgl888/crosswalk-efl,marcuspridham/crosswalk,jondong/crosswalk,amaniak/crosswalk,hgl888/crosswalk,siovene/crosswalk,TheDirtyCalvinist/spacewalk,bestwpw/crosswalk,hgl888/crosswalk,weiyirong/crosswalk-1,hgl888/crosswalk,ZhengXinCN/crosswalk,lincsoon/crosswalk,stonegithubs/crosswalk,lincsoon/crosswalk,PeterWangIntel/crosswalk,pk-sam/crosswalk,mrunalk/crosswalk,baleboy/crosswalk,jondwillis/crosswalk,XiaosongWei/crosswalk,RafuCater/crosswalk,DonnaWuDongxia/crosswalk,TheDirtyCalvinist/spacewalk,XiaosongWei/crosswalk,crosswalk-project/crosswalk,zliang7/crosswalk,stonegithubs/crosswalk,shaochangbin/crosswalk,huningxin/crosswalk,TheDirtyCalvinist/spacewalk,lincsoon/crosswalk,shaochangbin/crosswalk,amaniak/crosswalk,qjia7/crosswalk,dreamsxin/crosswalk,myroot/crosswalk,crosswalk-project/crosswalk,zeropool/crosswalk,baleboy/crosswalk,jondwillis/crosswalk,stonegithubs/crosswalk,pk-sam/crosswalk,stonegithubs/crosswalk,fujunwei/crosswalk,tedshroyer/crosswalk,ZhengXinCN/crosswalk,minggangw/crosswalk,zeropool/crosswalk,pk-sam/crosswalk,leonhsl/crosswalk,minggangw/crosswalk,axinging/crosswalk,chuan9/crosswalk,baleboy/crosswalk,hgl888/crosswalk,fujunwei/crosswalk,zeropool/crosswalk,axinging/crosswalk,bestwpw/crosswalk,baleboy/crosswalk,marcuspridham/crosswalk,shaochangbin/crosswalk,dreamsxin/crosswalk,alex-zhang/crosswalk,RafuCater/crosswalk,PeterWangIntel/crosswalk,huningxin/crosswalk,jpike88/crosswalk,hgl888/crosswalk,hgl888/crosswalk-efl,TheDirtyCalvinist/spacewalk,heke123/crosswalk,DonnaWuDongxia/crosswalk,qjia7/crosswalk,marcuspridham/crosswalk,heke123/crosswalk,weiyirong/crosswalk-1,Bysmyyr/crosswalk,myroot/crosswalk,hgl888/crosswalk,rakuco/crosswalk,fujunwei/crosswalk,jondwillis/crosswalk,qjia7/crosswalk,zliang7/crosswalk,amaniak/crosswalk,tomatell/crosswalk,shaochangbin/crosswalk,rakuco/crosswalk,siovene/crosswalk,weiyirong/crosswalk-1,xzhan96/crosswalk,marcuspridham/crosswalk,DonnaWuDongxia/crosswalk,PeterWangIntel/crosswalk,DonnaWuDongxia/crosswalk,chinakids/crosswalk,lincsoon/crosswalk,heke123/crosswalk,pk-sam/crosswalk,rakuco/crosswalk,tomatell/crosswalk,huningxin/crosswalk,siovene/crosswalk,rakuco/crosswalk,jondwillis/crosswalk,darktears/crosswalk,axinging/crosswalk,alex-zhang/crosswalk,zliang7/crosswalk,RafuCater/crosswalk,zeropool/crosswalk,marcuspridham/crosswalk,bestwpw/crosswalk,heke123/crosswalk,lincsoon/crosswalk,hgl888/crosswalk-efl,Bysmyyr/crosswalk,zliang7/crosswalk,jondwillis/crosswalk,TheDirtyCalvinist/spacewalk,crosswalk-project/crosswalk,XiaosongWei/crosswalk,heke123/crosswalk,huningxin/crosswalk,Pluto-tv/crosswalk,hgl888/crosswalk,leonhsl/crosswalk,rakuco/crosswalk,alex-zhang/crosswalk,crosswalk-project/crosswalk,qjia7/crosswalk,Bysmyyr/crosswalk,jpike88/crosswalk,zliang7/crosswalk,minggangw/crosswalk,Pluto-tv/crosswalk,crosswalk-project/crosswalk-efl,axinging/crosswalk,ZhengXinCN/crosswalk,baleboy/crosswalk,tedshroyer/crosswalk,jondong/crosswalk,marcuspridham/crosswalk,baleboy/crosswalk,hgl888/crosswalk-efl,zeropool/crosswalk,marcuspridham/crosswalk,alex-zhang/crosswalk,zeropool/crosswalk,TheDirtyCalvinist/spacewalk,tedshroyer/crosswalk,XiaosongWei/crosswalk,mrunalk/crosswalk,huningxin/crosswalk,Bysmyyr/crosswalk,Pluto-tv/crosswalk,Bysmyyr/crosswalk,chinakids/crosswalk,xzhan96/crosswalk,darktears/crosswalk,marcuspridham/crosswalk,RafuCater/crosswalk,Pluto-tv/crosswalk,amaniak/crosswalk,leonhsl/crosswalk,DonnaWuDongxia/crosswalk,myroot/crosswalk,alex-zhang/crosswalk,mrunalk/crosswalk,xzhan96/crosswalk,crosswalk-project/crosswalk,Bysmyyr/crosswalk,Bysmyyr/crosswalk,tomatell/crosswalk,fujunwei/crosswalk,zliang7/crosswalk,jpike88/crosswalk,fujunwei/crosswalk,pk-sam/crosswalk,zliang7/crosswalk,Pluto-tv/crosswalk,rakuco/crosswalk,tomatell/crosswalk,jondwillis/crosswalk,ZhengXinCN/crosswalk,shaochangbin/crosswalk,bestwpw/crosswalk,XiaosongWei/crosswalk,myroot/crosswalk,siovene/crosswalk,zeropool/crosswalk,dreamsxin/crosswalk,stonegithubs/crosswalk,DonnaWuDongxia/crosswalk,bestwpw/crosswalk,jondong/crosswalk,leonhsl/crosswalk,xzhan96/crosswalk,fujunwei/crosswalk,axinging/crosswalk,jondong/crosswalk,lincsoon/crosswalk,weiyirong/crosswalk-1,darktears/crosswalk,heke123/crosswalk,RafuCater/crosswalk,darktears/crosswalk,minggangw/crosswalk,ZhengXinCN/crosswalk,chinakids/crosswalk,hgl888/crosswalk-efl,leonhsl/crosswalk,leonhsl/crosswalk,qjia7/crosswalk,tomatell/crosswalk,xzhan96/crosswalk,dreamsxin/crosswalk,crosswalk-project/crosswalk,jondwillis/crosswalk,weiyirong/crosswalk-1,darktears/crosswalk,tomatell/crosswalk,crosswalk-project/crosswalk,amaniak/crosswalk,darktears/crosswalk,chuan9/crosswalk,baleboy/crosswalk,crosswalk-project/crosswalk-efl,crosswalk-project/crosswalk,weiyirong/crosswalk-1,Pluto-tv/crosswalk,myroot/crosswalk,myroot/crosswalk,rakuco/crosswalk,rakuco/crosswalk,mrunalk/crosswalk,minggangw/crosswalk,XiaosongWei/crosswalk,ZhengXinCN/crosswalk,jondong/crosswalk,chuan9/crosswalk,heke123/crosswalk,mrunalk/crosswalk,XiaosongWei/crosswalk,crosswalk-project/crosswalk-efl,PeterWangIntel/crosswalk,alex-zhang/crosswalk,jondong/crosswalk,pk-sam/crosswalk,PeterWangIntel/crosswalk,jpike88/crosswalk,jondong/crosswalk,mrunalk/crosswalk,dreamsxin/crosswalk,xzhan96/crosswalk,amaniak/crosswalk,chinakids/crosswalk,DonnaWuDongxia/crosswalk,jondong/crosswalk,PeterWangIntel/crosswalk,heke123/crosswalk,pk-sam/crosswalk,zliang7/crosswalk,hgl888/crosswalk-efl,alex-zhang/crosswalk,hgl888/crosswalk,hgl888/crosswalk-efl,leonhsl/crosswalk,Pluto-tv/crosswalk,baleboy/crosswalk
9be8ac9ad3f94875a9381555d8859f289c59d6df
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE false // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source #define COPYRIGHT_YEAR 2014 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source #define COPYRIGHT_YEAR 2014 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
--- +++ @@ -12,7 +12,7 @@ #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build -#define CLIENT_VERSION_IS_RELEASE true +#define CLIENT_VERSION_IS_RELEASE false // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source
Set client release to false
mit
Electronic-Gulden-Foundation/egulden,Electronic-Gulden-Foundation/egulden,Electronic-Gulden-Foundation/egulden,Electronic-Gulden-Foundation/egulden,Electronic-Gulden-Foundation/egulden,Electronic-Gulden-Foundation/egulden
e3e10e5a788bd65aa65ee133f3740dfc1d91f1eb
#ifndef SCRAPPIE_H #define SCRAPPIE_H #ifdef __cplusplus extern "C" { #endif #include <immintrin.h> #include <stdbool.h> /* Structure definitions from scrappie_structures.h */ typedef struct { double start; float length; float mean, stdv; int pos, state; } event_t; typedef struct { unsigned int n, start, end; event_t * event; } event_table; typedef struct { unsigned int n, start, end; float * raw; } raw_table; /* Matrix definitions from scrappie_matrix.h */ typedef struct { unsigned int nr, nrq, nc; union { __m128 * v; float * f; } data; } _Mat; typedef _Mat * scrappie_matrix; scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log); scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log); scrappie_matrix free_scrappie_matrix(scrappie_matrix mat); #ifdef __cplusplus } #endif #endif /* SCRAPPIE_H */
#ifndef SCRAPPIE_H #define SCRAPPIE_H #ifdef __cplusplus extern "C" { #endif #include <immintrin.h> #include <stdbool.h> /* Structure definitions from fast5_interface.h */ typedef struct { double start; float length; float mean, stdv; int pos, state; } event_t; typedef struct { unsigned int n, start, end; event_t * event; } event_table; typedef struct { unsigned int n, start, end; float * raw; } raw_table; /* Matrix definitions from util.h */ typedef struct { unsigned int nr, nrq, nc; union { __m128 * v; float * f; } data; } _Mat; typedef _Mat * scrappie_matrix; scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log); scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log); scrappie_matrix free_scrappie_matrix(scrappie_matrix mat); #ifdef __cplusplus } #endif #endif /* SCRAPPIE_H */
--- +++ @@ -10,7 +10,7 @@ -/* Structure definitions from fast5_interface.h */ +/* Structure definitions from scrappie_structures.h */ typedef struct { double start; float length; @@ -29,7 +29,7 @@ } raw_table; -/* Matrix definitions from util.h */ +/* Matrix definitions from scrappie_matrix.h */ typedef struct { unsigned int nr, nrq, nc; union {
Update where various definitions have come from
mpl-2.0
nanoporetech/scrappie,nanoporetech/scrappie,nanoporetech/scrappie
42d8167c3ac24b41e625063140bac8ac4ab31da0
#include "types.h" #include "stat.h" #include "user.h" char buf[512]; void cat(int fd) { int n; while((n = read(fd, buf, sizeof(buf))) > 0) { if (write(1, buf, n) != n) { printf(1, "cat: write error\n"); exit(); } } if(n < 0){ printf(1, "cat: read error\n"); exit(); } } int main(int argc, char *argv[]) { int fd, i; if(argc <= 1){ cat(0); exit(); } for(i = 1; i < argc; i++){ if((fd = open(argv[i], 0)) < 0){ printf(1, "cat: cannot open %s\n", argv[i]); exit(); } cat(fd); close(fd); } exit(); }
#include "types.h" #include "stat.h" #include "user.h" char buf[512]; void cat(int fd) { int n; while((n = read(fd, buf, sizeof(buf))) > 0) write(1, buf, n); if(n < 0){ printf(1, "cat: read error\n"); exit(); } } int main(int argc, char *argv[]) { int fd, i; if(argc <= 1){ cat(0); exit(); } for(i = 1; i < argc; i++){ if((fd = open(argv[i], 0)) < 0){ printf(1, "cat: cannot open %s\n", argv[i]); exit(); } cat(fd); close(fd); } exit(); }
--- +++ @@ -9,8 +9,12 @@ { int n; - while((n = read(fd, buf, sizeof(buf))) > 0) - write(1, buf, n); + while((n = read(fd, buf, sizeof(buf))) > 0) { + if (write(1, buf, n) != n) { + printf(1, "cat: write error\n"); + exit(); + } + } if(n < 0){ printf(1, "cat: read error\n"); exit();
Check result of write (thans to Alexander Kapshuk <alexander.kapshuk@gmail)
mit
shyandsy/xv6,shyandsy/xv6,shyandsy/xv6,ManaPoustizadeh/OS-finalProject,shyandsy/xv6,ManaPoustizadeh/OS-finalProject,gw/xv6,phf/xv6-public,voytovichs/xv6-public,voytovichs/xv6-public,ManaPoustizadeh/OS-finalProject,voytovichs/xv6-public,gw/xv6,phf/xv6-public,voytovichs/xv6-public,voytovichs/xv6-public,phf/xv6-public,phf/xv6-public,ManaPoustizadeh/OS-finalProject,gw/xv6,gw/xv6,gw/xv6,shyandsy/xv6
89826f41bd5c96e6b13692d03d08049c912b9365
#ifndef LBS_COMMON_H #define LBS_COMMON_H #include <stddef.h> #ifdef __STDC_VERSION__ # include <stdbool.h> # if __STDC_VERSION__ >= 201112L # define LBS_COMMON_ISO_C11 # define LBS_COMMON_CHECK_TYPE(x,type) (_Generic ((x), type: (x))) # else # define LBS_COMMON_ISO_C99 # define LBS_COMMON_CHECK_TYPE(x,type) (x) # endif #else # define bool char # define true 1 # define false 0 # define inline # define LBS_COMMON_ISO_C89 # define LBS_COMMON_CHECK_TYPE(x,type) (x) #endif /* __STDC_VERSION__ */ #define LBS_COMMON_NULL_PTR ((void*)NULL) #define LBS_COMMON_DEFINE_GETTER(ns,xt,m,mt) \ static inline mt ns ## _get_ ## m (xt x) { \ return x->m; \ } #define LBS_COMMON_DEFINE_SETTER(ns,xt,m,mt) \ static inline void ns ## _set_ ## m (xt x, mt v) { \ x->m = v; \ } #endif /* LBS_COMMON_H */
#ifndef LBS_COMMON_H #define LBS_COMMON_H #include <stddef.h> #ifdef __STDC_VERSION__ # include <stdbool.h> # if __STDC_VERSION__ >= 201112L # define LBS_COMMON_ISO_C11 # define LBS_COMMON_CHECK_TYPE(x,type) (_Generic ((x), type: (x))) # else # define LBS_COMMON_ISO_C99 # define LBS_COMMON_CHECK_TYPE(x,type) (x) # endif #else # define bool char # define true 1 # define false 0 # define LBS_COMMON_ISO_C89 # define LBS_COMMON_CHECK_TYPE(x,type) (x) #endif /* __STDC_VERSION__ */ #define LBS_COMMON_NULL_PTR ((void*)NULL) #endif /* LBS_COMMON_H */
--- +++ @@ -16,10 +16,19 @@ # define bool char # define true 1 # define false 0 +# define inline # define LBS_COMMON_ISO_C89 # define LBS_COMMON_CHECK_TYPE(x,type) (x) #endif /* __STDC_VERSION__ */ #define LBS_COMMON_NULL_PTR ((void*)NULL) +#define LBS_COMMON_DEFINE_GETTER(ns,xt,m,mt) \ + static inline mt ns ## _get_ ## m (xt x) { \ + return x->m; \ + } +#define LBS_COMMON_DEFINE_SETTER(ns,xt,m,mt) \ + static inline void ns ## _set_ ## m (xt x, mt v) { \ + x->m = v; \ + } #endif /* LBS_COMMON_H */
Add macros to define getters and setters
bsd-3-clause
lantw44/l4basic,lantw44/l4basic
dc258e02720308981a4f8a2e4848c582c1b71123
/* * types.h * Ansilove 4.1.0 * https://www.ansilove.org * * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * Ansilove is licensed under the BSD 2-Clause License. * See LICENSE file for details. */ #ifndef TYPES_H #define TYPES_H #define ANSILOVE_FILETYPE_ANS 1 #define ANSILOVE_FILETYPE_ADF 2 #define ANSILOVE_FILETYPE_BIN 3 #define ANSILOVE_FILETYPE_IDF 4 #define ANSILOVE_FILETYPE_PCB 5 #define ANSILOVE_FILETYPE_TND 6 #define ANSILOVE_FILETYPE_XB 7 struct ansilove_ctx; struct ansilove_options; extern char *types[]; extern int filetypes[]; extern int (*loaders[])(struct ansilove_ctx *, struct ansilove_options *); #endif /* TYPES_H */
/* * types.h * Ansilove 4.1.0 * https://www.ansilove.org * * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * Ansilove is licensed under the BSD 2-Clause License. * See LICENSE file for details. */ #ifndef TYPES_H #define TYPES_H #define ANSILOVE_FILETYPE_ANS 1 #define ANSILOVE_FILETYPE_ADF 2 #define ANSILOVE_FILETYPE_BIN 3 #define ANSILOVE_FILETYPE_IDF 4 #define ANSILOVE_FILETYPE_PCB 5 #define ANSILOVE_FILETYPE_TND 6 #define ANSILOVE_FILETYPE_XB 7 extern char *types[]; extern int filetypes[]; extern int (*loaders[])(struct ansilove_ctx *, struct ansilove_options *); #endif /* TYPES_H */
--- +++ @@ -21,6 +21,9 @@ #define ANSILOVE_FILETYPE_TND 6 #define ANSILOVE_FILETYPE_XB 7 +struct ansilove_ctx; +struct ansilove_options; + extern char *types[]; extern int filetypes[]; extern int (*loaders[])(struct ansilove_ctx *, struct ansilove_options *);
Add forward declarations for ansilove_ctx and ansilove_options structs.
bsd-2-clause
ansilove/ansilove,ansilove/AnsiLove-C
1e88990b7b2b4bfc9999b79a78a08e7decf7e416
#include "stdio.h" #include "stdlib.h" #include "sys/time.h" #define TRIALS 4 #define MATRIX_SIZE 2048 short A[MATRIX_SIZE][MATRIX_SIZE], B[MATRIX_SIZE][MATRIX_SIZE], C[MATRIX_SIZE][MATRIX_SIZE] = {{0}}; int main(int argc, char* argv[]) { // Initalize array A and B with '1's for (int i = 0; i < MATRIX_SIZE; ++i) for (int k = 0; k < MATRIX_SIZE; ++k) A[i][k] = B[i][k] = 1; // Show headings for (int trial = 0; trial < TRIALS; ++trial) printf(" run%d ,", trial); puts(" avrg "); // Iterate through the block sizes for (int block_size = 4; block_size <= 256; block_size *= 2) { // Keep track of the times for this block time_t block_times[TRIALS]; // Run TRIALS number of trials for each block size for (int trial = 0; trial < TRIALS; ++trial) { struct timeval time_start; gettimeofday(&time_start, NULL); // Do work.. struct timeval time_end; gettimeofday(&time_end, NULL); // Keep track of the time to do statistics on block_times[trial] = time_end.tv_usec - time_start.tv_usec; printf("%06d,", (int) block_times[trial]); } int average = 0; for (int i = 0; i < TRIALS; ++i) average += (int) block_times[i]; printf("%06d\n", average / TRIALS); } return 0; }
#include "stdio.h" #include "stdlib.h" #define TRIALS 4 #define MATRIX_SIZE 2048 short A[MATRIX_SIZE][MATRIX_SIZE], B[MATRIX_SIZE][MATRIX_SIZE], C[MATRIX_SIZE][MATRIX_SIZE] = {{0}}; int main(int argc, char* argv[]) { // Initalize array A and B with '1's for (int i = 0; i < MATRIX_SIZE; ++i) for (int k = 0; k < MATRIX_SIZE; ++k) A[i][k] = B[i][k] = 1; // Iterate through the block sizes for (int block_size = 4; block_size <= 256; block_size *= 2) { // Run TRIALS number of trials for each block size for (int trial = 0; trial < TRIALS; ++trial) { printf("size: %d\n", block_size); } } return 0; }
--- +++ @@ -1,5 +1,6 @@ #include "stdio.h" #include "stdlib.h" +#include "sys/time.h" #define TRIALS 4 #define MATRIX_SIZE 2048 @@ -15,14 +16,40 @@ for (int k = 0; k < MATRIX_SIZE; ++k) A[i][k] = B[i][k] = 1; + // Show headings + for (int trial = 0; trial < TRIALS; ++trial) + printf(" run%d ,", trial); + puts(" avrg "); + // Iterate through the block sizes for (int block_size = 4; block_size <= 256; block_size *= 2) { + // Keep track of the times for this block + time_t block_times[TRIALS]; + // Run TRIALS number of trials for each block size for (int trial = 0; trial < TRIALS; ++trial) { - printf("size: %d\n", block_size); + struct timeval time_start; + gettimeofday(&time_start, NULL); + + + // Do work.. + + + struct timeval time_end; + gettimeofday(&time_end, NULL); + + // Keep track of the time to do statistics on + block_times[trial] = time_end.tv_usec - time_start.tv_usec; + printf("%06d,", (int) block_times[trial]); } + + int average = 0; + for (int i = 0; i < TRIALS; ++i) + average += (int) block_times[i]; + + printf("%06d\n", average / TRIALS); } return 0;
Add timing and formating for times
mit
EvanPurkhiser/CS-Matrix-Multiplication
ea1cb775db1666406796f506da0fa98e21dccbad
#include "sim-hab.h" #include <stdlib.h> int poll_arduino() { char response[256]; uint32_t content; bionet_resource_t *res; bionet_node_t *node; node = bionet_hab_get_node_by_index(hab, 0); // send command 100. requests analog0's value // read value and set resource arduino_write(100); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 24); bionet_resource_set_uint32(res, content, NULL); // send command 101. requests analog1's value // read value and set resource arduino_write(101); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 25); bionet_resource_set_uint32(res, content, NULL); // send command 200. requests the 8 digital values // read values and set resource arduino_write(200); arduino_read_until(response, '\n'); for(int i=0; i<8; i++) { content = atoi(&response[i]); res = bionet_node_get_resource_by_index(node, 16+i); bionet_resource_set_binary(res, content, NULL); } // report new data hab_report_datapoints(node); return 1; }
#include "sim-hab.h" #include <stdlib.h> int poll_arduino() { char response[256]; uint32_t content; bionet_resource_t *res; bionet_node_t *node; node = bionet_hab_get_node_by_index(hab, 0); // send command 100. requests analog0's value // read value and set resource arduino_write(100); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 24); bionet_resource_set_uint32(res, content, NULL); // send command 101. requests analog1's value // read value and set resource arduino_write(101); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 25); bionet_resource_set_uint32(res, content, NULL); // testing arduino_write(200); arduino_read_until(response, '\n'); content = atoi(response); printf("digital 0: %d\n", content); // report new data hab_report_datapoints(node); return 1; }
--- +++ @@ -27,11 +27,16 @@ res = bionet_node_get_resource_by_index(node, 25); bionet_resource_set_uint32(res, content, NULL); - // testing + // send command 200. requests the 8 digital values + // read values and set resource arduino_write(200); arduino_read_until(response, '\n'); - content = atoi(response); - printf("digital 0: %d\n", content); + for(int i=0; i<8; i++) + { + content = atoi(&response[i]); + res = bionet_node_get_resource_by_index(node, 16+i); + bionet_resource_set_binary(res, content, NULL); + } // report new data hab_report_datapoints(node);
Modify sim-hab so that the digital inputs are accounted for.
lgpl-2.1
ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead
278ef644709f6e05938be329941e4cc2207dae41
@interface NSData (ImageMIMEDetection) /** Try to deduce the MIME type. @return string representation of detected MIME type. `nil` if not able to detect the MIME type. @see http://en.wikipedia.org/wiki/Internet_media_type */ - (NSString *)tdt_MIMEType; @end
@interface NSData (ImageMIMEDetection) @end
--- +++ @@ -1,4 +1,14 @@ @interface NSData (ImageMIMEDetection) +/** + Try to deduce the MIME type. + + @return string representation of detected MIME type. `nil` if not able to + detect the MIME type. + + @see http://en.wikipedia.org/wiki/Internet_media_type + */ +- (NSString *)tdt_MIMEType; + @end
Add interface for the category
bsd-3-clause
talk-to/NSData-TDTImageMIMEDetection
3679a62c59dde625a18416f15aadaa6845bc8cfd
#define TEST_NAME "auth" #include "cmptest.h" /* "Test Case 2" from RFC 4231 */ unsigned char key[32] = "Jefe"; unsigned char c[] = "what do ya want for nothing?"; unsigned char a[32]; int main(void) { int i; crypto_auth(a,c,sizeof c - 1U,key); for (i = 0;i < 32;++i) { printf(",0x%02x",(unsigned int) a[i]); if (i % 8 == 7) printf("\n"); } assert(crypto_auth_bytes() > 0U); assert(crypto_auth_keybytes() > 0U); assert(strcmp(crypto_auth_primitive(), "hmacsha512256") == 0); assert(crypto_auth_hmacsha512256_bytes() > 0U); assert(crypto_auth_hmacsha512256_keybytes() > 0U); return 0; }
#define TEST_NAME "auth" #include "cmptest.h" /* "Test Case 2" from RFC 4231 */ unsigned char key[32] = "Jefe"; unsigned char c[] = "what do ya want for nothing?"; unsigned char a[32]; int main(void) { int i; crypto_auth(a,c,sizeof c - 1U,key); for (i = 0;i < 32;++i) { printf(",0x%02x",(unsigned int) a[i]); if (i % 8 == 7) printf("\n"); } assert(crypto_auth_bytes() > 0U); assert(crypto_auth_keybytes() > 0U); assert(strcmp(crypto_auth_primitive(), "hmacsha512256") == 0); return 0; }
--- +++ @@ -20,6 +20,8 @@ assert(crypto_auth_bytes() > 0U); assert(crypto_auth_keybytes() > 0U); assert(strcmp(crypto_auth_primitive(), "hmacsha512256") == 0); + assert(crypto_auth_hmacsha512256_bytes() > 0U); + assert(crypto_auth_hmacsha512256_keybytes() > 0U); return 0; }
Test the presence of some extra functions
isc
rustyhorde/libsodium,SpiderOak/libsodium,netroby/libsodium,JackWink/libsodium,Payshares/libsodium,eburkitt/libsodium,netroby/libsodium,akkakks/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,zhuqling/libsodium,rustyhorde/libsodium,pyparallel/libsodium,paragonie-scott/libsodium,eburkitt/libsodium,akkakks/libsodium,GreatFruitOmsk/libsodium,kytvi2p/libsodium,pmienk/libsodium,mvduin/libsodium,pyparallel/libsodium,akkakks/libsodium,Payshares/libsodium,mvduin/libsodium,donpark/libsodium,JackWink/libsodium,optedoblivion/android_external_libsodium,SpiderOak/libsodium,JackWink/libsodium,tml/libsodium,rustyhorde/libsodium,tml/libsodium,Payshare/libsodium,kytvi2p/libsodium,mvduin/libsodium,pyparallel/libsodium,Payshare/libsodium,eburkitt/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,HappyYang/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,zhuqling/libsodium,GreatFruitOmsk/libsodium,HappyYang/libsodium,donpark/libsodium,optedoblivion/android_external_libsodium,Payshare/libsodium,soumith/libsodium,GreatFruitOmsk/libsodium,HappyYang/libsodium,paragonie-scott/libsodium,soumith/libsodium,kytvi2p/libsodium,akkakks/libsodium,SpiderOak/libsodium,paragonie-scott/libsodium,Payshares/libsodium,SpiderOak/libsodium,optedoblivion/android_external_libsodium,netroby/libsodium,pmienk/libsodium,rustyhorde/libsodium,zhuqling/libsodium,pmienk/libsodium,tml/libsodium,donpark/libsodium,soumith/libsodium
b7b0436fb866c5a19769458d47c72a0d2c55f8c0
/** * \file express_tests.h * \date Jul 4, 2009 * \author anton * \details */ #ifndef EXPRESS_TESTS_H_ #define EXPRESS_TESTS_H_ typedef struct _EXPRESS_TEST_DESCRIPTOR { const char *name; int (*exec)(); } EXPRESS_TEST_DESCRIPTOR; /* #define REGISTER_EXPRESS_TEST(descr) static void _register_express_test(){ \ __asm__( \ ".section .express_tests\n\t" \ ".word %0\n\t" \ ".text\n" \ : :"i"(&descr)); \ } #define DECLARE_EXPRESS_TEST(name, exec) \ static int exec(); \ static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \ REGISTER_EXPRESS_TEST(_descriptor); */ #define DECLARE_EXPRESS_TEST(name, exec) \ static int exec(); \ static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \ static const EXPRESS_TEST_DESCRIPTOR *_pdescriptor __attribute__ ((section(".express_tests"))) = &_descriptor; int express_tests_execute(); #endif /* EXPRESS_TESTS_H_ */
/** * \file express_tests.h * \date Jul 4, 2009 * \author anton * \details */ #ifndef EXPRESS_TESTS_H_ #define EXPRESS_TESTS_H_ typedef struct _EXPRESS_TEST_DESCRIPTOR { const char *name; int (*exec)(); } EXPRESS_TEST_DESCRIPTOR; #define REGISTER_EXPRESS_TEST(descr) static void _register_express_test(){ \ __asm__( \ ".section .express_tests\n\t" \ ".word %0\n\t" \ ".text\n" \ : :"i"(&descr)); \ } #define DECLARE_EXPRESS_TEST(name, exec) \ static int exec(); \ static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \ REGISTER_EXPRESS_TEST(_descriptor); int express_tests_execute(); #endif /* EXPRESS_TESTS_H_ */
--- +++ @@ -12,6 +12,7 @@ int (*exec)(); } EXPRESS_TEST_DESCRIPTOR; +/* #define REGISTER_EXPRESS_TEST(descr) static void _register_express_test(){ \ __asm__( \ ".section .express_tests\n\t" \ @@ -24,6 +25,12 @@ static int exec(); \ static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \ REGISTER_EXPRESS_TEST(_descriptor); +*/ + +#define DECLARE_EXPRESS_TEST(name, exec) \ + static int exec(); \ + static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \ + static const EXPRESS_TEST_DESCRIPTOR *_pdescriptor __attribute__ ((section(".express_tests"))) = &_descriptor; int express_tests_execute();
Change declaration express test macros
bsd-2-clause
vrxfile/embox-trik,vrxfile/embox-trik,vrxfile/embox-trik,Kefir0192/embox,Kefir0192/embox,embox/embox,Kakadu/embox,vrxfile/embox-trik,abusalimov/embox,Kefir0192/embox,mike2390/embox,mike2390/embox,gzoom13/embox,Kakadu/embox,gzoom13/embox,Kakadu/embox,Kakadu/embox,Kakadu/embox,abusalimov/embox,mike2390/embox,abusalimov/embox,vrxfile/embox-trik,embox/embox,mike2390/embox,Kakadu/embox,abusalimov/embox,abusalimov/embox,embox/embox,gzoom13/embox,mike2390/embox,gzoom13/embox,Kefir0192/embox,Kefir0192/embox,abusalimov/embox,Kefir0192/embox,gzoom13/embox,vrxfile/embox-trik,mike2390/embox,gzoom13/embox,embox/embox,vrxfile/embox-trik,embox/embox,Kakadu/embox,gzoom13/embox,embox/embox,mike2390/embox,Kefir0192/embox
e2c7691081b857651a031bf66e42dc1735d6b0a4
#ifndef LOGSMODEL #define LOGSMODEL #include <QString> #include <QFile> #include <QDir> #include <QDebug> #include <QTextStream> #include <QStandardPaths> #include "../Helpers/constants.h" namespace Models { class LogsModel : public QObject { Q_OBJECT public: Q_INVOKABLE QString getAllLogsText() { QString result; #ifdef QT_NO_DEBUG QDir logFileDir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)); QString logFilePath = logFileDir.filePath(Constants::LOG_FILENAME); QFile f(logFilePath); if (f.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in(&f); result = in.readAll(); } #else result = "Logs are available in Release version"; #endif return result; } }; } #endif // LOGSMODEL
#ifndef LOGSMODEL #define LOGSMODEL #include <QString> #include <QFile> #include <QDir> #include <QDebug> #include <QTextStream> #include <QStandardPaths> #include "Helpers/constants.h" namespace Models { class LogsModel : public QObject { Q_OBJECT public: Q_INVOKABLE QString getAllLogsText() { QString result; #ifdef QT_NO_DEBUG QDir logFileDir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)); QString logFilePath = logFileDir.filePath(Constants::LOG_FILENAME); QFile f(logFilePath); if (f.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in(&f); result = in.readAll(); } #else result = "Logs are available in Release version"; #endif return result; } }; } #endif // LOGSMODEL
--- +++ @@ -7,7 +7,7 @@ #include <QDebug> #include <QTextStream> #include <QStandardPaths> -#include "Helpers/constants.h" +#include "../Helpers/constants.h" namespace Models { class LogsModel : public QObject {
Fix for compilation in Windows
mpl-2.0
Ribtoks/xpiks,Artiom-M/xpiks,Ribtoks/xpiks,Ribtoks/xpiks,Ribtoks/xpiks,Artiom-M/xpiks,Artiom-M/xpiks,Artiom-M/xpiks
4cb0d352ed7208fc9ac71b006dcb1b0ff8d65ca2
#include "fitz_base.h" void * fz_malloc(int n) { void *p = malloc(n); if (!p) fz_throw("cannot malloc %d bytes", n); return p; } void * fz_realloc(void *p, int n) { void *np = realloc(p, n); if (np == nil) fz_throw("cannot realloc %d bytes", n); return np; } void fz_free(void *p) { free(p); } char * fz_strdup(char *s) { char *ns = strdup(s); if (!ns) fz_throw("cannot strdup %lu bytes", (unsigned long)strlen(s) + 1); return ns; }
#include "fitz_base.h" void * fz_malloc(int n) { void *p = malloc(n); if (!p) fz_throw("cannot malloc %d bytes", n); return p; } void * fz_realloc(void *p, int n) { void *np = realloc(p, n); if (np == nil) fz_throw("cannot realloc %d bytes", n); return np; } void fz_free(void *p) { free(p); } char * fz_strdup(char *s) { char *ns = strdup(s); if (!ns) fz_throw("cannot strdup %d bytes", strlen(s) + 1); return ns; }
--- +++ @@ -25,7 +25,7 @@ { char *ns = strdup(s); if (!ns) - fz_throw("cannot strdup %d bytes", strlen(s) + 1); + fz_throw("cannot strdup %lu bytes", (unsigned long)strlen(s) + 1); return ns; }
Use the correct format specifier for size_t in fz_strdup. Prior to this patch, if the strdup failed, it would throw an error printing the number of bytes that could not be allocated. However, this was formatted as an int, while the actual argument passed is the return value of strdup itself, which is usually a size_t. This patch formats instead as an unsigned long, and adds a cast to ensure the types match even on platforms where this isn't already the case.
agpl-3.0
isavin/humblepdf,clchiou/mupdf,muennich/mupdf,michaelcadilhac/pdfannot,seagullua/MuPDF,tribals/mupdf,lustersir/MuPDF,loungeup/mupdf,nqv/mupdf,PuzzleFlow/mupdf,hjiayz/forkmupdf,robamler/mupdf-nacl,benoit-pierre/mupdf,tophyr/mupdf,xiangxw/mupdf,hackqiang/mupdf,Kalp695/mupdf,MokiMobility/muPDF,zeniko/mupdf,robamler/mupdf-nacl,PuzzleFlow/mupdf,lolo32/mupdf-mirror,PuzzleFlow/mupdf,loungeup/mupdf,FabriceSalvaire/mupdf-cmake,issuestand/mupdf,loungeup/mupdf,ziel/mupdf,MokiMobility/muPDF,seagullua/MuPDF,ziel/mupdf,FabriceSalvaire/mupdf-v1.3,benoit-pierre/mupdf,Kalp695/mupdf,andyhan/mupdf,TamirEvan/mupdf,michaelcadilhac/pdfannot,andyhan/mupdf,asbloomf/mupdf,issuestand/mupdf,hjiayz/forkmupdf,robamler/mupdf-nacl,ziel/mupdf,knielsen/mupdf,FabriceSalvaire/mupdf-cmake,nqv/mupdf,lustersir/MuPDF,nqv/mupdf,wild0/opened_mupdf,derek-watson/mupdf,flipstudio/MuPDF,michaelcadilhac/pdfannot,ccxvii/mupdf,knielsen/mupdf,poor-grad-student/mupdf,derek-watson/mupdf,benoit-pierre/mupdf,muennich/mupdf,PuzzleFlow/mupdf,clchiou/mupdf,github201407/MuPDF,kobolabs/mupdf,samturneruk/mupdf_secure_android,muennich/mupdf,github201407/MuPDF,kobolabs/mupdf,knielsen/mupdf,zeniko/mupdf,zeniko/mupdf,tribals/mupdf,clchiou/mupdf,kobolabs/mupdf,flipstudio/MuPDF,cgogolin/penandpdf,clchiou/mupdf,andyhan/mupdf,poor-grad-student/mupdf,xiangxw/mupdf,ccxvii/mupdf,poor-grad-student/mupdf,ArtifexSoftware/mupdf,ArtifexSoftware/mupdf,seagullua/MuPDF,Kalp695/mupdf,seagullua/MuPDF,ziel/mupdf,issuestand/mupdf,FabriceSalvaire/mupdf-cmake,tophyr/mupdf,Kalp695/mupdf,geetakaur/NewApps,lustersir/MuPDF,isavin/humblepdf,benoit-pierre/mupdf,FabriceSalvaire/mupdf-v1.3,TamirEvan/mupdf,samturneruk/mupdf_secure_android,robamler/mupdf-nacl,PuzzleFlow/mupdf,andyhan/mupdf,Kalp695/mupdf,seagullua/MuPDF,geetakaur/NewApps,wzhsunn/mupdf,clchiou/mupdf,PuzzleFlow/mupdf,fluks/mupdf-x11-bookmarks,tophyr/mupdf,hxx0215/MuPDFMirror,Kalp695/mupdf,knielsen/mupdf,issuestand/mupdf,crow-misia/mupdf,TamirEvan/mupdf,wild0/opened_mupdf,muennich/mupdf,andyhan/mupdf,lustersir/MuPDF,tribals/mupdf,xiangxw/mupdf,crow-misia/mupdf,cgogolin/penandpdf,wild0/opened_mupdf,tophyr/mupdf,samturneruk/mupdf_secure_android,sebras/mupdf,xiangxw/mupdf,lamemate/mupdf,andyhan/mupdf,wild0/opened_mupdf,TamirEvan/mupdf,hackqiang/mupdf,ArtifexSoftware/mupdf,ylixir/mupdf,ziel/mupdf,derek-watson/mupdf,tribals/mupdf,ArtifexSoftware/mupdf,flipstudio/MuPDF,fluks/mupdf-x11-bookmarks,seagullua/MuPDF,knielsen/mupdf,lamemate/mupdf,michaelcadilhac/pdfannot,github201407/MuPDF,github201407/MuPDF,isavin/humblepdf,sebras/mupdf,ccxvii/mupdf,TamirEvan/mupdf,tribals/mupdf,FabriceSalvaire/mupdf-cmake,wzhsunn/mupdf,crow-misia/mupdf,kobolabs/mupdf,fluks/mupdf-x11-bookmarks,flipstudio/MuPDF,kobolabs/mupdf,ziel/mupdf,asbloomf/mupdf,asbloomf/mupdf,Kalp695/mupdf,flipstudio/MuPDF,cgogolin/penandpdf,kobolabs/mupdf,ylixir/mupdf,lolo32/mupdf-mirror,hackqiang/mupdf,geetakaur/NewApps,isavin/humblepdf,wzhsunn/mupdf,lolo32/mupdf-mirror,wild0/opened_mupdf,sebras/mupdf,wzhsunn/mupdf,poor-grad-student/mupdf,hxx0215/MuPDFMirror,geetakaur/NewApps,lolo32/mupdf-mirror,samturneruk/mupdf_secure_android,ylixir/mupdf,geetakaur/NewApps,derek-watson/mupdf,xiangxw/mupdf,derek-watson/mupdf,derek-watson/mupdf,ylixir/mupdf,lamemate/mupdf,lolo32/mupdf-mirror,issuestand/mupdf,isavin/humblepdf,lolo32/mupdf-mirror,hxx0215/MuPDFMirror,ArtifexSoftware/mupdf,lustersir/MuPDF,FabriceSalvaire/mupdf-cmake,tophyr/mupdf,MokiMobility/muPDF,hxx0215/MuPDFMirror,zeniko/mupdf,michaelcadilhac/pdfannot,tophyr/mupdf,loungeup/mupdf,ArtifexSoftware/mupdf,wzhsunn/mupdf,robamler/mupdf-nacl,TamirEvan/mupdf,kobolabs/mupdf,ArtifexSoftware/mupdf,ccxvii/mupdf,github201407/MuPDF,TamirEvan/mupdf,hjiayz/forkmupdf,nqv/mupdf,FabriceSalvaire/mupdf-v1.3,hackqiang/mupdf,fluks/mupdf-x11-bookmarks,fluks/mupdf-x11-bookmarks,loungeup/mupdf,asbloomf/mupdf,michaelcadilhac/pdfannot,ylixir/mupdf,crow-misia/mupdf,cgogolin/penandpdf,hjiayz/forkmupdf,PuzzleFlow/mupdf,isavin/humblepdf,ccxvii/mupdf,sebras/mupdf,loungeup/mupdf,poor-grad-student/mupdf,FabriceSalvaire/mupdf-v1.3,clchiou/mupdf,samturneruk/mupdf_secure_android,hackqiang/mupdf,lamemate/mupdf,ccxvii/mupdf,asbloomf/mupdf,wild0/opened_mupdf,samturneruk/mupdf_secure_android,xiangxw/mupdf,nqv/mupdf,isavin/humblepdf,github201407/MuPDF,MokiMobility/muPDF,tribals/mupdf,knielsen/mupdf,lolo32/mupdf-mirror,wzhsunn/mupdf,muennich/mupdf,FabriceSalvaire/mupdf-v1.3,crow-misia/mupdf,robamler/mupdf-nacl,poor-grad-student/mupdf,sebras/mupdf,benoit-pierre/mupdf,muennich/mupdf,hackqiang/mupdf,hjiayz/forkmupdf,ArtifexSoftware/mupdf,nqv/mupdf,fluks/mupdf-x11-bookmarks,MokiMobility/muPDF,asbloomf/mupdf,ylixir/mupdf,FabriceSalvaire/mupdf-v1.3,sebras/mupdf,hxx0215/MuPDFMirror,flipstudio/MuPDF,crow-misia/mupdf,xiangxw/mupdf,hxx0215/MuPDFMirror,zeniko/mupdf,wild0/opened_mupdf,issuestand/mupdf,lamemate/mupdf,cgogolin/penandpdf,hjiayz/forkmupdf,lustersir/MuPDF,fluks/mupdf-x11-bookmarks,zeniko/mupdf,geetakaur/NewApps,TamirEvan/mupdf,lamemate/mupdf,cgogolin/penandpdf,muennich/mupdf,FabriceSalvaire/mupdf-cmake,benoit-pierre/mupdf,MokiMobility/muPDF
66b0664aa1347df44ff7a5a7aa5b35d07df54ea5
// RUN: %clang_cc1 -E -verify -fms-compatibility %s #import "pp-record.h" // expected-error {{#import of type library is an unsupported Microsoft feature}} // Test attributes #import "pp-record.h" no_namespace, auto_rename // expected-error {{#import of type library is an unsupported Microsoft feature}} #import "pp-record.h" no_namespace \ auto_rename \ auto_search // expected-error@-3 {{#import of type library is an unsupported Microsoft feature}}
// RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:100:2: error: #import of type library is an unsupported Microsoft feature' // RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:200:2: error: #import of type library is an unsupported Microsoft feature' // RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:300:2: error: #import of type library is an unsupported Microsoft feature' #line 100 "doh.c" #import "pp-record.h" // expected-error {{#import of type library is an unsupported Microsoft feature}} // Test attributes #line 200 "doh.c" #import "pp-record.h" no_namespace, auto_rename // expected-error {{#import of type library is an unsupported Microsoft feature}} // This will also fire the "#import of type library is an unsupported Microsoft feature" // error, but we can't use -verify because there's no way to put the comment on the proper line #line 300 "doh.c" #import "pp-record.h" no_namespace \ auto_rename \ auto_search
--- +++ @@ -1,17 +1,12 @@ -// RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:100:2: error: #import of type library is an unsupported Microsoft feature' -// RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:200:2: error: #import of type library is an unsupported Microsoft feature' -// RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:300:2: error: #import of type library is an unsupported Microsoft feature' +// RUN: %clang_cc1 -E -verify -fms-compatibility %s -#line 100 "doh.c" #import "pp-record.h" // expected-error {{#import of type library is an unsupported Microsoft feature}} // Test attributes -#line 200 "doh.c" #import "pp-record.h" no_namespace, auto_rename // expected-error {{#import of type library is an unsupported Microsoft feature}} -// This will also fire the "#import of type library is an unsupported Microsoft feature" -// error, but we can't use -verify because there's no way to put the comment on the proper line -#line 300 "doh.c" #import "pp-record.h" no_namespace \ auto_rename \ auto_search +// expected-error@-3 {{#import of type library is an unsupported Microsoft feature}} +
Migrate a test to -verify git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@173716 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
13bdfcd1c659359289f373052b21fb9f998dcc0b
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H #define BITCOIN_VALIDATION_H #include <stdint.h> #include <string> static const int64_t DEFAULT_MAX_TIP_AGE = 1 * 60 * 60; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin extern int64_t nMaxTipAge; class CBlockIndex; FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb"); FILE* AppendBlockFile(unsigned int& nFileRet); bool IsInitialBlockDownload(); /** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */ double GuessVerificationProgress(CBlockIndex* pindex); #endif // BITCOIN_VALIDATION_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H #define BITCOIN_VALIDATION_H #include <stdint.h> #include <string> static const int64_t DEFAULT_MAX_TIP_AGE = 120; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin extern int64_t nMaxTipAge; class CBlockIndex; FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb"); FILE* AppendBlockFile(unsigned int& nFileRet); bool IsInitialBlockDownload(); /** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */ double GuessVerificationProgress(CBlockIndex* pindex); #endif // BITCOIN_VALIDATION_H
--- +++ @@ -10,7 +10,7 @@ #include <stdint.h> #include <string> -static const int64_t DEFAULT_MAX_TIP_AGE = 120; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin +static const int64_t DEFAULT_MAX_TIP_AGE = 1 * 60 * 60; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin extern int64_t nMaxTipAge;
Put back default max tip age
mit
neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron
7fc9119df40544c5048308be5a6ff46b61213972
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.04.00.13-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 4 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.04.00.08-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 4 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
--- +++ @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.04.00.08-k" +#define QLA2XXX_VERSION "8.04.00.13-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 4
[SCSI] qla2xxx: Update the driver version to 8.04.00.13-k. Signed-off-by: Giridhar Malavali <[email protected]> Signed-off-by: Saurav Kashyap <[email protected]> Signed-off-by: James Bottomley <[email protected]>
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
231ff54e4cc4a6f1ef78fb4e1f94957bbb961aae
#ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #ifndef TEST_SRCDIR # define TEST_SRCDIR "." #endif #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" #ifdef HAVE_ARC4RANDOM # undef rand # define rand(X) arc4random(X) #endif FILE *fp_res; int xmain(void); int main(void) { FILE *fp_out; int c; if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) { perror("fopen(" TEST_NAME_RES ")"); return 99; } if (sodium_init() != 0) { return 99; } if (xmain() != 0) { return 99; } rewind(fp_res); if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) { perror("fopen(" TEST_NAME_OUT ")"); return 99; } do { if ((c = fgetc(fp_res)) != fgetc(fp_out)) { return 99; } } while (c != EOF); return 0; } #undef printf #define printf(...) fprintf(fp_res, __VA_ARGS__) #define main xmain #endif
#ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #ifndef TEST_SRCDIR #define TEST_SRCDIR "./" #endif #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" #ifdef HAVE_ARC4RANDOM # undef rand # define rand(X) arc4random(X) #endif FILE *fp_res; int xmain(void); int main(void) { FILE *fp_out; int c; if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) { perror("fopen(" TEST_NAME_RES ")"); return 99; } if (sodium_init() != 0) { return 99; } if (xmain() != 0) { return 99; } rewind(fp_res); if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) { perror("fopen(" TEST_NAME_OUT ")"); return 99; } do { if ((c = fgetc(fp_res)) != fgetc(fp_out)) { return 99; } } while (c != EOF); return 0; } #undef printf #define printf(...) fprintf(fp_res, __VA_ARGS__) #define main xmain #endif
--- +++ @@ -7,7 +7,7 @@ #include "sodium.h" #ifndef TEST_SRCDIR -#define TEST_SRCDIR "./" +# define TEST_SRCDIR "." #endif #define TEST_NAME_RES TEST_NAME ".res"
Add a default value for TEST_SRCDIR
isc
netroby/libsodium,tml/libsodium,SpiderOak/libsodium,optedoblivion/android_external_libsodium,Payshares/libsodium,tml/libsodium,Payshares/libsodium,rustyhorde/libsodium,JackWink/libsodium,zhuqling/libsodium,HappyYang/libsodium,Payshare/libsodium,akkakks/libsodium,pyparallel/libsodium,zhuqling/libsodium,zhuqling/libsodium,paragonie-scott/libsodium,GreatFruitOmsk/libsodium,eburkitt/libsodium,akkakks/libsodium,mvduin/libsodium,rustyhorde/libsodium,JackWink/libsodium,Payshare/libsodium,kytvi2p/libsodium,SpiderOak/libsodium,paragonie-scott/libsodium,mvduin/libsodium,Payshares/libsodium,pyparallel/libsodium,donpark/libsodium,paragonie-scott/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,pmienk/libsodium,kytvi2p/libsodium,SpiderOak/libsodium,rustyhorde/libsodium,pyparallel/libsodium,HappyYang/libsodium,kytvi2p/libsodium,soumith/libsodium,GreatFruitOmsk/libsodium,donpark/libsodium,eburkitt/libsodium,pmienk/libsodium,donpark/libsodium,eburkitt/libsodium,JackWink/libsodium,tml/libsodium,SpiderOak/libsodium,akkakks/libsodium,mvduin/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,GreatFruitOmsk/libsodium,netroby/libsodium,pmienk/libsodium,akkakks/libsodium,soumith/libsodium,optedoblivion/android_external_libsodium,HappyYang/libsodium,Payshare/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,rustyhorde/libsodium,optedoblivion/android_external_libsodium,netroby/libsodium,soumith/libsodium
c1aebf3ea9e5fc1881078b6f286049090766fdfa
// // CCLoadingController.h // CCKit // // Created by Leonardo Lobato on 3/15/13. // Copyright (c) 2013 Cliq Consulting. All rights reserved. // #import <UIKit/UIKit.h> @protocol CCLoadingControllerDelegate; @interface CCLoadingController : NSObject @property (nonatomic, readonly) UIView *loadingView; #if __has_feature(objc_arc) @property (nonatomic, weak) id<CCLoadingControllerDelegate> delegate; #else @property (nonatomic, assign) id<CCLoadingControllerDelegate> delegate; #endif - (void)showLoadingView:(BOOL)show animated:(BOOL)animated; @end @protocol CCLoadingControllerDelegate <NSObject> - (UIView *)parentViewForLoadingController:(CCLoadingController *)controller; @optional; - (UIView *)loadingControllerShouldBeDisplayedBelowView:(CCLoadingController *)controller; - (NSString *)titleForLoadingViewOnLoadingController:(CCLoadingController *)controller; @end
// // CCLoadingController.h // CCKit // // Created by Leonardo Lobato on 3/15/13. // Copyright (c) 2013 Cliq Consulting. All rights reserved. // #import <UIKit/UIKit.h> @protocol CCLoadingControllerDelegate; @interface CCLoadingController : NSObject @property (nonatomic, readonly) UIView *loadingView; @property (nonatomic, weak) id<CCLoadingControllerDelegate> delegate; - (void)showLoadingView:(BOOL)show animated:(BOOL)animated; @end @protocol CCLoadingControllerDelegate <NSObject> - (UIView *)parentViewForLoadingController:(CCLoadingController *)controller; @optional; - (UIView *)loadingControllerShouldBeDisplayedBelowView:(CCLoadingController *)controller; - (NSString *)titleForLoadingViewOnLoadingController:(CCLoadingController *)controller; @end
--- +++ @@ -13,7 +13,11 @@ @interface CCLoadingController : NSObject @property (nonatomic, readonly) UIView *loadingView; +#if __has_feature(objc_arc) @property (nonatomic, weak) id<CCLoadingControllerDelegate> delegate; +#else +@property (nonatomic, assign) id<CCLoadingControllerDelegate> delegate; +#endif - (void)showLoadingView:(BOOL)show animated:(BOOL)animated;
Fix build for non-arc projects Does **not** add no-arc support. Project will leak.
mit
cliq/CCKit
4545c54ecd4b9cbc13033008c78c403da996f990
/* ** Copyright 2002, Manuel J. Petit. All rights reserved. ** Distributed under the terms of the NewOS License. */ #include <stdio.h> #include <dlfcn.h> extern int fib(int); extern void shared_hello(void); int main() { void *freston; void *girlfriend; shared_hello(); printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5)); freston= dlopen("/boot/lib/girlfriend.so", RTLD_NOW); girlfriend= dlsym(freston, "girlfriend"); ((void(*)(void))girlfriend)(); return 0; }
/* ** Copyright 2002, Manuel J. Petit. All rights reserved. ** Distributed under the terms of the NewOS License. */ #include <stdio.h> #include <dlfcn.h> extern int fib(int); extern void shared_hello(void); int main() { void *freston; void *girlfriend; shared_hello(); printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5)); freston= dlopen("/boot/lib/girlfriend.so", RTLD_LAZY); girlfriend= dlsym(freston, "girlfriend"); ((void(*)(void))girlfriend)(); return 0; }
--- +++ @@ -18,7 +18,7 @@ shared_hello(); printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5)); - freston= dlopen("/boot/lib/girlfriend.so", RTLD_LAZY); + freston= dlopen("/boot/lib/girlfriend.so", RTLD_NOW); girlfriend= dlsym(freston, "girlfriend"); ((void(*)(void))girlfriend)();
Fix serious bug. Should be RTLD_NOW... RTLD_LAZY does not work for getting a girlfriend. git-svn-id: fb278a52ad97f7fbef074986829f2c6a2a3c4b34@547 c25cc9d1-44fa-0310-b259-ad778cb1d433
bsd-3-clause
dioptre/newos,travisg/newos,siraj/newos,zhouxh1023/newos,siraj/newos,siraj/newos,dioptre/newos,dioptre/newos,siraj/newos,travisg/newos,zhouxh1023/newos,travisg/newos,zhouxh1023/newos
2fbd5548c56d6cbeef46248da67cb97455a3a7ec
// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy // Example from https://www-apr.lip6.fr/~mine/publi/article-mine-HOSC06.pdf void main(void) { int X = 0; int N = rand(); if(N < 0) { N = 0; } while(X < N) { X++; } assert(X-N == 0); assert(X == N); if(X == N) { N = 8; } else { // dead code N = 42; } assert(N == 8); }
// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy // Example from https://www-apr.lip6.fr/~mine/publi/article-mine-HOSC06.pdf void main(void) { int X = 0; int N = rand(); if(N < 0) { N = 0; } while(X < N) { X++; } assert(X-N == 0); assert(X == N); if(X == N) { N = 8; } else { // is dead code but if that is detected or not depends on what we do in branch // currently we can't detect this N = 42; } }
--- +++ @@ -15,8 +15,9 @@ if(X == N) { N = 8; } else { - // is dead code but if that is detected or not depends on what we do in branch - // currently we can't detect this + // dead code N = 42; } + + assert(N == 8); }
Make assert in 36/01 stronger
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
1bd3551a0fbd8bc375a9bb7a60d8152ff641f3f9
#define BUF_SIZE 4096 #define MAXINTERFACES 5 #define MAXNEIGHBOURS 10 #define MESSAGE_PAD1 0 #define MESSAGE_PADN 1 #define MESSAGE_ACK_REQ 2 #define MESSAGE_ACK 3 #define MESSAGE_HELLO 4 #define MESSAGE_IHU 5 #define MESSAGE_ROUTER_ID 6 #define MESSAGE_NH 7 #define MESSAGE_UPDATE 8 #define MESSAGE_REQUEST 9 #define MESSAGE_MH_REQUEST 10 #define AE_WILDCARD 0 #define AE_IPV4 1 #define AE_IPV6 2 #define AE_LL 3 #define INFINITY 0xFFFF
#define BUF_SIZE 4096 #define MAXINTERFACES 10 #define MAXNEIGHBOURS 20 #define MESSAGE_PAD1 0 #define MESSAGE_PADN 1 #define MESSAGE_ACK_REQ 2 #define MESSAGE_ACK 3 #define MESSAGE_HELLO 4 #define MESSAGE_IHU 5 #define MESSAGE_ROUTER_ID 6 #define MESSAGE_NH 7 #define MESSAGE_UPDATE 8 #define MESSAGE_REQUEST 9 #define MESSAGE_MH_REQUEST 10 #define AE_WILDCARD 0 #define AE_IPV4 1 #define AE_IPV6 2 #define AE_LL 3 #define INFINITY 0xFFFF
--- +++ @@ -1,7 +1,7 @@ #define BUF_SIZE 4096 -#define MAXINTERFACES 10 -#define MAXNEIGHBOURS 20 +#define MAXINTERFACES 5 +#define MAXNEIGHBOURS 10 #define MESSAGE_PAD1 0 #define MESSAGE_PADN 1
Reduce size of neighbour and interface table. Now that we're able to expire neighbours, we can get away with a smaller table.
mit
jech/sbabeld
aa1ee08cf779b9a07867aa315c766e663bcbc4ed
#ifndef ABSTRACT_LEARNING_DEBUG_H #define ABSTRACT_LEARNING_DEBUG_H #include <stdlib.h> #include <stdio.h> #include <assert.h> /*Print method*/ #ifdef BUILD_FOR_ANDROID #include <android/log.h> #define ALPRINT(format, ...) __android_log_print(ANDROID_LOG_INFO, "AL", format,##__VA_ARGS__) #define ALPRINT_FL(format,...) __android_log_print(ANDROID_LOG_INFO, "AL", format", FUNC: %s, LINE: %d \n",##__VA_ARGS__, __func__, __LINE__) #else #define ALPRINT(format, ...) printf(format,##__VA_ARGS__) #define ALPRINT_FL(format,...) printf(format", FUNC: %s, LINE: %d \n", ##__VA_ARGS__,__func__, __LINE__) #endif /*Add with line and function*/ #define FUNC_PRINT(x) ALPRINT(#x"=%d in %s, %d \n",(int)(x), __func__, __LINE__); #define FUNC_PRINT_ALL(x, type) ALPRINT(#x"= "#type" %"#type" in %s, %d \n",x, __func__, __LINE__); #define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}} #ifndef BUILD_FOR_ANDROID #define ALASSERT(x) \ if (!(x)) al_dump_stack();assert(x); #else #define ALASSERT(x) \ {bool ___result = (x);\ if (!(___result))\ FUNC_PRINT((___result));} #endif #define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}} #ifdef __cplusplus extern "C"{ #endif void al_dump_stack(); #ifdef __cplusplus } #endif #endif
#ifndef ABSTRACT_LEARNING_DEBUG_H #define ABSTRACT_LEARNING_DEBUG_H #include <stdlib.h> #include <stdio.h> #include <assert.h> #define FUNC_PRINT(x) printf(#x"=%d in %s, %d \n",x, __func__, __LINE__); #define FUNC_PRINT_ALL(x, type) printf(#x"="#type"%"#type" in %s, %d \n",x, __func__, __LINE__); #define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}} #ifdef __cplusplus extern "C"{ #endif void al_dump_stack(); #ifdef __cplusplus } #endif //#define ALASSERT(x) assert(x) #define ALASSERT(x) \ if (!(x)) al_dump_stack();assert(x); #endif
--- +++ @@ -4,8 +4,31 @@ #include <stdlib.h> #include <stdio.h> #include <assert.h> -#define FUNC_PRINT(x) printf(#x"=%d in %s, %d \n",x, __func__, __LINE__); -#define FUNC_PRINT_ALL(x, type) printf(#x"="#type"%"#type" in %s, %d \n",x, __func__, __LINE__); +/*Print method*/ +#ifdef BUILD_FOR_ANDROID +#include <android/log.h> +#define ALPRINT(format, ...) __android_log_print(ANDROID_LOG_INFO, "AL", format,##__VA_ARGS__) +#define ALPRINT_FL(format,...) __android_log_print(ANDROID_LOG_INFO, "AL", format", FUNC: %s, LINE: %d \n",##__VA_ARGS__, __func__, __LINE__) +#else +#define ALPRINT(format, ...) printf(format,##__VA_ARGS__) +#define ALPRINT_FL(format,...) printf(format", FUNC: %s, LINE: %d \n", ##__VA_ARGS__,__func__, __LINE__) +#endif +/*Add with line and function*/ +#define FUNC_PRINT(x) ALPRINT(#x"=%d in %s, %d \n",(int)(x), __func__, __LINE__); +#define FUNC_PRINT_ALL(x, type) ALPRINT(#x"= "#type" %"#type" in %s, %d \n",x, __func__, __LINE__); + +#define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}} + +#ifndef BUILD_FOR_ANDROID +#define ALASSERT(x) \ + if (!(x)) al_dump_stack();assert(x); +#else +#define ALASSERT(x) \ + {bool ___result = (x);\ + if (!(___result))\ + FUNC_PRINT((___result));} +#endif + #define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}} @@ -16,8 +39,5 @@ #ifdef __cplusplus } #endif -//#define ALASSERT(x) assert(x) -#define ALASSERT(x) \ - if (!(x)) al_dump_stack();assert(x); #endif
Add debug for android, solve all warning
apache-2.0
jxt1234/Abstract_Learning,jxt1234/Abstract_Learning,jxt1234/Abstract_Learning
c78c827078ec7211971e4d42c7de8c7a0e16fd56
/* ============================================================================ Name : thsh.c Authors : Collin Kruger, Denton Underwood, John Christensen, Jon Stacey Version : Copyright : Copyright 2009 Jon Stacey. All rights reserved. Description : Hello World in C, Ansi-style ============================================================================ */ #include <stdio.h> #include <stdlib.h> int main(void) { setvbuf(stdout, NULL, _IONBF, 0); // Disable buffering in accordance to http://homepages.tesco.net/J.deBoynePollard/FGA/capture-console-win32.html puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; }
/* ============================================================================ Name : thsh.c Authors : Collin Kruger, Denton Underwood, John Christensen, Jon Stacey Version : Copyright : Copyright 2009 Jon Stacey. All rights reserved. Description : Hello World in C, Ansi-style ============================================================================ */ #include <stdio.h> #include <stdlib.h> int main(void) { puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; }
--- +++ @@ -12,6 +12,8 @@ #include <stdlib.h> int main(void) { + setvbuf(stdout, NULL, _IONBF, 0); // Disable buffering in accordance to http://homepages.tesco.net/J.deBoynePollard/FGA/capture-console-win32.html + puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; }
Disable buffering to overcome apparent Eclipse bug
mit
jmstacey/thsh
ae193c0aadeaa9be7e65afa87268436ee582fdb3
//----------------------------------------------------------------------------- // // Copyright © 2016 Project Golan // // See "LICENSE" for more information. // //----------------------------------------------------------------------------- // // Assertions. // //----------------------------------------------------------------------------- #ifndef lithos3__Lth_assert_h #define lithos3__Lth_assert_h #include <stdio.h> #ifdef NDEBUG #define Lth_assert(expression) ((void)0) #else #define Lth_assert(expression) \ if(!(expression)) \ fprintf(stderr, "[lithos3] Assertion failed in %s (%s:%i): %s\n", \ __func__, __FILE__, __LINE__, #expression); \ else \ ((void)0) #endif #endif//lithos3__Lth_assert_h
//----------------------------------------------------------------------------- // // Copyright © 2016 Project Golan // // See "LICENSE" for more information. // //----------------------------------------------------------------------------- // // Assertions. // //----------------------------------------------------------------------------- #ifndef lithos3__Lth_assert_h #define lithos3__Lth_assert_h #include <stdio.h> #ifdef NDEBUG #define Lth_assert(expression) ((void)0) #else #define Lth_assert(expression) \ if(!(expression)) \ printf("[lithos3] Assertion failed in %s (%s:%i): %s\n", \ __func__, __FILE__, __LINE__, #expression); \ else \ ((void)0) #endif #endif//lithos3__Lth_assert_h
--- +++ @@ -20,7 +20,7 @@ #else #define Lth_assert(expression) \ if(!(expression)) \ - printf("[lithos3] Assertion failed in %s (%s:%i): %s\n", \ + fprintf(stderr, "[lithos3] Assertion failed in %s (%s:%i): %s\n", \ __func__, __FILE__, __LINE__, #expression); \ else \ ((void)0)
assert: Fix Lth_Assert not using stderr
mit
Project-Golan/LithOS3
f30001b81814882577a9ab1e34f64b4d240ca99a
#ifndef NME_BYTE_ARRAY_H #define NME_BYTE_ARRAY_H #include <nme/Object.h> #include <nme/QuickVec.h> #include "Utils.h" #include <hx/CFFI.h> namespace nme { // If you put this structure on the stack, then you do not have to worry about GC. // If you store this in a heap structure, then you will need to use GC roots for mValue... struct ByteArray { ByteArray(int inSize); ByteArray(const ByteArray &inRHS); ByteArray(); ByteArray(value Value); ByteArray(const QuickVec<unsigned char> &inValue); ByteArray(const char *inResourceName); void Resize(int inSize); int Size() const; unsigned char *Bytes(); const unsigned char *Bytes() const; bool Ok() { return mValue!=0; } value mValue; static ByteArray FromFile(const OSChar *inFilename); #ifdef HX_WINDOWS static ByteArray FromFile(const char *inFilename); #endif }; #ifdef ANDROID ByteArray AndroidGetAssetBytes(const char *); struct FileInfo { int fd; off_t offset; off_t length; }; FileInfo AndroidGetAssetFD(const char *); #endif } #endif
#ifndef NME_BYTE_ARRAY_H #define NME_BYTE_ARRAY_H #include <nme/Object.h> #include <nme/QuickVec.h> #include "Utils.h" namespace nme { // If you put this structure on the stack, then you do not have to worry about GC. // If you store this in a heap structure, then you will need to use GC roots for mValue... struct ByteArray { ByteArray(int inSize); ByteArray(const ByteArray &inRHS); ByteArray(); ByteArray(struct _value *Value); ByteArray(const QuickVec<unsigned char> &inValue); ByteArray(const char *inResourceName); void Resize(int inSize); int Size() const; unsigned char *Bytes(); const unsigned char *Bytes() const; bool Ok() { return mValue!=0; } struct _value *mValue; static ByteArray FromFile(const OSChar *inFilename); #ifdef HX_WINDOWS static ByteArray FromFile(const char *inFilename); #endif }; #ifdef ANDROID ByteArray AndroidGetAssetBytes(const char *); struct FileInfo { int fd; off_t offset; off_t length; }; FileInfo AndroidGetAssetFD(const char *); #endif } #endif
--- +++ @@ -4,6 +4,7 @@ #include <nme/Object.h> #include <nme/QuickVec.h> #include "Utils.h" +#include <hx/CFFI.h> namespace nme { @@ -16,7 +17,7 @@ ByteArray(int inSize); ByteArray(const ByteArray &inRHS); ByteArray(); - ByteArray(struct _value *Value); + ByteArray(value Value); ByteArray(const QuickVec<unsigned char> &inValue); ByteArray(const char *inResourceName); @@ -27,7 +28,7 @@ bool Ok() { return mValue!=0; } - struct _value *mValue; + value mValue; static ByteArray FromFile(const OSChar *inFilename); #ifdef HX_WINDOWS
Use correct cffi type for 'value'
mit
thomasuster/NME,haxenme/nme,haxenme/nme,haxenme/nme,haxenme/nme,madrazo/nme,thomasuster/NME,thomasuster/NME,madrazo/nme,thomasuster/NME,thomasuster/NME,madrazo/nme,thomasuster/NME,madrazo/nme,madrazo/nme,haxenme/nme,madrazo/nme
f34ee1e4aa493b3192226c77f6c7041efc47c6df
/* * Copyright (C) 2013 INRIA. * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup sys_shell_commands * @{ * * @file * @brief Shell commands for the PS module * * @author Oliver Hahm <[email protected]> * * @} */ #ifdef MODULE_PS #include "ps.h" int _ps_handler(int argc, char **argv) { (void) argc; (void) argv; ps(); return 0; } #endif
/* * Copyright (C) 2013 INRIA. * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup sys_shell_commands * @{ * * @file * @brief Shell commands for the PS module * * @author Oliver Hahm <[email protected]> * * @} */ #include "ps.h" int _ps_handler(int argc, char **argv) { (void) argc; (void) argv; ps(); return 0; }
--- +++ @@ -18,6 +18,7 @@ * @} */ +#ifdef MODULE_PS #include "ps.h" int _ps_handler(int argc, char **argv) @@ -29,3 +30,4 @@ return 0; } +#endif
Fix ps depedency when ps not included
lgpl-2.1
ximus/RIOT,ximus/RIOT,ximus/RIOT,ximus/RIOT,ximus/RIOT,ximus/RIOT
0e759ce768538ef7c0740771c069d36833feca46
// Copyright 2014-2016 the project authors as listed in the AUTHORS file. // All rights reserved. Use of this source code is governed by the // license that can be found in the LICENSE file. #ifndef _DEVICE #define _DEVICE #include "MessageQueue.h" #include "DeviceMessageHandler.h" #ifdef __arm__ #define INTERRUPT_SAFE #else #include <Arduino.h> #define INTERRUPT_SAFE ICACHE_RAM_ATTR #endif typedef struct MessageHandlerListEntry { DeviceMessageHandler* handler; MessageHandlerListEntry* next; } MessageHandlerListEntry; class Device { protected: MessageQueue* queue; MessageHandlerListEntry* _messageHandlers; public: Device(); void setQueue(MessageQueue* queue); // must be implemented by sub class virtual int deviceType(void) = 0; virtual char* deviceName(void) = 0; virtual void processPulse(long duration) = 0; virtual void decodeMessage(Message* message) = 0; // can optionally be overridden by devices virtual void handleMessage(Message* message); virtual bool registerMessageHandler(DeviceMessageHandler* handler); }; #endif
// Copyright 2014-2016 the project authors as listed in the AUTHORS file. // All rights reserved. Use of this source code is governed by the // license that can be found in the LICENSE file. #ifndef _DEVICE #define _DEVICE #include "MessageQueue.h" #include "DeviceMessageHandler.h" typedef struct MessageHandlerListEntry { DeviceMessageHandler* handler; MessageHandlerListEntry* next; } MessageHandlerListEntry; class Device { protected: MessageQueue* queue; MessageHandlerListEntry* _messageHandlers; public: Device(); void setQueue(MessageQueue* queue); // must be implemented by sub class virtual int deviceType(void) = 0; virtual char* deviceName(void) = 0; virtual void processPulse(long duration) = 0; virtual void decodeMessage(Message* message) = 0; // can optionally be overridden by devices virtual void handleMessage(Message* message); virtual bool registerMessageHandler(DeviceMessageHandler* handler); }; #endif
--- +++ @@ -8,6 +8,13 @@ #include "MessageQueue.h" #include "DeviceMessageHandler.h" +#ifdef __arm__ + +#define INTERRUPT_SAFE +#else +#include <Arduino.h> +#define INTERRUPT_SAFE ICACHE_RAM_ATTR +#endif typedef struct MessageHandlerListEntry { DeviceMessageHandler* handler;
Add back missing platform defines
mit
mhdawson/arduino-esp8266,mhdawson/arduino-esp8266
f1e39690cf85b947ed6ccb1c12315b79f83708bb
#ifndef FIX_TYPES_H #define FIX_TYPES_H #include <sys/types.h> /* The system include file defines this in terms of bzero(), but ANSI says we should use memset(). */ #if defined(OSF1) #undef FD_ZERO #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) #endif /* Various non-POSIX conforming files which depend on sys/types.h will need these extra definitions... */ typedef unsigned int u_int; #if defined(AIX32) typedef unsigned short ushort; #endif #if defined(ULTRIX42) || defined(ULTRIX43) typedef char * caddr_t; #endif #if defined(AIX32) typedef unsigned long rlim_t; #endif #endif
#ifndef FIX_TYPES_H #define FIX_TYPES_H #include <sys/types.h> /* The system include file defines this in terms of bzero(), but ANSI says we should use memset(). */ #if defined(OSF1) #undef FD_ZERO #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) #endif /* Various non-POSIX conforming files which depend on sys/types.h will need these extra definitions... */ typedef unsigned int u_int; #if defined(ULTRIX42) || defined(ULTRIX43) typedef char * caddr_t; #endif #endif
--- +++ @@ -19,8 +19,16 @@ typedef unsigned int u_int; +#if defined(AIX32) +typedef unsigned short ushort; +#endif + #if defined(ULTRIX42) || defined(ULTRIX43) typedef char * caddr_t; #endif +#if defined(AIX32) +typedef unsigned long rlim_t; #endif + +#endif
Add types "ushort" and "rlim_t" for AIX.
apache-2.0
bbockelm/condor-network-accounting,zhangzhehust/htcondor,djw8605/condor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/condor,djw8605/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,htcondor/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,djw8605/condor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,djw8605/condor,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,htcondor/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/condor,djw8605/condor,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,neurodebian/htcondor
3ed71339b1bb80eec219c142aca03a0cf0be0ffa
#ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "$1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif #elif defined(__x86_64__) # define STATIC_CHAIN_REG "r10" #elif defined(__i386__) # ifndef ABI_NUM # define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */ # endif #endif
#ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "r1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif #elif defined(__x86_64__) # define STATIC_CHAIN_REG "r10" #elif defined(__i386__) # ifndef ABI_NUM # define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */ # endif #endif
--- +++ @@ -1,7 +1,7 @@ #ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) -# define STATIC_CHAIN_REG "r1" +# define STATIC_CHAIN_REG "$1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__)
testsuite: Fix alpha static chain register name
mit
biosbits/libffi,Distrotech/libffi,Distrotech/libffi,joshtriplett/libffi,Pan7/libffi,Pan7/libffi,biosbits/libffi,s1341/libffi,bgarrels/libffi,joshtriplett/libffi,nmav/libffi,rth7680/libffi,joshtriplett/libffi,rth7680/libffi,plicease/libffi,Pan7/libffi,bgarrels/libffi,s1341/libffi,nmav/libffi,biosbits/libffi,joshtriplett/libffi,nmav/libffi,Pan7/libffi,plicease/libffi,bgarrels/libffi,nmav/libffi,rth7680/libffi,Distrotech/libffi,s1341/libffi,plicease/libffi,bgarrels/libffi,s1341/libffi,Distrotech/libffi,plicease/libffi,rth7680/libffi,biosbits/libffi
ccdd7bb8566b2fd1da5c4b5c8eaa2db43a69e720
// RUN: clang -checker-simple -verify %s int* f1() { int x = 0; return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}} } int* f2(int y) { return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}} } int* f3(int x, int *y) { int w = 0; if (x) y = &w; return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}} } void* compound_literal(int x) { if (x) return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}} struct s { int z; double y; int w; }; return &((struct s){ 2, 0.4, 5 * 8 }); }
// RUN: clang -checker-simple -verify %s int* f1() { int x = 0; return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}} } int* f2(int y) { return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}} } int* f3(int x, int *y) { int w = 0; if (x) y = &w; return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}} } unsigned short* compound_literal() { return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}} }
--- +++ @@ -18,7 +18,11 @@ return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}} } -unsigned short* compound_literal() { - return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}} +void* compound_literal(int x) { + if (x) + return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}} + + struct s { int z; double y; int w; }; + return &((struct s){ 2, 0.4, 5 * 8 }); }
Improve compound literal test case. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58447 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
d4a07988c8ba6b214e8d93c3a4048357484ba771
#ifndef _MY_EDATA #define _MY_EDATA #ifdef __cplusplus #define EXTERNC extern "C" #else #define EXTERNC #include <stdbool.h> #endif /** @brief struct that carries all information about experimental data */ typedef struct edata { /** observed data */ double *am_my; /** standard deviation of observed data */ double *am_ysigma; /** observed events */ double *am_mz; /** standard deviation of observed events */ double *am_zsigma; /** boolean indicating whether experimental data was provided */ bool am_bexpdata; } ExpData; EXTERNC void freeExpData(ExpData *edata); #endif /* _MY_EDATA */
#ifndef _MY_EDATA #define _MY_EDATA #ifdef __cplusplus #define EXTERNC extern "C" #else #define EXTERNC #endif /** @brief struct that carries all information about experimental data */ typedef struct edata { /** observed data */ double *am_my; /** standard deviation of observed data */ double *am_ysigma; /** observed events */ double *am_mz; /** standard deviation of observed events */ double *am_zsigma; /** boolean indicating whether experimental data was provided */ bool am_bexpdata; } ExpData; EXTERNC void freeExpData(ExpData *edata); #endif /* _MY_EDATA */
--- +++ @@ -5,6 +5,7 @@ #define EXTERNC extern "C" #else #define EXTERNC +#include <stdbool.h> #endif /** @brief struct that carries all information about experimental data */ @@ -22,7 +23,7 @@ /** boolean indicating whether experimental data was provided */ bool am_bexpdata; - } ExpData; +} ExpData; EXTERNC void freeExpData(ExpData *edata);
Fix type bool for C
bsd-2-clause
AMICI-developer/AMICI,FFroehlich/AMICI,AMICI-developer/AMICI,AMICI-developer/AMICI,FFroehlich/AMICI,FFroehlich/AMICI,FFroehlich/AMICI,AMICI-developer/AMICI
172dfb5cae6780455d338fd38a16c87dfe92073b
#pragma once #include "initiation/sipmessageprocessor.h" #include "initiation/siptypes.h" /* This class handles the authentication for this connection * should we receive a challenge */ class SIPAuthentication : public SIPMessageProcessor { Q_OBJECT public: SIPAuthentication(); public slots: // add credentials to request, if we have them virtual void processOutgoingRequest(SIPRequest& request, QVariant& content); // take challenge if they require authentication virtual void processIncomingResponse(SIPResponse& response, QVariant& content); private: DigestResponse generateAuthResponse(DigestChallenge& challenge, QString username, SIP_URI& requestURI, SIPRequestMethod method, QVariant& content); void updateNonceCount(DigestChallenge& challenge, DigestResponse& response); QList<DigestChallenge> wwwChallenges_; QList<DigestChallenge> proxyChallenges_; QList<DigestResponse> authorizations_; QList<DigestResponse> proxyAuthorizations_; // key is realm and value current nonce std::map<QString, QString> realmToNonce_; std::map<QString, uint32_t> realmToNonceCount_; QByteArray a1_; };
#pragma once #include "initiation/sipmessageprocessor.h" #include "initiation/siptypes.h" /* This class handles the authentication for this connection * should we receive a challenge */ class SIPAuthentication : public SIPMessageProcessor { Q_OBJECT public: SIPAuthentication(); public slots: // add credentials to request, if we have them virtual void processOutgoingRequest(SIPRequest& request, QVariant& content); // take challenge if they require authentication virtual void processIncomingResponse(SIPResponse& response, QVariant& content); private: DigestResponse generateAuthResponse(DigestChallenge& challenge, QString username, SIP_URI& requestURI, SIPRequestMethod method, QVariant& content); void updateNonceCount(DigestChallenge& challenge, DigestResponse& response); // TODO: Test if these need to be separate QList<DigestChallenge> wwwChallenges_; QList<DigestChallenge> proxyChallenges_; QList<DigestResponse> authorizations_; QList<DigestResponse> proxyAuthorizations_; // key is realm and value current nonce std::map<QString, QString> realmToNonce_; std::map<QString, uint32_t> realmToNonceCount_; QByteArray a1_; };
--- +++ @@ -29,8 +29,6 @@ void updateNonceCount(DigestChallenge& challenge, DigestResponse& response); - // TODO: Test if these need to be separate - QList<DigestChallenge> wwwChallenges_; QList<DigestChallenge> proxyChallenges_;
cosmetic(Transport): Remove TODO. Tested common credentials, didn't work.
isc
ultravideo/kvazzup,ultravideo/kvazzup
235b1753f48c8a22cb79e3115b637f179c3e1e8b
#ifndef TERRAIN_H #define TERRAIN_H #include <util/Math.h> #include <util/Random.h> #include <vector> #include "Constants.h" class Terrain { public: Terrain( const float stepLength = constants::TERRAIN_STEP_LENGTH, const float amplitude = constants::TERRAIN_HEIGHT_VARIATION_AMPLITUDE, const float worldInitLength = constants::WORLD_INIT_LENGTH); virtual ~Terrain(); void ensureHasTerrainTo(const float end); glm::vec2 vertexAtX(const float x) const; // Inlining these as performance examples float stepLength() const { return _stepLength; } float length() const { return float(_vertices.size()) * stepLength() - stepLength(); } const std::vector<glm::vec2>& vertices() const { return _vertices; } bool isAboveGround(const glm::vec2& pos) const; bool isBelowGround(const glm::vec2& pos) const { return !isAboveGround(pos); } private: Random _randomizer; const float _stepLength; const float _amplitude; std::vector<glm::vec2> _vertices; }; #endif
#ifndef TERRAIN_H #define TERRAIN_H #include <util/Math.h> #include <util/Random.h> #include <vector> #include "Constants.h" class Terrain { public: Terrain( const float stepLength = constants::TERRAIN_STEP_LENGTH, const float amplitude = constants::TERRAIN_HEIGHT_VARIATION_AMPLITUDE, const float worldInitLength = constants::WORLD_INIT_LENGTH); virtual ~Terrain(); void ensureHasTerrainTo(const float end); glm::vec2 vertexAtX(const float x) const; // Inlining these as performance examples float stepLength() const { return _stepLength; } float length() const { return float(_vertices.size()) * stepLength() - stepLength(); } const std::vector<glm::vec2>& Terrain::vertices() const { return _vertices; } bool isAboveGround(const glm::vec2& pos) const; bool isBelowGround(const glm::vec2& pos) const { return !isAboveGround(pos); } private: Random _randomizer; const float _stepLength; const float _amplitude; std::vector<glm::vec2> _vertices; }; #endif
--- +++ @@ -21,7 +21,7 @@ // Inlining these as performance examples float stepLength() const { return _stepLength; } float length() const { return float(_vertices.size()) * stepLength() - stepLength(); } - const std::vector<glm::vec2>& Terrain::vertices() const { return _vertices; } + const std::vector<glm::vec2>& vertices() const { return _vertices; } bool isAboveGround(const glm::vec2& pos) const; bool isBelowGround(const glm::vec2& pos) const { return !isAboveGround(pos); }
Fix compilation bug on linux
mit
GiGurra/drunken_walker,GiGurra/drunken_walker,GiGurra/drunken_walker,GiGurra/drunken_walker,GiGurra/drunken_walker
adf0978b3ac91823bf105e78aabb805aaa11e17a