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
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { public: Transaction && begin(); // Modifying methods bool post(TaskId, SerializedTask&); bool put(TaskId, SerializedTask&); bool erase(TaskId); std::vector<SerializedTask> getAllTask(); private: static DataStore& get(); bool isServing = false; std::deque<Internal::IOperation> operationsQueue; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_DATASTORE_H_
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { public: Transaction&& begin(); // Modifying methods bool post(TaskId, SerializedTask&); bool put(TaskId, SerializedTask&); bool erase(TaskId); std::vector<SerializedTask> getAllTask(); private: static DataStore& get(); bool isServing = false; std::deque<Internal::IOperation> operationsQueue; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_DATASTORE_H_
--- +++ @@ -15,7 +15,7 @@ class DataStore { public: - Transaction&& begin(); + Transaction && begin(); // Modifying methods bool post(TaskId, SerializedTask&);
Fix lint error, whitespace around &&
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
48658eef3458ee99291bf3c89be06004bf487b13
#ifndef APIMOCK_RESPONSEDATA_H #define APIMOCK_RESPONSEDATA_H #include <string> #include <unordered_map> #include "statuscodes.h" namespace ApiMock { struct ResponseData { std::string body; std::unordered_map<std::string, std::string> headers; HTTP_RESPONSE_CODE statusCode; }; } #endif
#ifndef APIMOCK_RESPONSEDATA_H #define APIMOCK_RESPONSEDATA_H #include <string> namespace ApiMock { struct ResponseData { std::string body; }; } #endif
--- +++ @@ -2,10 +2,14 @@ #define APIMOCK_RESPONSEDATA_H #include <string> +#include <unordered_map> +#include "statuscodes.h" namespace ApiMock { struct ResponseData { std::string body; + std::unordered_map<std::string, std::string> headers; + HTTP_RESPONSE_CODE statusCode; }; }
Add headers and status code to response
mit
Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock
8cb37afde89b4c89079f579f3532792d7dd5ff67
#ifndef PAPER_H #define PAPER_H #include <stdbool.h> bool paper_is_start_of_first_word(size_t word_count, char *ptr) { return (word_count == 0 && *ptr != KATA_SPACE); } bool paper_is_start_of_subsequent_word(char *ptr) { // Lookback and see if the prior character was a space then check that // we aren't currently on a space. return (*(ptr - 1) == KATA_SPACE && *ptr != KATA_SPACE); } size_t paper_word_count(char *paper) { size_t count = 0; char *ptr = paper; do { if (!*ptr) { break; } if ( paper_is_start_of_first_word(count, ptr) || paper_is_start_of_subsequent_word(ptr) ) { count += 1; } } while (*(++ptr)); return count; } #endif // PAPER_H
#ifndef PAPER_H #define PAPER_H #include <stdbool.h> bool paper_is_start_of_first_word(char *ptr) { // Lookback and check if that is a NUL then check that we aren't // currently on a space. return (*(ptr - 1) == KATA_NUL && *ptr != KATA_SPACE); } bool paper_is_start_of_subsequent_word(char *ptr) { // Lookback and see if the prior character was a space then check that // we aren't currently on a space. return (*(ptr - 1) == KATA_SPACE && *ptr != KATA_SPACE); } size_t paper_word_count(char *paper) { size_t count = 0; char *ptr = paper; do { if (!*ptr) { break; } if ( paper_is_start_of_first_word(ptr) || paper_is_start_of_subsequent_word(ptr) ) { count += 1; } } while (*(++ptr)); return count; } #endif // PAPER_H
--- +++ @@ -3,11 +3,9 @@ #include <stdbool.h> -bool paper_is_start_of_first_word(char *ptr) +bool paper_is_start_of_first_word(size_t word_count, char *ptr) { - // Lookback and check if that is a NUL then check that we aren't - // currently on a space. - return (*(ptr - 1) == KATA_NUL && *ptr != KATA_SPACE); + return (word_count == 0 && *ptr != KATA_SPACE); } bool paper_is_start_of_subsequent_word(char *ptr) @@ -28,7 +26,7 @@ } if ( - paper_is_start_of_first_word(ptr) || + paper_is_start_of_first_word(count, ptr) || paper_is_start_of_subsequent_word(ptr) ) { count += 1;
Refactor to fix potential buffer overflow.
mit
jbenner-radham/pencil-durability-kata-c
a94d0b43cf4cf548d828fec548790a6da073bec1
/** * @file * @brief * * @author Anton Kozlov * @date 30.10.2014 */ #include <assert.h> #include <stdint.h> #include <system_stm32f4xx.h> #include <framework/mod/options.h> #include <module/embox/arch/system.h> #include <hal/arch.h> #include <stm32f4xx_wwdg.h> void arch_init(void) { static_assert(OPTION_MODULE_GET(embox__arch__system, NUMBER, core_freq) == 144000000); SystemInit(); } void arch_idle(void) { } void arch_shutdown(arch_shutdown_mode_t mode) { switch (mode) { case ARCH_SHUTDOWN_MODE_HALT: case ARCH_SHUTDOWN_MODE_REBOOT: case ARCH_SHUTDOWN_MODE_ABORT: default: NVIC_SystemReset(); } /* NOTREACHED */ while(1) { } }
/** * @file * @brief * * @author Anton Kozlov * @date 30.10.2014 */ #include <assert.h> #include <stdint.h> #include <system_stm32f4xx.h> #include <framework/mod/options.h> #include <module/embox/arch/system.h> #include <hal/arch.h> void arch_init(void) { static_assert(OPTION_MODULE_GET(embox__arch__system, NUMBER, core_freq) == 144000000); SystemInit(); } void arch_idle(void) { } void arch_shutdown(arch_shutdown_mode_t mode) { while (1); }
--- +++ @@ -13,6 +13,8 @@ #include <module/embox/arch/system.h> #include <hal/arch.h> +#include <stm32f4xx_wwdg.h> + void arch_init(void) { static_assert(OPTION_MODULE_GET(embox__arch__system, NUMBER, core_freq) == 144000000); SystemInit(); @@ -23,5 +25,16 @@ } void arch_shutdown(arch_shutdown_mode_t mode) { - while (1); + switch (mode) { + case ARCH_SHUTDOWN_MODE_HALT: + case ARCH_SHUTDOWN_MODE_REBOOT: + case ARCH_SHUTDOWN_MODE_ABORT: + default: + NVIC_SystemReset(); + } + + /* NOTREACHED */ + while(1) { + + } }
stm32: Change shutdown to reset the board
bsd-2-clause
gzoom13/embox,embox/embox,abusalimov/embox,Kakadu/embox,mike2390/embox,mike2390/embox,vrxfile/embox-trik,vrxfile/embox-trik,abusalimov/embox,Kakadu/embox,Kakadu/embox,embox/embox,Kefir0192/embox,Kefir0192/embox,Kefir0192/embox,Kefir0192/embox,gzoom13/embox,vrxfile/embox-trik,gzoom13/embox,abusalimov/embox,vrxfile/embox-trik,Kakadu/embox,gzoom13/embox,Kefir0192/embox,embox/embox,abusalimov/embox,gzoom13/embox,vrxfile/embox-trik,mike2390/embox,gzoom13/embox,gzoom13/embox,Kakadu/embox,mike2390/embox,mike2390/embox,Kakadu/embox,Kakadu/embox,mike2390/embox,mike2390/embox,vrxfile/embox-trik,vrxfile/embox-trik,embox/embox,abusalimov/embox,abusalimov/embox,embox/embox,Kefir0192/embox,embox/embox,Kefir0192/embox
e369bd1813b725ba6d6f2effeaa7bd7cb6013664
// Copyright (c) 2015 Yandex LLC. All rights reserved. // Author: Vasily Chekalkin <[email protected]> #ifndef SDCH_HANDLER_H_ #define SDCH_HANDLER_H_ #include <cstring> // For size_t namespace sdch { // SDCH Handler chain. class Handler { public: // Construct Handler with pointer to the next Handler. // We don't own this pointer. It's owned by nginx pool. explicit Handler(Handler* next) : next_(next) {} virtual ~Handler(); // Handle chunk of data. For example encode it with VCDIFF. // Almost every Handler should call next_->on_data() to keep chain. virtual void on_data(const char* buf, size_t len) = 0; protected: Handler* next_; }; } // namespace sdch #endif // SDCH_HANDLER_H_
// Copyright (c) 2015 Yandex LLC. All rights reserved. // Author: Vasily Chekalkin <[email protected]> #ifndef SDCH_HANDLER_H_ #define SDCH_HANDLER_H_ namespace sdch { // SDCH Handler chain. class Handler { public: // Construct Handler with pointer to the next Handler. // We don't own this pointer. It's owned by nginx pool. explicit Handler(Handler* next) : next_(next) {} virtual ~Handler(); // Handle chunk of data. For example encode it with VCDIFF. // Almost every Handler should call next_->on_data() to keep chain. virtual void on_data(const char* buf, size_t len) = 0; protected: Handler* next_; }; } // namespace sdch #endif // SDCH_HANDLER_H_
--- +++ @@ -3,6 +3,8 @@ #ifndef SDCH_HANDLER_H_ #define SDCH_HANDLER_H_ + +#include <cstring> // For size_t namespace sdch {
Fix compilation by using cstring include for size_t definition
mit
yandex/sdch_module,yandex/sdch_module,yandex/sdch_module,yandex/sdch_module
30c1b638dd5d5ec429067a3b2d386bf3f585bdd1
#ifndef KPUTS_H #define KPUTS_H #include <stdarg.h> #include "drivers/terminal.h" void kputs(char* string); void kprintf(char* string, ...); #endif
#ifndef KPUTS_H #define KPUTS_H #include "drivers/terminal.h" void kputs(char* string); void kprint_int(char* string, int i); #endif
--- +++ @@ -1,8 +1,9 @@ #ifndef KPUTS_H #define KPUTS_H +#include <stdarg.h> #include "drivers/terminal.h" void kputs(char* string); -void kprint_int(char* string, int i); +void kprintf(char* string, ...); #endif
Update headers to match new printf
mit
Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth
fb0da0b3b4ece34207375ecddd022f2e2d5b7c52
/* 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_LITE_MICRO_MICRO_ERROR_REPORTER_H_ #define TENSORFLOW_LITE_MICRO_MICRO_ERROR_REPORTER_H_ #include "tensorflow/lite/core/api/error_reporter.h" #include "tensorflow/lite/micro/compatibility.h" #include "tensorflow/lite/micro/debug_log.h" namespace tflite { class MicroErrorReporter : public ErrorReporter { public: ~MicroErrorReporter() override {} int Report(const char* format, va_list args) override; private: TF_LITE_REMOVE_VIRTUAL_DELETE }; } // namespace tflite #endif // TENSORFLOW_LITE_MICRO_MICRO_ERROR_REPORTER_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_LITE_MICRO_MICRO_ERROR_REPORTER_H_ #define TENSORFLOW_LITE_MICRO_MICRO_ERROR_REPORTER_H_ #include "tensorflow/lite/core/api/error_reporter.h" #include "tensorflow/lite/micro/compatibility.h" #include "tensorflow/lite/micro/debug_log.h" namespace tflite { class MicroErrorReporter : public ErrorReporter { public: ~MicroErrorReporter() {} int Report(const char* format, va_list args) override; private: TF_LITE_REMOVE_VIRTUAL_DELETE }; } // namespace tflite #endif // TENSORFLOW_LITE_MICRO_MICRO_ERROR_REPORTER_H_
--- +++ @@ -23,7 +23,7 @@ class MicroErrorReporter : public ErrorReporter { public: - ~MicroErrorReporter() {} + ~MicroErrorReporter() override {} int Report(const char* format, va_list args) override; private:
Add override specifier to the destructor. PiperOrigin-RevId: 306301066 Change-Id: Ied92a889ee7af2d0e9a420d55aa503c31b4eba92
apache-2.0
petewarden/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,annarev/tensorflow,annarev/tensorflow,yongtang/tensorflow,gunan/tensorflow,davidzchen/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,cxxgtxy/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_saved_model,freedomtan/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aam-at/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gunan/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,gunan/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,sarvex/tensorflow,gunan/tensorflow,annarev/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,freedomtan/tensorflow,Intel-Corporation/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,gautam1858/tensorflow,aldian/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,petewarden/tensorflow,karllessard/tensorflow,davidzchen/tensorflow,Intel-tensorflow/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aldian/tensorflow,cxxgtxy/tensorflow,gautam1858/tensorflow,Intel-Corporation/tensorflow,cxxgtxy/tensorflow,frreiss/tensorflow-fred,annarev/tensorflow,gunan/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow,aldian/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,gunan/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,karllessard/tensorflow,aldian/tensorflow,aam-at/tensorflow,yongtang/tensorflow,aam-at/tensorflow,aldian/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,yongtang/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,sarvex/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,gunan/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,gunan/tensorflow,frreiss/tensorflow-fred,annarev/tensorflow,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,cxxgtxy/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,aldian/tensorflow,paolodedios/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,annarev/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,aldian/tensorflow,sarvex/tensorflow,cxxgtxy/tensorflow,aam-at/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,gunan/tensorflow,annarev/tensorflow,annarev/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,gunan/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,davidzchen/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,aam-at/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,sarvex/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,davidzchen/tensorflow,aam-at/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,freedomtan/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,cxxgtxy/tensorflow,freedomtan/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,annarev/tensorflow,paolodedios/tensorflow,gunan/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,gunan/tensorflow
7a895c7cd2784c10e6922b16925797b18839d6b3
// Check target CPUs are correctly passed. // RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // CA53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a53" // RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s // CA57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a57"
// Check target CPUs are correctly passed. // RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // GENERIC: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // CA53: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "cortex-a53" // RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s // CA57: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "cortex-a57"
--- +++ @@ -1,10 +1,10 @@ // Check target CPUs are correctly passed. // RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s -// GENERIC: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "generic" +// GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s -// CA53: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "cortex-a53" +// CA53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a53" // RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s -// CA57: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "cortex-a57" +// CA57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a57"
AArch64: Fix wildcard matching on CHECK lines. Now recognises arch64--. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@193858 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
2f0754c068fb97036f2a78e56768e27e5668e3c7
#ifndef LINESRC_HPP #define LINESRC_HPP #include <stdint.h> #include <string> class haxpp_linesource { private: linecount_t lineno_start = 0; linecount_t lineno = 0; std::string sourcepath; FILE* fp = nullptr; char* line = nullptr; size_t line_alloc = 0; bool fp_owner = false; public: static constexpr size_t line_alloc_minimum = 32u; static constexpr size_t line_alloc_default = 1200u; static constexpr size_t line_alloc_maximum = 65536u; public: inline const std::string& getsourcename() const { return sourcepath; } inline size_t linesize() const { /* total buffer size including room for NUL terminator */ return line_alloc; } inline linecount_t currentline() const { return lineno_start; } public: haxpp_linesource(); ~haxpp_linesource(); public: void setsource(); void setsource(FILE *_fp); void setsource(const std::string &path); bool lineresize(const size_t newsz); void close(); bool is_open() const; bool eof() const; bool error() const; bool open(); char *readline(); }; #endif /*LINESRC_HPP*/
#ifndef LINESRC_HPP #define LINESRC_HPP #include <stdint.h> #include <string> class haxpp_linesource { private: linecount_t lineno_start = 0; linecount_t lineno = 0; std::string sourcepath; FILE* fp = nullptr; char* line = nullptr; size_t line_alloc = 0; bool fp_owner = false; public: static constexpr size_t line_alloc_minimum = 32u; static constexpr size_t line_alloc_default = 1200u; static constexpr size_t line_alloc_maximum = 65536u; public: inline const std::string& getsourcename() const { return sourcepath; } inline size_t linesize() const { /* total buffer size including room for NUL terminator */ return line_alloc; } inline linecount_t currentline() const { return lineno; } public: haxpp_linesource(); ~haxpp_linesource(); public: void setsource(); void setsource(FILE *_fp); void setsource(const std::string &path); bool lineresize(const size_t newsz); void close(); bool is_open() const; bool eof() const; bool error() const; bool open(); char *readline(); }; #endif /*LINESRC_HPP*/
--- +++ @@ -27,7 +27,7 @@ return line_alloc; } inline linecount_t currentline() const { - return lineno; + return lineno_start; } public: haxpp_linesource();
Fix line number off by 1 error
lgpl-2.1
joncampbell123/haxcc,joncampbell123/haxcc,joncampbell123/haxcc,joncampbell123/haxcc,joncampbell123/haxcc
d997a15d48dd2d756b4aed69cae32df7d28c94de
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string& name, API_TYPE type) : name(name), type(type) { } virtual void optimize(onnx::ModelProto& mp) {} virtual void optimize(Graph& graph) {} }; }} // namespace onnx::optimization
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string name, API_TYPE type) : name(name), type(type) { } virtual void optimize(onnx::ModelProto& mp) {} virtual void optimize(Graph& graph) {} }; }} // namespace onnx::optimization
--- +++ @@ -14,7 +14,7 @@ std::string name; API_TYPE type; - explicit OptimizePass(const std::string name, API_TYPE type) + explicit OptimizePass(const std::string& name, API_TYPE type) : name(name), type(type) { }
Fix the constructor of OptimizePass
apache-2.0
onnx/onnx,onnx/onnx,onnx/onnx,onnx/onnx
dd15514211cdcdc037368e6b584dfe79e58f3535
#import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> #if __has_include(<React/RCTBridge.h>) // React Native >= 0.40 #import <React/RCTBridge.h> #else // React Native <= 0.39 #import "RCTBridge.h" #endif @class BugsnagConfiguration; @interface BugsnagReactNative: NSObject <RCTBridgeModule> /** * Initializes the crash handler with the default options and using the API key * stored in the Info.plist using the key "BugsnagAPIKey" */ + (void)start; /** * Initializes the crash handler with the default options * @param APIKey the API key to use when sending error reports */ + (void)startWithAPIKey:(NSString *)APIKey; /** * Initializes the crash handler with custom options * @param config the configuration options to use */ + (void)startWithConfiguration:(BugsnagConfiguration *)config; - (void)startWithOptions:(NSDictionary *)options; - (void)leaveBreadcrumb:(NSDictionary *)options; - (void)notify:(NSDictionary *)payload resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject; - (void)setUser:(NSDictionary *)userInfo; - (void)clearUser; - (void)startSession; @end
#import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> #if __has_include(<React/RCTBridge.h>) // React Native >= 0.40 #import <React/RCTBridge.h> #else // React Native <= 0.39 #import "RCTBridge.h" #endif @class BugsnagConfiguration; @interface BugsnagReactNative: NSObject <RCTBridgeModule> /** * Initializes the crash handler with the default options and using the API key * stored in the Info.plist using the key "BugsnagAPIKey" */ + (void)start; /** * Initializes the crash handler with the default options * @param APIKey the API key to use when sending error reports */ + (void)startWithAPIKey:(NSString *)APIKey; /** * Initializes the crash handler with custom options * @param config the configuration options to use */ + (void)startWithConfiguration:(BugsnagConfiguration *)config; - (void)startWithOptions:(NSDictionary *)options; - (void)leaveBreadcrumb:(NSDictionary *)options; - (void)notify:(NSDictionary *)payload; - (void)setUser:(NSDictionary *)userInfo; - (void)clearUser; - (void)startSession; @end
--- +++ @@ -32,7 +32,9 @@ - (void)startWithOptions:(NSDictionary *)options; - (void)leaveBreadcrumb:(NSDictionary *)options; -- (void)notify:(NSDictionary *)payload; +- (void)notify:(NSDictionary *)payload + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; - (void)setUser:(NSDictionary *)userInfo; - (void)clearUser; - (void)startSession;
fix: Synchronize decl and impl of notify(…)
mit
bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native
b933e0fbb8c85434bf54f772dd07b57e52440089
#include "random.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> void seed_random(void) { /* Single iteration of Xorshift to get a good seed. */ unsigned int seed = time(NULL) ^ getpid(); seed ^= (seed << 19); seed ^= (seed >> 11); seed ^= (seed << 9); fprintf(stderr, "seed = %u\n", seed); srandom(seed); } int random_range(int min, int max) { int range, bucket, remainder, r; range = max - min; bucket = RAND_MAX / range; remainder = RAND_MAX % range; while ((r = random()) > (RAND_MAX - remainder)) ; return min + (r / bucket); }
#include "random.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> void seed_random(void) { /* Single iteration of Xorshift to get a good seed. */ unsigned int seed = time(NULL) ^ getpid(); seed ^= (seed << 19); seed ^= (seed >> 11); seed ^= (seed << 9); printf("seed = %u\n", seed); srandom(seed); } int random_range(int min, int max) { int range, bucket, remainder, r; range = max - min; bucket = RAND_MAX / range; remainder = RAND_MAX % range; while ((r = random()) > (RAND_MAX - remainder)) ; return min + (r / bucket); }
--- +++ @@ -14,7 +14,7 @@ seed ^= (seed >> 11); seed ^= (seed << 9); - printf("seed = %u\n", seed); + fprintf(stderr, "seed = %u\n", seed); srandom(seed); }
Print seed to stderr, not stdout.
mit
ingramj/dice
bb2994d4d628484f1bb1befa0b7098db71d74a4d
// Copyright 2013 by Tetsuo Kiso // // 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 FAST_ALIGN_PORT_H_ #define FAST_ALIGN_PORT_H_ // As of OS X 10.9, it looks like C++ TR1 headers are removed from the // search paths. Instead, we can include C++11 headers. #if defined(__APPLE__) #include <AvailabilityMacros.h> #endif #if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && \ MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 #include <unordered_map> #include <functional> #else // Assuming older OS X, Linux or similar platforms #include <tr1/unordered_map> #include <tr1/functional> namespace std { using tr1::unordered_map; using tr1::hash; } // namespace std #endif #endif // FAST_ALIGN_PORT_H_
// Copyright 2013 by Tetsuo Kiso // // 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 FAST_ALIGN_PORT_H_ #define FAST_ALIGN_PORT_H_ // As of OS X 10.9, it looks like C++ TR1 headers are removed from the // search paths. Instead, we can include C++11 headers. #if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 #include <unordered_map> #include <functional> #else // Assuming older OS X, Linux or similar platforms #include <tr1/unordered_map> #include <tr1/functional> namespace std { using tr1::unordered_map; using tr1::hash; } // namespace std #endif #endif // FAST_ALIGN_PORT_H_
--- +++ @@ -17,7 +17,12 @@ // As of OS X 10.9, it looks like C++ TR1 headers are removed from the // search paths. Instead, we can include C++11 headers. -#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 +#if defined(__APPLE__) +#include <AvailabilityMacros.h> +#endif + +#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && \ + MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 #include <unordered_map> #include <functional> #else // Assuming older OS X, Linux or similar platforms
Include the OS X specific header to use OS specific macros.
apache-2.0
clab/fast_align,spanishdict/fast_align,LoreDema/fast_align,clab/fast_align,christianbuck/fast_align,LoreDema/fast_align,spanishdict/fast_align,christianbuck/fast_align
7e3576d2e120fb69cc360c976341bf5491bbb633
/* * Copyright 2015 Wink Saville * * 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 <ac_stop.h> #include <ac_printf.h> /** * Set memory to the given byte value * * @param s points to the array * @param val is a byte used to fill the array * @param count is an integer the size of a pointer * * @return = s */ void* ac_memset(void *s, ac_u8 val, ac_uptr count) { // TODO: Optimize ac_u8* pU8 = s; for(ac_uptr i = 0; i < count; i++) { *pU8++ = val; } return s; } /** * Set memory, compiler needs this for initializing structs and such. */ void* memset(void *s, int val, ac_size_t count) { return ac_memset(s, val, count); }
/* * Copyright 2015 Wink Saville * * 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 <ac_stop.h> #include <ac_printf.h> /** * Set memory to the given byte value * * @param s points to the array * @param val is a byte used to fill the array * @param count is an integer the size of a pointer * * @return = s */ void* ac_memset(void *s, ac_u8 val, ac_uptr count) { // TODO: Optimize ac_u8* pU8 = s; for(ac_uptr i = 0; i < count; i++) { *pU8++ = val; } return s; }
--- +++ @@ -35,3 +35,9 @@ return s; } +/** + * Set memory, compiler needs this for initializing structs and such. + */ +void* memset(void *s, int val, ac_size_t count) { + return ac_memset(s, val, count); +}
Add memset, needed by compiler for initializing structs and such
apache-2.0
winksaville/sadie,winksaville/sadie
26f5dea4e721592f0e64183b9d0a325174487231
// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') abc()" "typeof(expr: identifier) (aka 'long *') xyz()" long *x; __typeof(int *) ip; __typeof(int *) *a1; __typeof(int *) a2[2]; __typeof(int *) a3(); auto abc() -> __typeof(x) { } __typeof(x) xyz() { }
// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') xyz()" long *x; __typeof(int *) ip; __typeof(int *) *a1; __typeof(int *) a2[2]; __typeof(int *) a3(); __typeof(x) xyz() { }
--- +++ @@ -1,4 +1,4 @@ -// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') xyz()" +// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') abc()" "typeof(expr: identifier) (aka 'long *') xyz()" long *x; @@ -8,6 +8,10 @@ __typeof(int *) a2[2]; __typeof(int *) a3(); +auto abc() -> __typeof(x) +{ +} + __typeof(x) xyz() { }
Add trailing return type to type printing test
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
0b78dce3a2bd416375327b1e4436883da673009e
#pragma once #include "Sprite.h" #include "FontAsset.h" class Text : public Sprite { private: std::shared_ptr<FontAsset> asset; std::string str; public: Text(std::shared_ptr<FontAsset> asset, const std::string str, const Point2 pos = Point2(0), const Origin origin = Origin::BottomLeft, const Point4 color = Point4(1), const Point2 scale = Point2(-1)) : asset(asset), str(str), Sprite(pos, origin, color, scale) {} void RenderMe() override final { // we render the outline first to make a drop-shadow effect SDL(TTF_SetFontOutline(asset->font, 2)); SDL(surface = TTF_RenderUTF8_Blended(asset->font, str.data(), { 0, 0, 0, 255 })); // then we render the foreground and blit it on top of the outline SDL(TTF_SetFontOutline(asset->font, 0)); SDL_Surface *fg; SDL(fg = TTF_RenderUTF8_Blended(asset->font, str.data(), { 255, 255, 255, 255 })); SDL(SDL_BlitSurface(fg, NULL, surface, NULL)); SDL(SDL_FreeSurface(fg)); } void SetText(const std::string str) { this->str = str; Render(); } };
#pragma once #include "Sprite.h" #include "FontAsset.h" class Text : public Sprite { private: std::shared_ptr<FontAsset> asset; std::string str; public: Text(std::shared_ptr<FontAsset> asset, const std::string str, const Point2 pos = Point2(0), const Origin origin = Origin::BottomLeft, const Point4 color = Point4(1), const Point2 scale = Point2(-1)) : asset(asset), str(str), Sprite(pos, origin, color, scale) {} void RenderMe() override final { SDL(surface = TTF_RenderUTF8_Blended(asset->font, str.data(), { 255, 255, 255, 255 })); } void SetText(const std::string str) { this->str = str; Render(); } };
--- +++ @@ -13,7 +13,18 @@ : asset(asset), str(str), Sprite(pos, origin, color, scale) {} void RenderMe() override final { - SDL(surface = TTF_RenderUTF8_Blended(asset->font, str.data(), { 255, 255, 255, 255 })); + // we render the outline first to make a drop-shadow effect + + SDL(TTF_SetFontOutline(asset->font, 2)); + SDL(surface = TTF_RenderUTF8_Blended(asset->font, str.data(), { 0, 0, 0, 255 })); + + // then we render the foreground and blit it on top of the outline + + SDL(TTF_SetFontOutline(asset->font, 0)); + SDL_Surface *fg; + SDL(fg = TTF_RenderUTF8_Blended(asset->font, str.data(), { 255, 255, 255, 255 })); + SDL(SDL_BlitSurface(fg, NULL, surface, NULL)); + SDL(SDL_FreeSurface(fg)); } void SetText(const std::string str) {
Add black drop-shadow outline to text
mpl-2.0
shockkolate/polar4,shockkolate/polar4,polar-engine/polar,shockkolate/polar4,polar-engine/polar,shockkolate/polar4
28745fcea6f0fe7e26f565ab756bdc2bbb174abc
// http://stackoverflow.com/a/7933931/141220 #define TDTSuppressPerformSelectorLeakWarning(code) \ do { \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \ code; \ _Pragma("clang diagnostic pop") \ } while (0)
// http://stackoverflow.com/a/7933931/141220 #define TDTSuppressPerformSelectorLeakWarning(CODE) \ do { \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \ CODE; \ _Pragma("clang diagnostic pop") \ } while (0)
--- +++ @@ -1,10 +1,10 @@ // http://stackoverflow.com/a/7933931/141220 -#define TDTSuppressPerformSelectorLeakWarning(CODE) \ +#define TDTSuppressPerformSelectorLeakWarning(code) \ do { \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \ - CODE; \ + code; \ _Pragma("clang diagnostic pop") \ } while (0)
Revert to lowercase macro arguments They match the convention in `TDTAssert.h`
bsd-3-clause
talk-to/Chocolate,talk-to/Chocolate
85e2b7bbeecbae82e17051c1095642988a26de43
/* Author: Dan Wilder * * School: University of Missouri - St. Louis * Semester: Fall 2015 * Class: CS 3130 - Design and Analysis of Algorithms * Instructor: Galina N. Piatnitskaia */ #include "sort_algorithms.h" void swap(int *x, int *y) { int temp = *x; *x = *y *y = temp; } void bubbleSort(int arr[], int size) { /* with swaps counting. */ int i, j, swaps; for (i = 0; i <= size-1; ++i) { swaps = 0; for (j = size; j >= i+1; --j) if (arr[j] < arr[j-1]) { swap(&arr[j], &arr[j-1]); ++swaps; } if (swaps == 0) break; } }
/* Author: Dan Wilder * * School: University of Missouri - St. Louis * Semester: Fall 2015 * Class: CS 3130 - Design and Analysis of Algorithms * Instructor: Galina N. Piatnitskaia */ #include "sort_algorithms.h" void swap(int *x, int *y) { int temp = *x; *x = *y *y = temp; } void bubbleSort(int arr[], int size) { /* with swaps counting. */ int i, j; for (i = 0; i <= size-1; ++i) for (j = size; j >= i+1; --j) if (arr[j] < arr[j-1]) swap(&arr[j], &arr[j-1]); }
--- +++ @@ -17,9 +17,18 @@ void bubbleSort(int arr[], int size) { /* with swaps counting. */ - int i, j; - for (i = 0; i <= size-1; ++i) + int i, j, swaps; + + for (i = 0; i <= size-1; ++i) { + swaps = 0; + for (j = size; j >= i+1; --j) - if (arr[j] < arr[j-1]) + if (arr[j] < arr[j-1]) { swap(&arr[j], &arr[j-1]); + ++swaps; + } + + if (swaps == 0) + break; + } }
Add swap counting in bubbleSort
mit
sentientWilder/Search-and-Sort,sentientWilder/Search-and-Sort
c0e3faa7fc57ddefe8ecab3eca1fc866809c5def
#ifndef __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #define __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #include <pt/pt.h> class RCoRoutineRunner { public: RCoRoutineRunner(); virtual ~RCoRoutineRunner(); virtual char run(); public: struct pt mPt; }; #endif // __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C
#ifndef __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #define __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #include <pt.h> class RCoRoutineRunner { public: RCoRoutineRunner(); virtual ~RCoRoutineRunner(); virtual char run(); public: struct pt mPt; }; #endif // __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C
--- +++ @@ -1,7 +1,7 @@ #ifndef __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #define __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C -#include <pt.h> +#include <pt/pt.h> class RCoRoutineRunner {
Use protothread library which included in RabirdToolkitThirdParties
mit
starofrainnight/ArduinoRabirdToolkit,starofrainnight/ArduinoRabirdTookit,starofrainnight/ArduinoRabirdToolkit
56841922d1e0ee90cdd2bdf10c8fead846560897
/* * Header file for the definitions of packers/protectors * * Tim "diff" Strazzere <[email protected]> */ typedef struct { char* name; char* description; char* filter; char* marker; } packer; static packer packers[] = { // APKProtect { "APKProtect v1->5", "APKProtect generialized detection", // This is actually the filter APKProtect uses itself for finding it's own odex to modify ".apk@", "/libAPKProtect" }, // Bangcle (??) or something equally silly { "Bangcle (??) silly version", "Something silly used by malware", "classes.dex", "/app_lib/" }, // LIAPP { "LIAPP 'Egg' (v1->?)", "LockIn APP (lockincomp.com)", "LIAPPEgg.dex", "/LIAPPEgg" }, // Qihoo 'Monster' { "Qihoo 'Monster' (v1->?)", "Qihoo unknown version, code named 'monster'", "monster.dex", "/libprotectClass" } };
/* * Header file for the definitions of packers/protectors * * Tim "diff" Strazzere <[email protected]> */ typedef struct { char* name; char* description; char* filter; char* marker; } packer; static packer packers[] = { // APKProtect { "APKProtect v1->5", "APKProtect generialized detection", // This is actually the filter APKProtect uses itself for finding it's own odex to modify ".apk@", "/libAPKProtect" }, // LIAPP { "LIAPP 'Egg' (v1->?)", "LockIn APP (lockincomp.com)", "LIAPPEgg.dex", "/LIAPPEgg" }, // Qihoo 'Monster' { "Qihoo 'Monster' (v1->?)", "Qihoo unknown version, code named 'monster'", "monster.dex", "/libprotectClass" } };
--- +++ @@ -22,6 +22,14 @@ "/libAPKProtect" }, + // Bangcle (??) or something equally silly + { + "Bangcle (??) silly version", + "Something silly used by malware", + "classes.dex", + "/app_lib/" + }, + // LIAPP { "LIAPP 'Egg' (v1->?)",
Add detection for whatever silly protector new malware was using. Closes issue #22
apache-2.0
strazzere/android-unpacker,strazzere/android-unpacker
1009adc8cf7154d19c7ffebc2e35d70722076ea8
#ifndef _RSA_H_ #define _RSA_H_ #include "mpi.h" /* Everything must be kept private except for n and e. * (n,e) is the public key, (n,d) is the private key. */ typedef struct { mpi_t n; /* modulus n = pq */ mpi_t phi; /* phi = (p-1)(q-1) */ mpi_t e; /* public exponent 1 < e < phi s.t. gcd(e,phi)=1 */ mpi_t d; /* secret exponent 1 < d < phi s.t. ed=1 (mod phi) */ } rsa_ctx; void rsa_init(rsa_ctx *rsa, unsigned bits, mt64_context *rand_ctx); void rsa_free(rsa_ctx *rsa); /* Transform cleartext into encrypted data. */ void rsa_encrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); /* Transform encrypted data back to cleartext. */ void rsa_decrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); #endif /* !_RSA_H_ */
#ifndef _RSA_H_ #define _RSA_H_ #include "mpi.h" /* Everything must be kept private except for n and e. * (n,e) is the public key, (n,d) is the private key. */ typedef struct { mpi_t n; /* modulus n = pq */ mpi_t phi; /* phi = (p-1)(q-1) */ mpi_t e; /* public exponent 1 < e < phi s.t. gcd(e,phi)=1 */ mpi_t d; /* secret exponent 1 < d < phi s.t. ed=1 (mod phi) */ } rsa_ctx; void rsa_init(rsa_ctx *rsa, unsigned bits, mp_rand_ctx *rand_ctx); void rsa_free(rsa_ctx *rsa); /* Transform cleartext into encrypted data. */ void rsa_encrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); /* Transform encrypted data back to cleartext. */ void rsa_decrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); #endif /* !_RSA_H_ */
--- +++ @@ -12,7 +12,7 @@ mpi_t d; /* secret exponent 1 < d < phi s.t. ed=1 (mod phi) */ } rsa_ctx; -void rsa_init(rsa_ctx *rsa, unsigned bits, mp_rand_ctx *rand_ctx); +void rsa_init(rsa_ctx *rsa, unsigned bits, mt64_context *rand_ctx); void rsa_free(rsa_ctx *rsa); /* Transform cleartext into encrypted data. */
Use mt64_context instead of mp_rand_ctx
bsd-2-clause
fmela/weecrypt,fmela/weecrypt
697549c5dc3f200b4bc13971fe4cc19aa4bd2c74
// // SloppySwiper.h // // Created by Arkadiusz on 29-05-14. // #import <Foundation/Foundation.h> @interface SloppySwiper : NSObject <UINavigationControllerDelegate> /// Gesture recognizer used to recognize swiping to the right. @property (weak, nonatomic) UIPanGestureRecognizer *panRecognizer; /// Designated initializer if the class isn't used from the Interface Builder. - (instancetype)initWithNavigationController:(UINavigationController *)navigationController; @end
// // SloppySwiper.h // // Created by Arkadiusz on 29-05-14. // #import <Foundation/Foundation.h> @interface SloppySwiper : NSObject <UINavigationControllerDelegate> // Designated initializer if the class isn't set in the Interface Builder. - (instancetype)initWithNavigationController:(UINavigationController *)navigationController; @end
--- +++ @@ -8,7 +8,10 @@ @interface SloppySwiper : NSObject <UINavigationControllerDelegate> -// Designated initializer if the class isn't set in the Interface Builder. +/// Gesture recognizer used to recognize swiping to the right. +@property (weak, nonatomic) UIPanGestureRecognizer *panRecognizer; + +/// Designated initializer if the class isn't used from the Interface Builder. - (instancetype)initWithNavigationController:(UINavigationController *)navigationController; @end
Improve comments in the header file
mit
toc2menow/SloppySwiper,ssowonny/SloppySwiper,stephenbalaban/SloppySwiper,fastred/SloppySwiper,msdgwzhy6/SloppySwiper,igroomgrim/SloppySwiper,barrettj/SloppySwiper,yusuga/SloppySwiper,xuvw/SloppySwiper
e77d038d2bed3605d18c83152402a5ddfd7255dd
#include "fitz_base.h" #include "fitz_stream.h" fz_error fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out) { fz_error reason; unsigned char *oldrp; unsigned char *oldwp; oldrp = in->rp; oldwp = out->wp; if (f->done) return fz_iodone; assert(!out->eof); reason = f->process(f, in, out); assert(in->rp <= in->wp); assert(out->wp <= out->ep); f->consumed = in->rp > oldrp; f->produced = out->wp > oldwp; f->count += out->wp - oldwp; /* iodone or error */ if (reason != fz_ioneedin && reason != fz_ioneedout) { if (reason != fz_iodone) reason = fz_rethrow(reason, "cannot process filter"); out->eof = 1; f->done = 1; } return reason; } fz_filter * fz_keepfilter(fz_filter *f) { f->refs ++; return f; } void fz_dropfilter(fz_filter *f) { if (--f->refs == 0) { if (f->drop) f->drop(f); fz_free(f); } }
#include "fitz_base.h" #include "fitz_stream.h" fz_error fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out) { fz_error reason; unsigned char *oldrp; unsigned char *oldwp; assert(!out->eof); oldrp = in->rp; oldwp = out->wp; if (f->done) return fz_iodone; reason = f->process(f, in, out); assert(in->rp <= in->wp); assert(out->wp <= out->ep); f->consumed = in->rp > oldrp; f->produced = out->wp > oldwp; f->count += out->wp - oldwp; /* iodone or error */ if (reason != fz_ioneedin && reason != fz_ioneedout) { if (reason != fz_iodone) reason = fz_rethrow(reason, "cannot process filter"); out->eof = 1; f->done = 1; } return reason; } fz_filter * fz_keepfilter(fz_filter *f) { f->refs ++; return f; } void fz_dropfilter(fz_filter *f) { if (--f->refs == 0) { if (f->drop) f->drop(f); fz_free(f); } }
--- +++ @@ -8,13 +8,13 @@ unsigned char *oldrp; unsigned char *oldwp; - assert(!out->eof); - oldrp = in->rp; oldwp = out->wp; if (f->done) return fz_iodone; + + assert(!out->eof); reason = f->process(f, in, out);
Move assert test of EOF to after testing if a filter is done.
agpl-3.0
tophyr/mupdf,PuzzleFlow/mupdf,derek-watson/mupdf,cgogolin/penandpdf,ArtifexSoftware/mupdf,asbloomf/mupdf,lamemate/mupdf,lolo32/mupdf-mirror,lolo32/mupdf-mirror,loungeup/mupdf,knielsen/mupdf,kobolabs/mupdf,asbloomf/mupdf,TamirEvan/mupdf,hjiayz/forkmupdf,hackqiang/mupdf,seagullua/MuPDF,MokiMobility/muPDF,nqv/mupdf,sebras/mupdf,poor-grad-student/mupdf,benoit-pierre/mupdf,Kalp695/mupdf,ArtifexSoftware/mupdf,lolo32/mupdf-mirror,robamler/mupdf-nacl,ArtifexSoftware/mupdf,Kalp695/mupdf,derek-watson/mupdf,TamirEvan/mupdf,isavin/humblepdf,knielsen/mupdf,tribals/mupdf,lolo32/mupdf-mirror,lamemate/mupdf,michaelcadilhac/pdfannot,seagullua/MuPDF,geetakaur/NewApps,cgogolin/penandpdf,MokiMobility/muPDF,benoit-pierre/mupdf,michaelcadilhac/pdfannot,ArtifexSoftware/mupdf,PuzzleFlow/mupdf,FabriceSalvaire/mupdf-cmake,robamler/mupdf-nacl,lustersir/MuPDF,xiangxw/mupdf,wild0/opened_mupdf,FabriceSalvaire/mupdf-v1.3,poor-grad-student/mupdf,cgogolin/penandpdf,clchiou/mupdf,derek-watson/mupdf,sebras/mupdf,isavin/humblepdf,hxx0215/MuPDFMirror,FabriceSalvaire/mupdf-cmake,wzhsunn/mupdf,clchiou/mupdf,lamemate/mupdf,tophyr/mupdf,FabriceSalvaire/mupdf-v1.3,geetakaur/NewApps,wild0/opened_mupdf,FabriceSalvaire/mupdf-cmake,issuestand/mupdf,FabriceSalvaire/mupdf-v1.3,github201407/MuPDF,seagullua/MuPDF,TamirEvan/mupdf,github201407/MuPDF,cgogolin/penandpdf,zeniko/mupdf,fluks/mupdf-x11-bookmarks,ccxvii/mupdf,TamirEvan/mupdf,asbloomf/mupdf,wzhsunn/mupdf,ArtifexSoftware/mupdf,flipstudio/MuPDF,hjiayz/forkmupdf,xiangxw/mupdf,lolo32/mupdf-mirror,ziel/mupdf,benoit-pierre/mupdf,sebras/mupdf,fluks/mupdf-x11-bookmarks,wzhsunn/mupdf,flipstudio/MuPDF,kobolabs/mupdf,fluks/mupdf-x11-bookmarks,flipstudio/MuPDF,github201407/MuPDF,hxx0215/MuPDFMirror,crow-misia/mupdf,ArtifexSoftware/mupdf,hxx0215/MuPDFMirror,xiangxw/mupdf,Kalp695/mupdf,hackqiang/mupdf,lolo32/mupdf-mirror,zeniko/mupdf,seagullua/MuPDF,muennich/mupdf,sebras/mupdf,MokiMobility/muPDF,issuestand/mupdf,ylixir/mupdf,ccxvii/mupdf,ziel/mupdf,asbloomf/mupdf,samturneruk/mupdf_secure_android,clchiou/mupdf,flipstudio/MuPDF,samturneruk/mupdf_secure_android,nqv/mupdf,hackqiang/mupdf,crow-misia/mupdf,nqv/mupdf,isavin/humblepdf,seagullua/MuPDF,geetakaur/NewApps,TamirEvan/mupdf,ylixir/mupdf,robamler/mupdf-nacl,ccxvii/mupdf,hackqiang/mupdf,seagullua/MuPDF,Kalp695/mupdf,FabriceSalvaire/mupdf-v1.3,crow-misia/mupdf,benoit-pierre/mupdf,ArtifexSoftware/mupdf,tophyr/mupdf,derek-watson/mupdf,samturneruk/mupdf_secure_android,isavin/humblepdf,poor-grad-student/mupdf,loungeup/mupdf,ziel/mupdf,lustersir/MuPDF,ziel/mupdf,ylixir/mupdf,TamirEvan/mupdf,knielsen/mupdf,wzhsunn/mupdf,lustersir/MuPDF,TamirEvan/mupdf,loungeup/mupdf,andyhan/mupdf,knielsen/mupdf,lustersir/MuPDF,tribals/mupdf,derek-watson/mupdf,wzhsunn/mupdf,xiangxw/mupdf,FabriceSalvaire/mupdf-v1.3,PuzzleFlow/mupdf,zeniko/mupdf,zeniko/mupdf,hjiayz/forkmupdf,FabriceSalvaire/mupdf-cmake,asbloomf/mupdf,wzhsunn/mupdf,muennich/mupdf,knielsen/mupdf,andyhan/mupdf,wild0/opened_mupdf,andyhan/mupdf,crow-misia/mupdf,ccxvii/mupdf,kobolabs/mupdf,MokiMobility/muPDF,ylixir/mupdf,loungeup/mupdf,samturneruk/mupdf_secure_android,sebras/mupdf,samturneruk/mupdf_secure_android,flipstudio/MuPDF,xiangxw/mupdf,wild0/opened_mupdf,kobolabs/mupdf,wild0/opened_mupdf,lamemate/mupdf,samturneruk/mupdf_secure_android,github201407/MuPDF,crow-misia/mupdf,hackqiang/mupdf,wild0/opened_mupdf,issuestand/mupdf,andyhan/mupdf,benoit-pierre/mupdf,fluks/mupdf-x11-bookmarks,muennich/mupdf,lolo32/mupdf-mirror,benoit-pierre/mupdf,hjiayz/forkmupdf,PuzzleFlow/mupdf,michaelcadilhac/pdfannot,andyhan/mupdf,Kalp695/mupdf,hxx0215/MuPDFMirror,FabriceSalvaire/mupdf-v1.3,zeniko/mupdf,derek-watson/mupdf,FabriceSalvaire/mupdf-cmake,lamemate/mupdf,cgogolin/penandpdf,MokiMobility/muPDF,robamler/mupdf-nacl,cgogolin/penandpdf,lustersir/MuPDF,clchiou/mupdf,tribals/mupdf,tophyr/mupdf,ArtifexSoftware/mupdf,fluks/mupdf-x11-bookmarks,tophyr/mupdf,zeniko/mupdf,loungeup/mupdf,FabriceSalvaire/mupdf-cmake,sebras/mupdf,kobolabs/mupdf,geetakaur/NewApps,ylixir/mupdf,issuestand/mupdf,github201407/MuPDF,tribals/mupdf,ccxvii/mupdf,poor-grad-student/mupdf,poor-grad-student/mupdf,tophyr/mupdf,poor-grad-student/mupdf,ziel/mupdf,hxx0215/MuPDFMirror,Kalp695/mupdf,muennich/mupdf,kobolabs/mupdf,hxx0215/MuPDFMirror,issuestand/mupdf,hjiayz/forkmupdf,hjiayz/forkmupdf,isavin/humblepdf,knielsen/mupdf,nqv/mupdf,kobolabs/mupdf,xiangxw/mupdf,PuzzleFlow/mupdf,github201407/MuPDF,muennich/mupdf,nqv/mupdf,isavin/humblepdf,geetakaur/NewApps,wild0/opened_mupdf,muennich/mupdf,fluks/mupdf-x11-bookmarks,geetakaur/NewApps,fluks/mupdf-x11-bookmarks,michaelcadilhac/pdfannot,issuestand/mupdf,michaelcadilhac/pdfannot,robamler/mupdf-nacl,xiangxw/mupdf,isavin/humblepdf,asbloomf/mupdf,clchiou/mupdf,tribals/mupdf,clchiou/mupdf,muennich/mupdf,ccxvii/mupdf,ziel/mupdf,ylixir/mupdf,michaelcadilhac/pdfannot,nqv/mupdf,robamler/mupdf-nacl,MokiMobility/muPDF,andyhan/mupdf,TamirEvan/mupdf,tribals/mupdf,PuzzleFlow/mupdf,crow-misia/mupdf,Kalp695/mupdf,lamemate/mupdf,hackqiang/mupdf,loungeup/mupdf,flipstudio/MuPDF,lustersir/MuPDF,PuzzleFlow/mupdf
f86f4873e8aef4d54ea45abc70b5f45af204186a
// // Created by Dawid Drozd aka Gelldur on 05.02.16. // #pragma once #include <string> #include <memory> #include <api/ApiThreadPool.h> #include <data/Preferences.h> #include <platform/Bridge.h> #include <screen/ScreenCreator.h> #include "UILoop.h" class Application { public: Application(CrossMobile::Platform::Bridge* bridge, ScreenCreator* screenCreator); virtual ~Application() = default; virtual void onCreate(); virtual void startScreen(const std::string& screenName); UILoop& getUILoop() { return _uiLoop; } ApiThreadPool& getApiThreadPool() { return _apiThreadPool; } Preferences& getPreferences() { return _preferences; } const std::unique_ptr<ScreenCreator>& getScreenCreator() const; CrossMobile::Platform::Bridge& getBridge(); static Application* getInstance(); private: UILoop _uiLoop; ApiThreadPool _apiThreadPool; Preferences _preferences; std::unique_ptr<CrossMobile::Platform::Bridge> _bridge; std::unique_ptr<ScreenCreator> _screenCreator; };
// // Created by Dawid Drozd aka Gelldur on 05.02.16. // #pragma once #include <string> #include <memory> #include <api/ApiThreadPool.h> #include <data/Preferences.h> #include <platform/Bridge.h> #include <screen/ScreenCreator.h> #include "UILoop.h" class Application { public: Application(CrossMobile::Platform::Bridge* bridge, ScreenCreator* screenCreator); virtual ~Application() = default; virtual void onCreate(); virtual void startScreen(const std::string& screenName); UILoop& getUILoop() { return _uiLoop; } ApiThreadPool& getApiThreadPool() { return *_apiThreadPool; } Preferences& getPreferences() { return _preferences; } const std::unique_ptr<ScreenCreator>& getScreenCreator() const; CrossMobile::Platform::Bridge& getBridge(); static Application* getInstance(); private: UILoop _uiLoop; std::unique_ptr<ApiThreadPool> _apiThreadPool; Preferences _preferences; std::unique_ptr<CrossMobile::Platform::Bridge> _bridge; std::unique_ptr<ScreenCreator> _screenCreator; };
--- +++ @@ -31,7 +31,7 @@ ApiThreadPool& getApiThreadPool() { - return *_apiThreadPool; + return _apiThreadPool; } Preferences& getPreferences() @@ -47,7 +47,7 @@ private: UILoop _uiLoop; - std::unique_ptr<ApiThreadPool> _apiThreadPool; + ApiThreadPool _apiThreadPool; Preferences _preferences; std::unique_ptr<CrossMobile::Platform::Bridge> _bridge; std::unique_ptr<ScreenCreator> _screenCreator;
Fix ApiThreadPool after android changes
apache-2.0
gelldur/DexodeEngine,gelldur/DexodeEngine,gelldur/DexodeEngine
1210d9a9faf1f60edd489b74c9b74414fcacb6c2
#include "Inputs/zeroFunctionFile.h" int foo(int x) { return NOFUNCTIONS(x); } int main() { return foo(2); } // RUN: llvm-profdata merge %S/Inputs/zeroFunctionFile.proftext -o %t.profdata // RUN: llvm-cov report %S/Inputs/zeroFunctionFile.covmapping -instr-profile %t.profdata 2>&1 | FileCheck --check-prefix=REPORT --strict-whitespace %s // REPORT: 0 0 - 0 0 - 0 0 - 0 0 - // REPORT-NO: 0% // RUN: llvm-cov show -j 1 %S/Inputs/zeroFunctionFile.covmapping -format html -instr-profile %t.profdata -o %t.dir // RUN: FileCheck %s -input-file=%t.dir/index.html -check-prefix=HTML // HTML: <td class='column-entry-green'><pre>- (0/0) // HTML-NO: 0.00% (0/0)
#include "Inputs/zeroFunctionFile.h" int foo(int x) { return NOFUNCTIONS(x); } int main() { return foo(2); } // RUN: llvm-profdata merge %S/Inputs/zeroFunctionFile.proftext -o %t.profdata // RUN: llvm-cov report %S/Inputs/zeroFunctionFile.covmapping -instr-profile %t.profdata 2>&1 | FileCheck --check-prefix=REPORT --strict-whitespace %s // REPORT: 0 0 - 0 0 - 0 0 - 0 0 - // REPORT-NO: 0% // RUN: llvm-cov show %S/Inputs/zeroFunctionFile.covmapping -format html -instr-profile %t.profdata -o %t.dir // RUN: FileCheck %s -input-file=%t.dir/index.html -check-prefix=HTML // HTML: <td class='column-entry-green'><pre>- (0/0) // HTML-NO: 0.00% (0/0)
--- +++ @@ -13,7 +13,7 @@ // REPORT: 0 0 - 0 0 - 0 0 - 0 0 - // REPORT-NO: 0% -// RUN: llvm-cov show %S/Inputs/zeroFunctionFile.covmapping -format html -instr-profile %t.profdata -o %t.dir +// RUN: llvm-cov show -j 1 %S/Inputs/zeroFunctionFile.covmapping -format html -instr-profile %t.profdata -o %t.dir // RUN: FileCheck %s -input-file=%t.dir/index.html -check-prefix=HTML // HTML: <td class='column-entry-green'><pre>- (0/0) // HTML-NO: 0.00% (0/0)
[llvm-cov] Disable threading in a test. NFC. PR30735 reports an issue where llvm-cov hangs with a worker thread waiting on a condition, and the main thread waiting to join() the workers. While this doesn't appear to be a bug in llvm-cov or the ThreadPool implementation, it would be helpful to disable the use of threading in the llvm-cov tests where no test coverage is added. More context: https://bugs.llvm.org/show_bug.cgi?id=30735 git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@307610 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm
8d7d203342f1573938e99d984ca335f05e1415bb
#include <string.h> #include "proxrcmds.h" #include "sim-hab.h" void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value) { double data; double content; int id; bionet_node_t *node; bionet_value_get_double(value, &data); if(data < 0 || data > 255) return; node = bionet_resource_get_node(resource); // get index of resource //FIXME: probably a better way to do this for(int i=0; i<16; i++) { char buf[5]; char name[24]; strcpy(name, "Potentiometer\0"); sprintf(buf,"%d", i); int len = strlen(buf); buf[len] = '\0'; strcat(name, buf); if(bionet_resource_matches_id(resource, name)) { id = i; // command proxr to adjust to new value set_potentiometer(id, (int)data); // set resources datapoint to new value content = data*POT_CONVERSION; bionet_resource_set_double(resource, content, NULL); hab_report_datapoints(node); return; } } }
#include <string.h> #include "proxrcmds.h" #include "sim-hab.h" void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value) { double data; double content; int id; bionet_node_t *node; bionet_value_get_float(value, &data); if(data < 0 || data > 255) return; node = bionet_resource_get_node(resource); // get index of resource //FIXME: probably a better way to do this for(int i=0; i<16; i++) { char buf[5]; char name[24]; strcpy(name, "Potentiometer\0"); sprintf(buf,"%d", i); int len = strlen(buf); buf[len] = '\0'; strcat(name, buf); if(bionet_resource_matches_id(resource, name)) { id = i; // command proxr to adjust to new value set_potentiometer(id, (int)data); // set resources datapoint to new value content = data*POT_CONVERSION; bionet_resource_set_double(resource, content, NULL); hab_report_datapoints(node); return; } } }
--- +++ @@ -9,7 +9,7 @@ int id; bionet_node_t *node; - bionet_value_get_float(value, &data); + bionet_value_get_double(value, &data); if(data < 0 || data > 255) return;
Change another float to double.
lgpl-2.1
ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead
59d679f48e3c528ed883b8d0142b2e5086b2d45c
/* * Modified version of Keypoint.h * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h */ #pragma once #ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H #define REVERSE_IMAGE_SEARCH_KEYPOINT_H #include <iostream> #include <sstream> #include <math.h> using namespace std; class KeyPoint { public: double x_, y_; KeyPoint(double x, double y) { x_ = x; y_ = y; }; /** * Convert a KeyPoint to a string * @return string */ string ToString() { std::ostringstream string_stream_; string_stream_<< "KeyPoint[ " << x_ << ", " << y_ << "]"; return string_stream_.str(); } }; namespace std { template <> struct hash<KeyPoint> { std::size_t operator()(const KeyPoint &k) const { using std::hash; return ((hash<double>()(k.x_) ^ (hash<double>()(k.y_) << 1)) >> 1); } }; } #endif
/* * Modified version of Keypoint.h * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h */ #pragma once #ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H #define REVERSE_IMAGE_SEARCH_KEYPOINT_H #include <iostream> #include <sstream> using namespace std; class KeyPoint { public: double x_, y_; KeyPoint(double x, double y) { x_ = x; y_ = y; }; /** * Convert a KeyPoint to a string * @return string */ string ToString() { std::ostringstream string_stream_; string_stream_<< "KeyPoint[ " << x_ << ", " << y_ << "]"; return string_stream_.str(); } }; namespace hash { template <> struct hash<KeyPoint> { std::size_t operator()(const KeyPoint &k) const { using std::hash; return ((hash<double>()(k.x_) ^ (hash<double>()(k.y_) << 1)) >> 1); } }; } #endif
--- +++ @@ -8,6 +8,7 @@ #include <iostream> #include <sstream> +#include <math.h> using namespace std; @@ -30,7 +31,7 @@ } }; -namespace hash { +namespace std { template <> struct hash<KeyPoint> { std::size_t operator()(const KeyPoint &k) const {
Resolve compilation issue due to missing math.h inclusion
mit
rmcqueen/reverse-image-search
58aa106997fb828a292457b0668e8497fa253f7d
#ifndef KISS_TEMPLATES_KISTE_H #define KISS_TEMPLATES_KISTE_H #include <kiste/terminal.h> #include <kiste/raw.h> #endif
#ifndef KISS_TEMPLATES_KISTE_H #define KISS_TEMPLATES_KISTE_H #include <kiste/terminal.h> #include <kiste/raw.h> namespace kiste { struct terminal_t { }; constexpr auto terminal = terminal_t{}; struct raw { std::ostream& _os; template <typename T> auto operator()(T&& t) const -> void { _os << std::forward<T>(t); } }; } #endif
--- +++ @@ -4,23 +4,4 @@ #include <kiste/terminal.h> #include <kiste/raw.h> -namespace kiste -{ - struct terminal_t - { - }; - constexpr auto terminal = terminal_t{}; - - struct raw - { - std::ostream& _os; - - template <typename T> - auto operator()(T&& t) const -> void - { - _os << std::forward<T>(t); - } - }; -} - #endif
Remove types left over from header split
bsd-2-clause
rbock/kiss-templates,AndiDog/kiss-templates,rbock/kiss-templates,AndiDog/kiss-templates,AndiDog/kiss-templates,rbock/kiss-templates
452bc34d386c7158c042e2059b6a020ddd4a7e7f
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config/helper/configfetcher.h> #include <vespa/config/subscription/configuri.h> #include <vespa/config-stateserver.h> namespace vespalib { struct HealthProducer; struct MetricsProducer; struct ComponentConfigProducer; class StateServer; } namespace slobrok { class ReconfigurableStateServer : private config::IFetcherCallback<vespa::config::core::StateserverConfig> { public: ReconfigurableStateServer(const config::ConfigUri & configUri, vespalib::HealthProducer & healt, vespalib::MetricsProducer & metrics, vespalib::ComponentConfigProducer & component); ~ReconfigurableStateServer(); private: void configure(std::unique_ptr<vespa::config::core::StateserverConfig> config) override; vespalib::HealthProducer & _health; vespalib::MetricsProducer & _metrics; vespalib::ComponentConfigProducer & _components; std::unique_ptr<config::ConfigFetcher> _configFetcher; std::unique_ptr<vespalib::StateServer> _server; }; }
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config/helper/configfetcher.h> #include <vespa/config/subscription/configuri.h> #include <vespa/config-stateserver.h> namespace vespalib { class HealthProducer; class MetricsProducer; class ComponentConfigProducer; class StateServer; } namespace slobrok { class ReconfigurableStateServer : private config::IFetcherCallback<vespa::config::core::StateserverConfig> { public: ReconfigurableStateServer(const config::ConfigUri & configUri, vespalib::HealthProducer & healt, vespalib::MetricsProducer & metrics, vespalib::ComponentConfigProducer & component); ~ReconfigurableStateServer(); private: void configure(std::unique_ptr<vespa::config::core::StateserverConfig> config) override; vespalib::HealthProducer & _health; vespalib::MetricsProducer & _metrics; vespalib::ComponentConfigProducer & _components; std::unique_ptr<config::ConfigFetcher> _configFetcher; std::unique_ptr<vespalib::StateServer> _server; }; }
--- +++ @@ -5,9 +5,9 @@ #include <vespa/config-stateserver.h> namespace vespalib { - class HealthProducer; - class MetricsProducer; - class ComponentConfigProducer; + struct HealthProducer; + struct MetricsProducer; + struct ComponentConfigProducer; class StateServer; } namespace slobrok {
Adjust forward declarations in slobrok.
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
24aa328ddab86fd861961b1d68091d334d773d75
/* * dremf() wrapper for remainderf(). * * Written by J.T. Conklin, <[email protected]> * Placed into the Public Domain, 1994. */ /* $FreeBSD$ */ #include "math.h" #include "math_private.h" float dremf(float x, float y) { return remainderf(x, y); }
/* * dremf() wrapper for remainderf(). * * Written by J.T. Conklin, <[email protected]> * Placed into the Public Domain, 1994. */ #include "math.h" #include "math_private.h" float dremf(x, y) float x, y; { return remainderf(x, y); }
--- +++ @@ -4,13 +4,13 @@ * Written by J.T. Conklin, <[email protected]> * Placed into the Public Domain, 1994. */ +/* $FreeBSD$ */ #include "math.h" #include "math_private.h" float -dremf(x, y) - float x, y; +dremf(float x, float y) { return remainderf(x, y); }
Work around known GCC 3.4.x problem and use ANSI prototype for dremf().
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
d037fe2cca7e0cdc8bfe48b67480201458d083d0
#include "redislite.h" #include "page_string.h" #include "util.h" #include <string.h> #include <stdlib.h> #include <math.h> void redislite_free_freelist(void *_db, void *_page) { redislite_page_string* page = (redislite_page_string*)_page; if (page == NULL) return; redislite_free(page); } void redislite_write_freelist(void *_db, unsigned char *data, void *_page) { redislite *db = (redislite*)_db; redislite_page_string* page = (redislite_page_string*)_page; if (page == NULL) return; redislite_put_4bytes(&data[0], 0); // reserverd redislite_put_4bytes(&data[4], page->right_page); int size = db->page_size-8; memset(&data[8], 0, size); } void *redislite_read_freelist(void *_db, unsigned char *data) { redislite_page_string* page = redislite_malloc(sizeof(redislite_page_string)); page->right_page = redislite_get_4bytes(&data[8]); return page; }
#include "redislite.h" #include "page_string.h" #include "util.h" #include <string.h> #include <stdlib.h> #include <math.h> void redislite_free_freelist(void *_db, void *_page) { redislite_page_string* page = (redislite_page_string*)_page; if (page == NULL) return; redislite_free(page); } void redislite_write_freelist(void *_db, unsigned char *data, void *_page) { redislite *db = (redislite*)_db; redislite_page_string* page = (redislite_page_string*)_page; if (page == NULL) return; data[0] = REDISLITE_PAGE_TYPE_FREELIST; redislite_put_4bytes(&data[1], 0); // reserverd redislite_put_4bytes(&data[5], page->right_page); int size = db->page_size-9; memset(&data[9], 0, size); } void *redislite_read_freelist(void *_db, unsigned char *data) { redislite_page_string* page = redislite_malloc(sizeof(redislite_page_string)); page->right_page = redislite_get_4bytes(&data[5]); return page; }
--- +++ @@ -19,18 +19,15 @@ redislite_page_string* page = (redislite_page_string*)_page; if (page == NULL) return; - data[0] = REDISLITE_PAGE_TYPE_FREELIST; - redislite_put_4bytes(&data[1], 0); // reserverd - redislite_put_4bytes(&data[5], page->right_page); - int size = db->page_size-9; - memset(&data[9], 0, size); + redislite_put_4bytes(&data[0], 0); // reserverd + redislite_put_4bytes(&data[4], page->right_page); + int size = db->page_size-8; + memset(&data[8], 0, size); } void *redislite_read_freelist(void *_db, unsigned char *data) { redislite_page_string* page = redislite_malloc(sizeof(redislite_page_string)); - - page->right_page = redislite_get_4bytes(&data[5]); - + page->right_page = redislite_get_4bytes(&data[8]); return page; }
Remove unused byte in freelist
bsd-2-clause
pombredanne/redislite,seppo0010/redislite,pombredanne/redislite,seppo0010/redislite
88238b76084bb7d7e5f2c54a0b4fc56b446af1c4
#ifndef __HIREDIS_FMACRO_H #define __HIREDIS_FMACRO_H #if defined(__linux__) #define _BSD_SOURCE #define _DEFAULT_SOURCE #endif #if defined(__sun__) #define _POSIX_C_SOURCE 200112L #else #define _XOPEN_SOURCE 600 #endif #if __APPLE__ && __MACH__ #define _OSX #endif #endif
#ifndef __HIREDIS_FMACRO_H #define __HIREDIS_FMACRO_H #if defined(__linux__) #define _BSD_SOURCE #define _DEFAULT_SOURCE #endif #if defined(__sun__) #define _POSIX_C_SOURCE 200112L #elif defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) #define _XOPEN_SOURCE 600 #else #define _XOPEN_SOURCE #endif #if __APPLE__ && __MACH__ #define _OSX #endif #endif
--- +++ @@ -8,10 +8,8 @@ #if defined(__sun__) #define _POSIX_C_SOURCE 200112L -#elif defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) +#else #define _XOPEN_SOURCE 600 -#else -#define _XOPEN_SOURCE #endif #if __APPLE__ && __MACH__
Fix strerror_r on some esoteric platforms Defining _XOPEN_SOURCE=1 causes strange behavior on Debian kfreebsd archs (i.e. GNU userspace with FreeBSD kernel) when _GNU_SOURCE is not defined. Not sure I fully understand the bizarre semantics, but it seems to use the XSI-compliant interface (int strerror_r(int, char*, size_t)) but the GNU implementation (char *strerror_r(int, char*, size_t)) such that strerror_r returns 32-bits of a 64-bit char * on x86_64 kfreebsd. We would expect strerror_r to return zero when using the XSI-compliant strerror_r implementation or a 64-bit char* when using the GNU version. Instead, we get something in between! Unless I'm missing something, being more explicit about what version of _XOPEN_SOURCE we want seems to be the prudent thing to do here -- and if folks want the GNU implementation of strerror_r for some reason they can always -D_GNU_SOURCE explicitly.
bsd-3-clause
thomaslee/hiredis,thomaslee/hiredis,jinguoli/hiredis,owent-contrib/hiredis,owent-contrib/hiredis,redis/hiredis,redis/hiredis,jinguoli/hiredis,redis/hiredis,jinguoli/hiredis,charsyam/hiredis,charsyam/hiredis
bb1747b1bf92431e5c5e9699824d2ef52f863f45
#include <Instrument.h> // the base class for this instrument class MYINST : public Instrument { public: MYINST(); virtual ~MYINST(); virtual int init(double *, int); virtual int configure(); virtual int run(); private: void doupdate(); float *_in; int _nargs, _inchan, _branch; float _amp, _pan; };
#include <Instrument.h> // the base class for this instrument class MYINST : public Instrument { public: MYINST(); virtual ~MYINST(); virtual int init(double *, int); virtual int configure(); virtual int run(); private: void doupdate(); int _nargs, _inchan, _branch; float _amp, _pan; float *_in; };
--- +++ @@ -12,8 +12,8 @@ private: void doupdate(); + float *_in; int _nargs, _inchan, _branch; float _amp, _pan; - float *_in; };
Change order of declarations to suppress compiler warning.
apache-2.0
RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix
cdc4160c8aff31bdb7859285d021f5a122ed755d
#import <Foundation/Foundation.h> #ifndef CMHErrors_h #define CMHErrors_h static NSString *const CMHErrorDomain = @"me.cloudmine.CMHealth.ErrorDomain"; typedef NS_ENUM(NSUInteger, CMHError) { CMHErrorUserMissingConsent = 700, CMHErrorUserMissingSignature = 701, CMHErrorUserDidNotConsent = 702, CMHErrorUserDidNotProvideName = 703, CMHErrorUserDidNotSign = 704 }; #endif
#import <Foundation/Foundation.h> #ifndef CMHErrors_h #define CMHErrors_h static NSString *const CMHErrorDomain = @"CMHErrorDomain"; typedef NS_ENUM(NSUInteger, CMHError) { CMHErrorUserMissingConsent = 700, CMHErrorUserMissingSignature = 701, CMHErrorUserDidNotConsent = 702, CMHErrorUserDidNotProvideName = 703, CMHErrorUserDidNotSign = 704 }; #endif
--- +++ @@ -3,7 +3,7 @@ #ifndef CMHErrors_h #define CMHErrors_h -static NSString *const CMHErrorDomain = @"CMHErrorDomain"; +static NSString *const CMHErrorDomain = @"me.cloudmine.CMHealth.ErrorDomain"; typedef NS_ENUM(NSUInteger, CMHError) { CMHErrorUserMissingConsent = 700,
Use Apple recommended format for error domain string
mit
cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK
9d4afff04d96cc793aaddd386f8d138652ed9d6c
#include <stdio.h> #include <stdlib.h> #include "error.h" #include "memory.h" #define READ_SIZE 0x4000 static void usage(void) { fprintf(stderr, "usage: tmpgb <file>"); exit(EXIT_FAILURE); } static void load_rom(const char *rom) { FILE *fp; unsigned char buffer[READ_SIZE]; size_t nread; int i = -1; fp = fopen(rom, "rb"); if (fp == NULL) { fprintf(stderr, "Could not open %s", rom); exit(EXIT_FAILURE); } while (!feof(fp)) { nread = fread(buffer, READ_SIZE, 1, fp); if (nread == 0) { if (ferror(fp)) { fprintf(stderr, "Error reading %s", rom); exit(EXIT_FAILURE); } } read_rom(buffer, i); } fclose(fp); } static void run(void) { int ret; if ((ret = init_memory()) != 0) { errnr = ret; exit_error(); } } int main(int argc, char **argv) { char *rom; if (argc != 2) usage(); rom = argv[1]; load_rom(rom); run(); return 0; }
#include <stdio.h> #include <stdlib.h> #include "error.h" #include "memory.h" #define READ_SIZE 0x4000 static void usage(void) { fprintf(stderr, "usage: tmpgb <file>"); exit(EXIT_FAILURE); } static void load_rom(const char *rom) { FILE *fp; unsigned char *buffer[READ_SIZE]; size_t nread; int i = -1; fp = fopen(rom, "rb"); if (fp == NULL) { fprintf(stderr, "Could not open %s", rom); exit(EXIT_FAILURE); } while (!feof(fp)) { nread = fread(buffer, READ_SIZE, 1, fp); if (nread == 0) { if (ferror(fp)) { fprintf(stderr, "Error reading %s", rom); exit(EXIT_FAILURE); } } read_rom(buffer, i); } fclose(fp); } static void run(void) { int ret; if ((ret = init_memory()) != 0) { errnr = ret; exit_error(); } } int main(int argc, char **argv) { char *rom; if (argc != 2) usage(); rom = argv[1]; load_rom(rom); run(); return 0; }
--- +++ @@ -15,7 +15,7 @@ static void load_rom(const char *rom) { FILE *fp; - unsigned char *buffer[READ_SIZE]; + unsigned char buffer[READ_SIZE]; size_t nread; int i = -1;
Fix error with char pointer
mit
hoferm/tmpgb,hoferm/tmpgb
d65adf9603243c66f9c7f4b5adc2a850c40a146c
#ifndef _FIX_WINSOCK2_H #define _FIX_WINSOCK2_H 1 #include_next <winsock2.h> // mingw 4.0.x has broken headers (#9246) but mingw-w64 does not. #if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4 typedef struct pollfd { SOCKET fd; short events; short revents; } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; #endif #endif // _FIX_WINSOCK2_H
#ifndef _FIX_WINSOCK2_H #define _FIX_WINSOCK2_H 1 #include_next <winsock2.h> typedef struct pollfd { SOCKET fd; short events; short revents; } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; #endif
--- +++ @@ -2,6 +2,9 @@ #define _FIX_WINSOCK2_H 1 #include_next <winsock2.h> + +// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not. +#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4 typedef struct pollfd { SOCKET fd; @@ -10,3 +13,5 @@ } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; #endif + +#endif // _FIX_WINSOCK2_H
Define WSAPOLLFD only on mingw 4.x Fixes #10327
apache-2.0
Ryman/rust,andars/rust,KokaKiwi/rust,bhickey/rand,kimroen/rust,kwantam/rust,jbclements/rust,vhbit/rust,jbclements/rust,nham/rust,rohitjoshi/rust,AerialX/rust-rt-minimal,erickt/rust,GBGamer/rust,aepsil0n/rust,reem/rust,defuz/rust,nwin/rust,nham/rust,SiegeLord/rust,miniupnp/rust,rohitjoshi/rust,XMPPwocky/rust,pshc/rust,mihneadb/rust,mihneadb/rust,mdinger/rust,jashank/rust,ktossell/rust,michaelballantyne/rust-gpu,servo/rust,erickt/rust,philyoon/rust,krzysz00/rust,mdinger/rust,servo/rust,reem/rust,jbclements/rust,krzysz00/rust,kimroen/rust,SiegeLord/rust,servo/rust,mihneadb/rust,seanrivera/rust,emk/rust,kimroen/rust,victorvde/rust,nham/rust,ejjeong/rust,quornian/rust,untitaker/rust,ejjeong/rust,nham/rust,0x73/rust,barosl/rust,sae-bom/rust,michaelballantyne/rust-gpu,aneeshusa/rust,zaeleus/rust,jroesch/rust,Ryman/rust,miniupnp/rust,kimroen/rust,avdi/rust,aepsil0n/rust,mitsuhiko/rust,ebfull/rust,0x73/rust,graydon/rust,GBGamer/rust,robertg/rust,kimroen/rust,ebfull/rust,vhbit/rust,aidancully/rust,victorvde/rust,mahkoh/rust,kimroen/rust,GBGamer/rust,quornian/rust,pshc/rust,mdinger/rust,jbclements/rust,aepsil0n/rust,fabricedesre/rust,bluss/rand,pelmers/rust,untitaker/rust,vhbit/rust,AerialX/rust,untitaker/rust,ebfull/rust,robertg/rust,GBGamer/rust,zaeleus/rust,quornian/rust,graydon/rust,fabricedesre/rust,P1start/rust,mihneadb/rust,stepancheg/rust-ide-rust,nwin/rust,AerialX/rust,pythonesque/rust,KokaKiwi/rust,rprichard/rust,robertg/rust,avdi/rust,richo/rust,nwin/rust,mitsuhiko/rust,robertg/rust,l0kod/rust,hauleth/rust,servo/rust,rprichard/rust,Ryman/rust,carols10cents/rust,pythonesque/rust,mahkoh/rust,bombless/rust,graydon/rust,stepancheg/rust-ide-rust,jbclements/rust,mahkoh/rust,zachwick/rust,miniupnp/rust,ebfull/rust,emk/rust,carols10cents/rust,krzysz00/rust,andars/rust,l0kod/rust,KokaKiwi/rust,avdi/rust,zachwick/rust,0x73/rust,mitsuhiko/rust,sae-bom/rust,pczarn/rust,jashank/rust,AerialX/rust-rt-minimal,hauleth/rust,rprichard/rust,AerialX/rust-rt-minimal,cllns/rust,robertg/rust,seanrivera/rust,victorvde/rust,Ryman/rust,gifnksm/rust,stepancheg/rust-ide-rust,michaelballantyne/rust-gpu,jroesch/rust,barosl/rust,aturon/rust,AerialX/rust,defuz/rust,AerialX/rust-rt-minimal,zubron/rust,TheNeikos/rust,miniupnp/rust,dwillmer/rust,zubron/rust,Ryman/rust,nham/rust,XMPPwocky/rust,seanrivera/rust,jashank/rust,victorvde/rust,reem/rust,Ryman/rust,AerialX/rust-rt-minimal,kwantam/rust,miniupnp/rust,richo/rust,XMPPwocky/rust,nwin/rust,aturon/rust,aneeshusa/rust,graydon/rust,barosl/rust,waynenilsen/rand,TheNeikos/rust,graydon/rust,fabricedesre/rust,cllns/rust,dwillmer/rust,ruud-v-a/rust,aidancully/rust,kwantam/rust,seanrivera/rust,untitaker/rust,jroesch/rust,SiegeLord/rust,andars/rust,jroesch/rust,AerialX/rust,mdinger/rust,ktossell/rust,zubron/rust,GBGamer/rust,krzysz00/rust,pczarn/rust,omasanori/rust,ejjeong/rust,bombless/rust,GrahamDennis/rand,mitsuhiko/rust,seanrivera/rust,KokaKiwi/rust,vhbit/rust,pythonesque/rust,GBGamer/rust,jashank/rust,aturon/rust,P1start/rust,reem/rust,mvdnes/rust,pythonesque/rust,SiegeLord/rust,nham/rust,jashank/rust,sae-bom/rust,victorvde/rust,emk/rust,ktossell/rust,michaelballantyne/rust-gpu,cllns/rust,zaeleus/rust,dinfuehr/rust,zachwick/rust,untitaker/rust,richo/rust,rprichard/rust,huonw/rand,erickt/rust,pczarn/rust,dinfuehr/rust,mitsuhiko/rust,defuz/rust,cllns/rust,stepancheg/rust-ide-rust,AerialX/rust,mvdnes/rust,hauleth/rust,philyoon/rust,pythonesque/rust,victorvde/rust,pelmers/rust,bombless/rust,miniupnp/rust,SiegeLord/rust,XMPPwocky/rust,pshc/rust,rohitjoshi/rust,sae-bom/rust,philyoon/rust,zubron/rust,mitsuhiko/rust,dwillmer/rust,barosl/rust,l0kod/rust,defuz/rust,andars/rust,rohitjoshi/rust,vhbit/rust,kwantam/rust,mihneadb/rust,l0kod/rust,michaelballantyne/rust-gpu,gifnksm/rust,avdi/rust,mitsuhiko/rust,bombless/rust,zubron/rust,ebfull/rust,pczarn/rust,pelmers/rust,Ryman/rust,aneeshusa/rust,quornian/rust,mvdnes/rust,TheNeikos/rust,miniupnp/rust,SiegeLord/rust,rprichard/rust,ejjeong/rust,rohitjoshi/rust,kimroen/rust,rprichard/rust,TheNeikos/rust,0x73/rust,barosl/rust,nwin/rust,cllns/rust,KokaKiwi/rust,avdi/rust,nwin/rust,quornian/rust,jbclements/rust,avdi/rust,erickt/rust,aturon/rust,servo/rust,miniupnp/rust,aepsil0n/rust,fabricedesre/rust,emk/rust,stepancheg/rust-ide-rust,pshc/rust,jroesch/rust,quornian/rust,shepmaster/rand,pelmers/rust,aidancully/rust,erickt/rust,mvdnes/rust,carols10cents/rust,aepsil0n/rust,servo/rust,reem/rust,aturon/rust,sae-bom/rust,zaeleus/rust,barosl/rust,mihneadb/rust,XMPPwocky/rust,philyoon/rust,dinfuehr/rust,servo/rust,ktossell/rust,gifnksm/rust,jroesch/rust,P1start/rust,graydon/rust,kwantam/rust,omasanori/rust,mahkoh/rust,pczarn/rust,nwin/rust,dinfuehr/rust,hauleth/rust,hauleth/rust,krzysz00/rust,SiegeLord/rust,andars/rust,aidancully/rust,ktossell/rust,omasanori/rust,omasanori/rust,carols10cents/rust,0x73/rust,dinfuehr/rust,GBGamer/rust,pythonesque/rust,emk/rust,zaeleus/rust,pshc/rust,P1start/rust,ruud-v-a/rust,l0kod/rust,jashank/rust,ruud-v-a/rust,P1start/rust,zachwick/rust,fabricedesre/rust,omasanori/rust,mvdnes/rust,dinfuehr/rust,seanrivera/rust,jroesch/rust,arthurprs/rand,aepsil0n/rust,P1start/rust,pelmers/rust,zubron/rust,vhbit/rust,gifnksm/rust,hauleth/rust,pelmers/rust,mdinger/rust,pythonesque/rust,ejjeong/rust,jbclements/rust,zubron/rust,XMPPwocky/rust,reem/rust,aturon/rust,dwillmer/rust,carols10cents/rust,andars/rust,l0kod/rust,zachwick/rust,0x73/rust,nwin/rust,retep998/rand,defuz/rust,bombless/rust,fabricedesre/rust,zachwick/rust,P1start/rust,pczarn/rust,AerialX/rust,fabricedesre/rust,dwillmer/rust,dwillmer/rust,untitaker/rust,rohitjoshi/rust,barosl/rust,pshc/rust,ruud-v-a/rust,pshc/rust,richo/rust,KokaKiwi/rust,aturon/rust,emk/rust,TheNeikos/rust,robertg/rust,kwantam/rust,bombless/rust-docs-chinese,aneeshusa/rust,bombless/rust,aidancully/rust,jroesch/rust,dwillmer/rust,cllns/rust,pczarn/rust,omasanori/rust,philyoon/rust,mdinger/rust,ebfull/rand,vhbit/rust,krzysz00/rust,dwillmer/rust,jashank/rust,zaeleus/rust,pshc/rust,philyoon/rust,sae-bom/rust,ebfull/rust,jashank/rust,jbclements/rust,aneeshusa/rust,ktossell/rust,l0kod/rust,ktossell/rust,aneeshusa/rust,stepancheg/rust-ide-rust,carols10cents/rust,defuz/rust,zubron/rust,mahkoh/rust,erickt/rust,jbclements/rust,stepancheg/rust-ide-rust,l0kod/rust,mahkoh/rust,emk/rust,AerialX/rust-rt-minimal,aidancully/rust,gifnksm/rust,achanda/rand,michaelballantyne/rust-gpu,0x73/rust,nham/rust,GBGamer/rust,ejjeong/rust,ruud-v-a/rust,vhbit/rust,erickt/rust,ruud-v-a/rust,gifnksm/rust,michaelballantyne/rust-gpu,TheNeikos/rust,quornian/rust,richo/rust,mvdnes/rust,richo/rust
d01ba2e824813f5ab4eb0b379caf77fe93d6911c
#pragma once #include "OSD\OSD.h" #include "SliderWnd.h" class VolumeSlider : public OSD { public: VolumeSlider(HINSTANCE hInstance, Settings &settings); void Hide(); private: SliderWnd _sWnd; };
#pragma once #include "OSD\OSD.h" #include "MeterWnd\MeterWnd.h" class VolumeSlider : public OSD { public: VolumeSlider(HINSTANCE hInstance, Settings &settings); void Hide(); private: MeterWnd _mWnd; };
--- +++ @@ -1,7 +1,7 @@ #pragma once #include "OSD\OSD.h" -#include "MeterWnd\MeterWnd.h" +#include "SliderWnd.h" class VolumeSlider : public OSD { public: @@ -10,6 +10,6 @@ void Hide(); private: - MeterWnd _mWnd; + SliderWnd _sWnd; };
Use a sliderwnd instance to implement the volume slider
bsd-2-clause
malensek/3RVX,malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,Soulflare3/3RVX
44b9b99aaa607272a4e90ae42d4aba051b85fb22
#pragma once #include <ionMath.h> #include "CWindow.h" enum class EWindowType { Fullscreen, Windowed }; class CWindowManager : public Singleton<CWindowManager>, public IEventListener { public: void Init(); void PollEvents(); bool ShouldClose() const; bool Run(); #undef CreateWindow CWindow * CreateWindow(vec2i const & Size, std::string const & Title, EWindowType const Type); protected: CWindow * PrimaryWindow; std::map<GLFWwindow *, CWindow *> Windows; static void KeyCallback(GLFWwindow * window, int key, int scancode, int action, int mods); static void MouseButtonCallback(GLFWwindow * window, int button, int action, int mods); static void MouseScrollCallback(GLFWwindow * window, double xoffset, double yoffset); static void MouseCursorCallback(GLFWwindow * window, double xpos, double ypos); static void CharCallback(GLFWwindow * window, unsigned int c); private: friend class Singleton<CWindowManager>; CWindowManager(); };
#pragma once #include <ionMath.h> #include "CWindow.h" #undef CreateWindow enum class EWindowType { Fullscreen, Windowed }; class CWindowManager : public Singleton<CWindowManager>, public IEventListener { public: void Init(); void PollEvents(); bool ShouldClose() const; bool Run(); CWindow * CreateWindow(vec2i const & Size, std::string const & Title, EWindowType const Type); protected: CWindow * PrimaryWindow; std::map<GLFWwindow *, CWindow *> Windows; static void KeyCallback(GLFWwindow * window, int key, int scancode, int action, int mods); static void MouseButtonCallback(GLFWwindow * window, int button, int action, int mods); static void MouseScrollCallback(GLFWwindow * window, double xoffset, double yoffset); static void MouseCursorCallback(GLFWwindow * window, double xpos, double ypos); static void CharCallback(GLFWwindow * window, unsigned int c); private: friend class Singleton<CWindowManager>; CWindowManager(); };
--- +++ @@ -4,7 +4,6 @@ #include <ionMath.h> #include "CWindow.h" -#undef CreateWindow enum class EWindowType @@ -23,6 +22,7 @@ bool ShouldClose() const; bool Run(); +#undef CreateWindow CWindow * CreateWindow(vec2i const & Size, std::string const & Title, EWindowType const Type); protected:
Move CreateWindow undef to make its purpose more clear
mit
iondune/ionEngine,iondune/ionEngine
b0fd54165257fa2c62c1e700c547b597778683bb
#import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @protocol WMFAnalyticsContextProviding <NSObject> - (NSString*)analyticsContext; @end @protocol WMFAnalyticsContentTypeProviding <NSObject> - (NSString*)analyticsContentType; @end @protocol WMFAnalyticsViewNameProviding <NSObject> - (NSString*)analyticsName; @end NS_ASSUME_NONNULL_END
#import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @protocol WMFAnalyticsLogging <NSObject> - (NSString*)analyticsName; @end NS_ASSUME_NONNULL_END
--- +++ @@ -2,7 +2,19 @@ NS_ASSUME_NONNULL_BEGIN -@protocol WMFAnalyticsLogging <NSObject> +@protocol WMFAnalyticsContextProviding <NSObject> + +- (NSString*)analyticsContext; + +@end + +@protocol WMFAnalyticsContentTypeProviding <NSObject> + +- (NSString*)analyticsContentType; + +@end + +@protocol WMFAnalyticsViewNameProviding <NSObject> - (NSString*)analyticsName;
Add additional protocols for tracking context, content type, and analytics name
mit
anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,bgerstle/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,bgerstle/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,bgerstle/wikipedia-ios,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,bgerstle/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,bgerstle/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,bgerstle/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,bgerstle/wikipedia-ios,bgerstle/wikipedia-ios,wikimedia/apps-ios-wikipedia
5c4a5fd8eeef6942ff79b519aa86b195a1e70aaf
#include "e.h" /* local subsystem functions */ /* local subsystem globals */ /* externally accessible functions */ EAPI void e_error_message_show_internal(char *txt) { /* FIXME: maybe log these to a file and display them at some point */ printf("<<<< Enlightenment Error >>>>\n%s\n", txt); } /* local subsystem functions */
#include "e.h" /* local subsystem functions */ /* local subsystem globals */ /* externally accessible functions */ EAPI void e_error_message_show_internal(char *txt) { /* FIXME: maybe log these to a file and display them at some point */ printf("<<<< Enlightenment Error >>>>\n" "%s\n", txt); } /* local subsystem functions */
--- +++ @@ -9,9 +9,7 @@ e_error_message_show_internal(char *txt) { /* FIXME: maybe log these to a file and display them at some point */ - printf("<<<< Enlightenment Error >>>>\n" - "%s\n", - txt); + printf("<<<< Enlightenment Error >>>>\n%s\n", txt); } /* local subsystem functions */
E: Fix formatting. (Really ??? 3 lines for something that can fit on one ?) SVN revision: 61614
bsd-2-clause
tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,FlorentRevest/Enlightenment
50dd6a56970747d566d2ce3eee4305e2e530a16d
/* * Copyright (c) 2016-2017, Texas Instruments Incorporated * * SPDX-License-Identifier: Apache-2.0 */ #include <inc/hw_types.h> #include <driverlib/prcm.h> /* * CMSIS IRQn_Type enum is broken relative to ARM GNU compiler. * * So redefine the IRQn_Type enum to a unsigned int to avoid * the ARM compiler from sign extending IRQn_Type values higher than 0x80 * into negative IRQ values, which causes hard-to-debug Hard Faults. */ typedef u32_t IRQn_Type; /* Need to keep the remaining from cmsis.h, as Zephyr expects these. */ enum { Reset_IRQn = -15, NonMaskableInt_IRQn = -14, HardFault_IRQn = -13, #if defined(CONFIG_ARMV7_M) MemoryManagement_IRQn = -12, BusFault_IRQn = -11, UsageFault_IRQn = -10, #endif /* CONFIG_ARMV7_M */ SVCall_IRQn = -5, DebugMonitor_IRQn = -4, PendSV_IRQn = -2, SysTick_IRQn = -1, } CMSIS_IRQn_Type; #define __CM4_REV 0 #define __MPU_PRESENT 0 /* Zephyr has no MPU support */ #define __NVIC_PRIO_BITS CONFIG_NUM_IRQ_PRIO_BITS #define __Vendor_SysTickConfig 0 /* Default to standard SysTick */
/* * Copyright (c) 2016, Texas Instruments Incorporated * * SPDX-License-Identifier: Apache-2.0 */ #include <inc/hw_types.h> #include <driverlib/prcm.h>
--- +++ @@ -1,7 +1,38 @@ /* - * Copyright (c) 2016, Texas Instruments Incorporated + * Copyright (c) 2016-2017, Texas Instruments Incorporated * * SPDX-License-Identifier: Apache-2.0 */ + #include <inc/hw_types.h> #include <driverlib/prcm.h> + +/* + * CMSIS IRQn_Type enum is broken relative to ARM GNU compiler. + * + * So redefine the IRQn_Type enum to a unsigned int to avoid + * the ARM compiler from sign extending IRQn_Type values higher than 0x80 + * into negative IRQ values, which causes hard-to-debug Hard Faults. + */ +typedef u32_t IRQn_Type; + +/* Need to keep the remaining from cmsis.h, as Zephyr expects these. */ +enum { + Reset_IRQn = -15, + NonMaskableInt_IRQn = -14, + HardFault_IRQn = -13, +#if defined(CONFIG_ARMV7_M) + MemoryManagement_IRQn = -12, + BusFault_IRQn = -11, + UsageFault_IRQn = -10, +#endif /* CONFIG_ARMV7_M */ + SVCall_IRQn = -5, + DebugMonitor_IRQn = -4, + PendSV_IRQn = -2, + SysTick_IRQn = -1, +} CMSIS_IRQn_Type; + +#define __CM4_REV 0 +#define __MPU_PRESENT 0 /* Zephyr has no MPU support */ +#define __NVIC_PRIO_BITS CONFIG_NUM_IRQ_PRIO_BITS +#define __Vendor_SysTickConfig 0 /* Default to standard SysTick */
cc32xx: Redefine CMSIS IRQn_Type enum to unsigned int Previously, calling NVIC_SetPriority(IRQn_Type irqn, ....) with the NWP interrupt number of 171 caused a hard fault during a subsequent svc #0 instruction during _Swap(). GNU compiler is generating a bit extension instruction (sxtb) which converts a positive IRQ value argument to a negative value when casting to the CMSIS IRQn_Type enum parameter type. This generates a negative index, which then writes to an SCB control register instead of NVIC register, causing a hard fault later on. This issue only occurs when passing interrupt numbers > 0x80 (eg: 171 (0xab) for the NWP) to the CMSIS NVIC apis. The solution here is simply to redefine IRQn_Type to be an unsigned 32 bit integer, while redefining the CMSIS IRQn_Type enum definitions for interrupts less than zero. Jira: ZEP-1958 Signed-off-by: Gil Pitney <[email protected]>
apache-2.0
runchip/zephyr-cc3220,fbsder/zephyr,punitvara/zephyr,nashif/zephyr,punitvara/zephyr,finikorg/zephyr,Vudentz/zephyr,fbsder/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,rsalveti/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,aceofall/zephyr-iotos,explora26/zephyr,ldts/zephyr,zephyriot/zephyr,rsalveti/zephyr,finikorg/zephyr,runchip/zephyr-cc3220,kraj/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyriot/zephyr,runchip/zephyr-cc3220,mbolivar/zephyr,ldts/zephyr,Vudentz/zephyr,Vudentz/zephyr,ldts/zephyr,rsalveti/zephyr,aceofall/zephyr-iotos,fbsder/zephyr,aceofall/zephyr-iotos,runchip/zephyr-cc3220,nashif/zephyr,kraj/zephyr,kraj/zephyr,Vudentz/zephyr,punitvara/zephyr,mbolivar/zephyr,rsalveti/zephyr,galak/zephyr,kraj/zephyr,kraj/zephyr,galak/zephyr,mbolivar/zephyr,nashif/zephyr,nashif/zephyr,explora26/zephyr,fbsder/zephyr,finikorg/zephyr,explora26/zephyr,zephyriot/zephyr,rsalveti/zephyr,zephyrproject-rtos/zephyr,zephyriot/zephyr,runchip/zephyr-cc3220,zephyrproject-rtos/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,zephyriot/zephyr,galak/zephyr,aceofall/zephyr-iotos,zephyrproject-rtos/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,ldts/zephyr,mbolivar/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,mbolivar/zephyr,ldts/zephyr,fbsder/zephyr
1a5537811f3faf7171f282321aa91f8ef1f8dd35
#ifndef TRACKEDPOINT_H #define TRACKEDPOINT_H #include <opencv2/core/affine.hpp> #include "TrackingData.h" namespace sensekit { namespace plugins { namespace hand { struct TrackedPoint { public: cv::Point m_position; cv::Point3f m_worldPosition; cv::Point3f m_worldDeltaPosition; cv::Point3f m_steadyWorldPosition; int m_trackingId; int m_inactiveFrameCount; int m_activeFrameCount; TrackedPointType m_type; TrackingStatus m_status; TrackedPoint(cv::Point position, cv::Point3f worldPosition, int trackingId) { m_type = TrackedPointType::CandidatePoint; m_status = TrackingStatus::NotTracking; m_position = position; m_worldPosition = worldPosition; m_steadyWorldPosition = worldPosition; m_worldDeltaPosition = cv::Point3f(0, 0, 0); m_trackingId = trackingId; m_inactiveFrameCount = 0; m_activeFrameCount = 0; } }; }}} #endif // TRACKEDPOINT_H
#ifndef TRACKEDPOINT_H #define TRACKEDPOINT_H #include <opencv2/core/affine.hpp> #include "TrackingData.h" namespace sensekit { namespace plugins { namespace hand { struct TrackedPoint { public: cv::Point m_position; cv::Point3f m_worldPosition; cv::Point3f m_steadyWorldPosition; cv::Point3f m_worldDeltaPosition; int m_trackingId; int m_inactiveFrameCount; float m_totalContributionArea; int m_wrongAreaCount; int m_activeFrameCount; TrackedPointType m_type; TrackingStatus m_status; TrackedPoint(cv::Point position, cv::Point3f worldPosition, int trackingId) { m_type = TrackedPointType::CandidatePoint; m_status = TrackingStatus::NotTracking; m_position = position; m_worldPosition = worldPosition; m_steadyWorldPosition = worldPosition; m_worldDeltaPosition = cv::Point3f(0, 0, 0); m_trackingId = trackingId; m_inactiveFrameCount = 0; m_activeFrameCount = 0; m_totalContributionArea = 0; m_wrongAreaCount = 0; } }; }}} #endif // TRACKEDPOINT_H
--- +++ @@ -11,12 +11,10 @@ public: cv::Point m_position; cv::Point3f m_worldPosition; + cv::Point3f m_worldDeltaPosition; cv::Point3f m_steadyWorldPosition; - cv::Point3f m_worldDeltaPosition; int m_trackingId; int m_inactiveFrameCount; - float m_totalContributionArea; - int m_wrongAreaCount; int m_activeFrameCount; TrackedPointType m_type; TrackingStatus m_status; @@ -32,8 +30,6 @@ m_trackingId = trackingId; m_inactiveFrameCount = 0; m_activeFrameCount = 0; - m_totalContributionArea = 0; - m_wrongAreaCount = 0; } }; }}}
Remove old tracked point fields
apache-2.0
orbbec/astra,orbbec/astra,orbbec/astra,orbbec/astra,orbbec/astra
0f993209fdd1e8bed4e9fd3d9ba758416b39eaa8
/* * This file is part of gspell, a spell-checking library. * * Copyright 2016 - Ignacio Casal Quinteiro <[email protected]> * Copyright 2016 - Sébastien Wilmet <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef GSPELL_INIT_H #define GSPELL_INIT_H #include <glib.h> #ifdef G_OS_WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> G_GNUC_INTERNAL HMODULE _gspell_init_get_dll (void); #endif /* G_OS_WIN32 */ #endif /* GSPELL_INIT_H */ /* ex:set ts=8 noet: */
/* * This file is part of gspell, a spell-checking library. * * Copyright 2016 - Ignacio Casal Quinteiro <[email protected]> * Copyright 2016 - Sébastien Wilmet <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef GSPELL_INIT_H #define GSPELL_INIT_H #include <glib.h> #ifdef G_OS_WIN32 #include <windef.h> G_GNUC_INTERNAL HMODULE _gspell_init_get_dll (void); #endif /* G_OS_WIN32 */ #endif /* GSPELL_INIT_H */ /* ex:set ts=8 noet: */
--- +++ @@ -24,7 +24,8 @@ #include <glib.h> #ifdef G_OS_WIN32 -#include <windef.h> +#define WIN32_LEAN_AND_MEAN +#include <windows.h> G_GNUC_INTERNAL HMODULE _gspell_init_get_dll (void);
Revert "win32: include windef.h instead of windows.h" This reverts commit 7a51b17a061cb4e83c5d0e862cb1c4c32c7033e7. This was actually good, normally. See the discussion at: https://bugzilla.gnome.org/show_bug.cgi?id=774325 Not tested, I don't test gspell on/for Windows.
lgpl-2.1
GNOME/gspell,GNOME/gspell
8eb990df360a6eaac3a6bfe3bcb22636d99edc0b
// // CSSTypeSelector.h // HTMLKit // // Created by Iska on 13/05/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> #import "CSSSelector.h" #import "CSSSimpleSelector.h" @interface CSSTypeSelector : CSSSelector <CSSSimpleSelector> @property (nonatomic, copy) NSString * _Nonnull type; + (nullable instancetype)universalSelector; - (nullable instancetype)initWithType:(nonnull NSString *)type; @end
// // CSSTypeSelector.h // HTMLKit // // Created by Iska on 13/05/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> #import "CSSSelector.h" #import "CSSSimpleSelector.h" @interface CSSTypeSelector : CSSSelector <CSSSimpleSelector> @property (nonatomic, copy) NSString *type; + (instancetype)universalSelector; - (instancetype)initWithType:(NSString *)type; @end
--- +++ @@ -12,10 +12,10 @@ @interface CSSTypeSelector : CSSSelector <CSSSimpleSelector> -@property (nonatomic, copy) NSString *type; +@property (nonatomic, copy) NSString * _Nonnull type; -+ (instancetype)universalSelector; ++ (nullable instancetype)universalSelector; -- (instancetype)initWithType:(NSString *)type; +- (nullable instancetype)initWithType:(nonnull NSString *)type; @end
Add nullability specifiers to type selector
mit
iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit
7cd47486ac530cc991248d59d04260c0d297b05d
#ifndef SAFE_H #define SAFE_H #include "debug.h" #ifndef DISABLE_SAFE #define SAFE_STRINGIFY(x) #x #define SAFE_TOSTRING(x) SAFE_STRINGIFY(x) #define SAFE_AT __FILE__ ":" SAFE_TOSTRING(__LINE__) ": " #define SAFE_ASSERT(cond) do { \ if (!(cond)) { \ DEBUG_DUMP(0, "error: " SAFE_AT "%m"); \ DEBUG_BREAK(!(cond)); \ } \ } while (0) #else #define SAFE_ASSERT(...) #endif #include <stdint.h> #define SAFE_NNCALL(call) do { \ intptr_t ret = (intptr_t) (call); \ SAFE_ASSERT(ret >= 0); \ } while (0) #define SAFE_NZCALL(call) do { \ intptr_t ret = (intptr_t) (call); \ SAFE_ASSERT(ret != 0); \ } while (0) #define SAFE_RZCALL(call) do { \ intptr_t ret = (intptr_t) (call); \ SAFE_ASSERT(ret == 0); \ } while (0) #endif /* end of include guard: SAFE_H */
#ifndef SAFE_H #define SAFE_H #include "debug.h" #ifndef DISABLE_SAFE #define SAFE_STRINGIFY(x) #x #define SAFE_TOSTRING(x) SAFE_STRINGIFY(x) #define SAFE_AT __FILE__ ":" SAFE_TOSTRING(__LINE__) ": " #define SAFE_ASSERT(cond) do { \ if (!(cond)) { \ DEBUG_DUMP(0, "error: " SAFE_AT "%m"); \ DEBUG_BREAK(!(cond)); \ } \ } while (0) #else #define SAFE_ASSERT(...) #endif #include <stdint.h> #define SAFE_NNCALL(call) do { \ intptr_t ret = (intptr_t) (call); \ SAFE_ASSERT(ret >= 0); \ } while (0) #define SAFE_NZCALL(call) do { \ intptr_t ret = (intptr_t) (call); \ SAFE_ASSERT(ret != 0); \ } while (0) #endif /* end of include guard: SAFE_H */
--- +++ @@ -32,4 +32,9 @@ SAFE_ASSERT(ret != 0); \ } while (0) +#define SAFE_RZCALL(call) do { \ + intptr_t ret = (intptr_t) (call); \ + SAFE_ASSERT(ret == 0); \ +} while (0) + #endif /* end of include guard: SAFE_H */
Add SAFE_RZCALL to wrap calls that returns zero.
mit
chaoran/fibril,chaoran/fibril,chaoran/fibril
8c6b30c2bdbdca9d78fcd7a4cde15e5aa6802029
#ifndef CONFIGREADER_H #define CONFIGREADER_H /*forward declarations*/ extern FILE *configreaderin; struct config_ssid { char ssid_name[32]; char ssid_user[32]; char ssid_pass[32]; char ssid_bssid[20]; char ssid_auth[10]; struct config_ssid *next; }; struct config_interfaces { char if_name[32]; struct config_ssid *ssids; struct config_interfaces *next; }; extern struct config_interfaces *config; #endif // CONFIGREADER_H
#ifndef CONFIGREADER_H #define CONFIGREADER_H /*forward declarations*/ extern FILE *configreaderin; struct config_ssid { char ssid_name[32]; char ssid_user[32]; char ssid_pass[32]; char ssid_bssid[25]; int ssid_8021x; struct config_ssid *next; }; struct config_interfaces { char if_name[32]; struct config_ssid *ssids; struct config_interfaces *next; }; extern struct config_interfaces *config; #endif // CONFIGREADER_H
--- +++ @@ -8,8 +8,8 @@ char ssid_name[32]; char ssid_user[32]; char ssid_pass[32]; - char ssid_bssid[25]; - int ssid_8021x; + char ssid_bssid[20]; + char ssid_auth[10]; struct config_ssid *next; };
Change to config file struct
bsd-3-clause
myauie/wlan-daemon
499b14d0969ccaeb69ddcf1e3b0415df1f72f923
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class THit!+; #pragma link C++ class TObjHit+; #pragma link C++ class TSTLhit+; #pragma link C++ class TSTLhitList+; #pragma link C++ class TSTLhitDeque+; #pragma link C++ class TSTLhitSet+; #pragma link C++ class TSTLhitMultiset+; #pragma link C++ class TSTLhitMap+; #pragma link C++ class TSTLhitMultiMap+; //#pragma link C++ class TSTLhitHashSet; //#pragma link C++ class TSTLhitHashMultiset; #pragma link C++ class pair<int,THit>+; #pragma link C++ class TSTLhitStar+; #pragma link C++ class TSTLhitStarList+; #pragma link C++ class TSTLhitStarDeque+; #pragma link C++ class TSTLhitStarSet+; #pragma link C++ class TSTLhitStarMultiSet+; #pragma link C++ class TSTLhitStarMap+; #pragma link C++ class TSTLhitStarMultiMap+; #pragma link C++ class pair<int,THit*>+; #pragma link C++ class TCloneshit+; #endif
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class THit!+; #pragma link C++ class TObjHit+; #pragma link C++ class TSTLhit; #pragma link C++ class TSTLhitList; #pragma link C++ class TSTLhitDeque; #pragma link C++ class TSTLhitSet; #pragma link C++ class TSTLhitMultiset; #pragma link C++ class TSTLhitMap; #pragma link C++ class TSTLhitMultiMap; //#pragma link C++ class TSTLhitHashSet; //#pragma link C++ class TSTLhitHashMultiset; #pragma link C++ class pair<int,THit>; #pragma link C++ class TSTLhitStar; #pragma link C++ class TSTLhitStarList; #pragma link C++ class TSTLhitStarDeque; #pragma link C++ class TSTLhitStarSet; #pragma link C++ class TSTLhitStarMultiSet; #pragma link C++ class TSTLhitStarMap; #pragma link C++ class TSTLhitStarMultiMap; #pragma link C++ class pair<int,THit*>; #pragma link C++ class TCloneshit+; #endif
--- +++ @@ -6,25 +6,25 @@ #pragma link C++ class THit!+; #pragma link C++ class TObjHit+; -#pragma link C++ class TSTLhit; -#pragma link C++ class TSTLhitList; -#pragma link C++ class TSTLhitDeque; -#pragma link C++ class TSTLhitSet; -#pragma link C++ class TSTLhitMultiset; -#pragma link C++ class TSTLhitMap; -#pragma link C++ class TSTLhitMultiMap; +#pragma link C++ class TSTLhit+; +#pragma link C++ class TSTLhitList+; +#pragma link C++ class TSTLhitDeque+; +#pragma link C++ class TSTLhitSet+; +#pragma link C++ class TSTLhitMultiset+; +#pragma link C++ class TSTLhitMap+; +#pragma link C++ class TSTLhitMultiMap+; //#pragma link C++ class TSTLhitHashSet; //#pragma link C++ class TSTLhitHashMultiset; -#pragma link C++ class pair<int,THit>; +#pragma link C++ class pair<int,THit>+; -#pragma link C++ class TSTLhitStar; -#pragma link C++ class TSTLhitStarList; -#pragma link C++ class TSTLhitStarDeque; -#pragma link C++ class TSTLhitStarSet; -#pragma link C++ class TSTLhitStarMultiSet; -#pragma link C++ class TSTLhitStarMap; -#pragma link C++ class TSTLhitStarMultiMap; -#pragma link C++ class pair<int,THit*>; +#pragma link C++ class TSTLhitStar+; +#pragma link C++ class TSTLhitStarList+; +#pragma link C++ class TSTLhitStarDeque+; +#pragma link C++ class TSTLhitStarSet+; +#pragma link C++ class TSTLhitStarMultiSet+; +#pragma link C++ class TSTLhitStarMap+; +#pragma link C++ class TSTLhitStarMultiMap+; +#pragma link C++ class pair<int,THit*>+; #pragma link C++ class TCloneshit+;
Use the option "+" to force the new style Streamer for all classes in bench. git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@10478 27541ba8-7e3a-0410-8455-c3a389f83636
lgpl-2.1
bbannier/ROOT,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT,bbannier/ROOT,dawehner/root,dawehner/root,dawehner/root,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT
114f74f1f21bd9467d500bae7a3442e5135ce83a
/* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _STACK_H_ #define _STACK_H_ /* * data stack for use with automaton infrastructure */ #include "dataStackEntry.h" typedef struct stack Stack; Stack *stack_create(int size); void stack_destroy(Stack *st); void reset(Stack *st); void push(Stack *st, DataStackEntry d); DataStackEntry pop(Stack *st); #endif /* _STACK_H_ */
#ifndef _STACK_H_ #define _STACK_H_ /* * data stack for use with automaton infrastructure */ #include "dataStackEntry.h" typedef struct stack Stack; Stack *stack_create(int size); void stack_destroy(Stack *st); void reset(Stack *st); void push(Stack *st, DataStackEntry d); DataStackEntry pop(Stack *st); #endif /* _STACK_H_ */
--- +++ @@ -1,3 +1,34 @@ +/* + * Copyright (c) 2013, Court of the University of Glasgow + * All rights reserved. + + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of the University of Glasgow nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + #ifndef _STACK_H_ #define _STACK_H_ /*
Add BSD 3-clause open source header
bsd-3-clause
jsventek/Cache,fergul/Cache,jsventek/Cache,fergul/Cache,jsventek/Cache,fergul/Cache
264a4058eb58ba078069f2cc2ff6fa9ae015bc4d
/* go-rec-nb-big.c -- nonblocking receive of something big on a channel. Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #include <stdint.h> #include <assert.h> #include "channel.h" _Bool __go_receive_nonblocking_big (struct __go_channel* channel, void *val) { size_t alloc_size; size_t offset; alloc_size = ((channel->element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t)); int data = __go_receive_nonblocking_acquire (channel); if (data != RECEIVE_NONBLOCKING_ACQUIRE_DATA) { __builtin_memset (val, 0, channel->element_size); if (data == RECEIVE_NONBLOCKING_ACQUIRE_NODATA) return 0; else { /* Channel is closed. */ return 1; } } offset = channel->next_fetch * alloc_size; __builtin_memcpy (val, &channel->data[offset], channel->element_size); __go_receive_release (channel); return 1; }
/* go-rec-nb-big.c -- nonblocking receive of something big on a channel. Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #include <stdint.h> #include <assert.h> #include "channel.h" _Bool __go_receive_nonblocking_big (struct __go_channel* channel, void *val) { size_t alloc_size; size_t offset; alloc_size = ((channel->element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t)); int data = __go_receive_nonblocking_acquire (channel); if (data != RECEIVE_NONBLOCKING_ACQUIRE_DATA) { __builtin_memset (val, 0, channel->element_size); if (data == RECEIVE_NONBLOCKING_ACQUIRE_NODATA) return 0; else { /* Channel is closed. */ return 1; } } offset = channel->next_store * alloc_size; __builtin_memcpy (val, &channel->data[offset], channel->element_size); __go_receive_release (channel); return 1; }
--- +++ @@ -31,7 +31,7 @@ } } - offset = channel->next_store * alloc_size; + offset = channel->next_fetch * alloc_size; __builtin_memcpy (val, &channel->data[offset], channel->element_size); __go_receive_release (channel);
Correct nonblocking receive of a value larger than 8 bytes. R=iant https://golang.org/cl/1743042
bsd-3-clause
qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,golang/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,golang/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,golang/gofrontend,qskycolor/gofrontend,golang/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend
3555739656f0eec99f4f6edb1cedf032c5d1754a
#ifndef PRIMITIV_C_CUDA_DEVICE_H_ #define PRIMITIV_C_CUDA_DEVICE_H_ #include <primitiv/c/define.h> #include <primitiv/c/device.h> /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param device Pointer to receive a handler. * @return Status code. * @remarks The random number generator is initialized using * `std::random_device`. */ PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new( uint32_t device_id, primitiv_Device **device); /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param rng_seed The seed value of the random number generator. * @param device Pointer to receive a handler. * @return Status code. */ PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new_with_seed( uint32_t device_id, uint32_t rng_seed, primitiv_Device **device); /** * Retrieves the number of active hardwares. * @param num_devices Pointer to receive the number of active hardwares. * @return Status code. */ PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_num_devices( uint32_t *num_devices); #endif // PRIMITIV_C_CUDA_DEVICE_H_
#ifndef PRIMITIV_C_CUDA_DEVICE_H_ #define PRIMITIV_C_CUDA_DEVICE_H_ #include <primitiv/c/define.h> #include <primitiv/c/device.h> /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param device Pointer to receive a handler. * @return Status code. * @remarks The random number generator is initialized using * `std::random_device`. */ extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new( uint32_t device_id, primitiv_Device **device); /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param rng_seed The seed value of the random number generator. * @param device Pointer to receive a handler. * @return Status code. */ extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new_with_seed( uint32_t device_id, uint32_t rng_seed, primitiv_Device **device); /** * Retrieves the number of active hardwares. * @param num_devices Pointer to receive the number of active hardwares. * @return Status code. */ extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_num_devices( uint32_t *num_devices); #endif // PRIMITIV_C_CUDA_DEVICE_H_
--- +++ @@ -12,7 +12,7 @@ * @remarks The random number generator is initialized using * `std::random_device`. */ -extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new( +PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new( uint32_t device_id, primitiv_Device **device); /** @@ -22,7 +22,7 @@ * @param device Pointer to receive a handler. * @return Status code. */ -extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new_with_seed( +PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new_with_seed( uint32_t device_id, uint32_t rng_seed, primitiv_Device **device); /** @@ -30,7 +30,7 @@ * @param num_devices Pointer to receive the number of active hardwares. * @return Status code. */ -extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_num_devices( +PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_num_devices( uint32_t *num_devices); #endif // PRIMITIV_C_CUDA_DEVICE_H_
Fix calling conventions around CUDA.
apache-2.0
odashi/primitiv,odashi/primitiv,odashi/primitiv
4a243af780afa91bc45377560b469a15613a5125
#ifndef __ACONFIG_H_ #define __ACONFIG_H_ /* This must be before alphabetically before all other files that reference these settings for the compiler to work * or you may get vtable errors. */ /* This section is for devices and their configuration. IF you have not setup you pins with the * standard configuration of the OpenROV kits, you should probably clone the cape or controlboard * and change the pin definitions there. Things not wired to specific pins but on the I2C bus will * have the address defined in this file. */ //Kit: #define HAS_STD_PILOT (1) /* The definitions are done in th #define HAS_STD_CAPE (0) #define HAS_OROV_CONTROLLERBOARD_25 (0) */ #include "BoardConfig.h" #define HAS_STD_LIGHTS (1) #define HAS_STD_CALIBRATIONLASERS (1) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_CAMERAMOUNT (1) //After Market: #define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define HAS_MPU9150 (0) #define MPU9150_EEPROM_START 2 #endif
#ifndef __ACONFIG_H_ #define __ACONFIG_H_ /* This must be before alphabetically before all other files that reference these settings for the compiler to work * or you may get vtable errors. */ /* This section is for devices and their configuration. IF you have not setup you pins with the * standard configuration of the OpenROV kits, you should probably clone the cape or controlboard * and change the pin definitions there. Things not wired to specific pins but on the I2C bus will * have the address defined in this file. */ //Kit: #define HAS_STD_CAPE (0) #define HAS_STD_PILOT (1) #define HAS_OROV_CONTROLLERBOARD_25 (0) #define HAS_STD_LIGHTS (1) #define HAS_STD_CALIBRATIONLASERS (0) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_CAMERAMOUNT (1) //After Market: #define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define HAS_MPU9150 (0) #define MPU9150_EEPROM_START 2 #endif
--- +++ @@ -11,12 +11,15 @@ * have the address defined in this file. */ //Kit: -#define HAS_STD_CAPE (0) #define HAS_STD_PILOT (1) -#define HAS_OROV_CONTROLLERBOARD_25 (0) +/* The definitions are done in th + #define HAS_STD_CAPE (0) + #define HAS_OROV_CONTROLLERBOARD_25 (0) +*/ +#include "BoardConfig.h" #define HAS_STD_LIGHTS (1) -#define HAS_STD_CALIBRATIONLASERS (0) +#define HAS_STD_CALIBRATIONLASERS (1) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_CAMERAMOUNT (1)
Add automation for arduino board selection for compilation
mit
codewithpassion/openrov-software,codewithpassion/openrov-software,codewithpassion/openrov-software,codewithpassion/openrov-software
b929a1e2a5a963272516b620382684472d2d7a95
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon); void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); Eina_Bool e_smart_randr_changed_get(Evas_Object *obj); void e_smart_randr_changes_apply(Evas_Object *obj, Ecore_X_Window root); # endif #endif
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon); void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); # endif #endif
--- +++ @@ -8,6 +8,8 @@ void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon); void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); +Eina_Bool e_smart_randr_changed_get(Evas_Object *obj); +void e_smart_randr_changes_apply(Evas_Object *obj, Ecore_X_Window root); # endif #endif
Add prototypes for randr_changed_get and randr_changes_apply functions. Signed-off-by: Christopher Michael <[email protected]> SVN revision: 81104
bsd-2-clause
tizenorg/platform.upstream.enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,tasn/enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment
6e1b9916f3416fbfbda38f720bd01040532fd062
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizH5CAPI_h #define tomvizH5CAPI_h extern "C" { #include <vtk_hdf5.h> } #endif // tomvizH5CAPI_h
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizH5CAPI_h #define tomvizH5CAPI_h extern "C" { #include <hdf5.h> } #endif // tomvizH5CAPI_h
--- +++ @@ -6,7 +6,7 @@ extern "C" { -#include <hdf5.h> +#include <vtk_hdf5.h> } #endif // tomvizH5CAPI_h
Include vtk_hdf5.h rather than hdf5.h This ensures we pick up the VTK version of HDF5. Signed-off-by: Chris Harris <[email protected]>
bsd-3-clause
OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz
ba24c53c1c9e7dea32d2ae4bf6167a1eeb34b036
// // OCHamcrest - HCSelfDescribing.h // Copyright 2013 hamcrest.org. See LICENSE.txt // // Created by: Jon Reid, http://qualitycoding.org/ // Docs: http://hamcrest.github.com/OCHamcrest/ // Source: https://github.com/hamcrest/OCHamcrest // #import <Foundation/Foundation.h> #import "HCDescription.h" /** The ability of an object to describe itself. @ingroup core */ @protocol HCSelfDescribing <NSObject> /** Generates a description of the object. The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately. @param description The description to be built or appended to. */ - (void)describeTo:(id<HCDescription>)description; @end
// // OCHamcrest - HCSelfDescribing.h // Copyright 2013 hamcrest.org. See LICENSE.txt // // Created by: Jon Reid, http://qualitycoding.org/ // Docs: http://hamcrest.github.com/OCHamcrest/ // Source: https://github.com/hamcrest/OCHamcrest // #import <Foundation/Foundation.h> @protocol HCDescription; /** The ability of an object to describe itself. @ingroup core */ @protocol HCSelfDescribing <NSObject> /** Generates a description of the object. The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately. @param description The description to be built or appended to. */ - (void)describeTo:(id<HCDescription>)description; @end
--- +++ @@ -9,7 +9,7 @@ #import <Foundation/Foundation.h> -@protocol HCDescription; +#import "HCDescription.h" /**
Change forward declaration to import for convenience. https://github.com/hamcrest/OCHamcrest/issues/31
bsd-2-clause
nschum/OCHamcrest,hamcrest/OCHamcrest,hamcrest/OCHamcrest,klundberg/OCHamcrest,nschum/OCHamcrest,nschum/OCHamcrest,hamcrest/OCHamcrest,klundberg/OCHamcrest
981c98937d40a196cc09530504012a792a7b5348
#pragma once #include "util/log.h" #include <cstdint> inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) { return (high << 8) + low; } inline bool check_bit(const uint8_t value, const int bit) { return (value & (1 << bit)) != 0; } inline uint8_t set_bit(const uint8_t value, const int bit) { return value | (1 << bit); } inline uint8_t clear_bit(const uint8_t value, const int bit) { return value & ~(1 << bit); } inline uint8_t set_bit_to(const uint8_t value, const int bit, bool bit_on) { if (bit_on) { return set_bit(value, bit); } else { return clear_bit(value, bit); } }
#pragma once #include <cstdint> inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) { return (high << 8) + low; } inline bool check_bit(const uint8_t value, int bit) { return (value & (1 << bit)) != 0; } inline uint8_t set_bit(const uint8_t value, int bit) { return static_cast<uint8_t>(value | (1 << bit)); }
--- +++ @@ -1,4 +1,6 @@ #pragma once + +#include "util/log.h" #include <cstdint> @@ -6,10 +8,22 @@ return (high << 8) + low; } -inline bool check_bit(const uint8_t value, int bit) { +inline bool check_bit(const uint8_t value, const int bit) { return (value & (1 << bit)) != 0; } -inline uint8_t set_bit(const uint8_t value, int bit) { - return static_cast<uint8_t>(value | (1 << bit)); +inline uint8_t set_bit(const uint8_t value, const int bit) { + return value | (1 << bit); } + +inline uint8_t clear_bit(const uint8_t value, const int bit) { + return value & ~(1 << bit); +} + +inline uint8_t set_bit_to(const uint8_t value, const int bit, bool bit_on) { + if (bit_on) { + return set_bit(value, bit); + } else { + return clear_bit(value, bit); + } +}
Add more functions for bit manipulation
bsd-3-clause
jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator
e595fd5917bd28a939cdf17a347661c00454c3a1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Various compiler checks. */ #ifndef mozilla_Compiler_h_ #define mozilla_Compiler_h_ #if !defined(__clang__) && defined(__GNUC__) /* * This macro should simplify gcc version checking. For example, to check * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`. */ # define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel) \ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \ >= ((major) * 10000 + (minor) * 100 + (patchlevel))) #if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0) // RBA: Not true for servo! //# error "mfbt (and Gecko) require at least gcc 4.4 to build." #endif #endif #endif /* mozilla_Compiler_h_ */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Various compiler checks. */ #ifndef mozilla_Compiler_h_ #define mozilla_Compiler_h_ #if !defined(__clang__) && defined(__GNUC__) /* * This macro should simplify gcc version checking. For example, to check * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`. */ # define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel) \ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \ >= ((major) * 10000 + (minor) * 100 + (patchlevel))) #if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0) # error "mfbt (and Gecko) require at least gcc 4.4 to build." #endif #endif #endif /* mozilla_Compiler_h_ */
--- +++ @@ -17,7 +17,8 @@ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \ >= ((major) * 10000 + (minor) * 100 + (patchlevel))) #if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0) -# error "mfbt (and Gecko) require at least gcc 4.4 to build." +// RBA: Not true for servo! +//# error "mfbt (and Gecko) require at least gcc 4.4 to build." #endif #endif
Disable error that forbids builds with gcc 4.2
mpl-2.0
nox/rust-azure,Adenilson/rust-azure,larsbergstrom/rust-azure,Adenilson/rust-azure,notriddle/rust-azure,larsbergstrom/rust-azure,servo/rust-azure,servo/rust-azure,notriddle/rust-azure,nox/rust-azure,brendandahl/rust-azure,servo/rust-azure,pcwalton/rust-azure,mrobinson/rust-azure,notriddle/rust-azure,larsbergstrom/rust-azure,hyowon/rust-azure,hyowon/rust-azure,Adenilson/rust-azure,mbrubeck/rust-azure,akiss77/rust-azure,mrobinson/rust-azure,vvuk/rust-azure,dzbarsky/rust-azure,mmatyas/rust-azure,mbrubeck/rust-azure,akiss77/rust-azure,brendandahl/rust-azure,metajack/rust-azure,dzbarsky/rust-azure,akiss77/rust-azure,vvuk/rust-azure,mbrubeck/rust-azure,Adenilson/rust-azure,mrobinson/rust-azure,metajack/rust-azure,vvuk/rust-azure,dzbarsky/rust-azure,mmatyas/rust-azure,hyowon/rust-azure,pcwalton/rust-azure,notriddle/rust-azure,mmatyas/rust-azure,nox/rust-azure,brendandahl/rust-azure,mbrubeck/rust-azure,servo/rust-azure,mbrubeck/rust-azure,notriddle/rust-azure,pcwalton/rust-azure,pcwalton/rust-azure,mrobinson/rust-azure,pcwalton/rust-azure,larsbergstrom/rust-azure,hyowon/rust-azure,larsbergstrom/rust-azure,metajack/rust-azure,nox/rust-azure,mmatyas/rust-azure,vvuk/rust-azure,mrobinson/rust-azure,Adenilson/rust-azure,mmatyas/rust-azure,hyowon/rust-azure,akiss77/rust-azure,akiss77/rust-azure,dzbarsky/rust-azure,dzbarsky/rust-azure,servo/rust-azure,brendandahl/rust-azure,vvuk/rust-azure,brendandahl/rust-azure,metajack/rust-azure,nox/rust-azure,metajack/rust-azure
f5fe521c850a02ae1f352bfb652e263c0c97d624
#include <string.h> #include <stdbool.h> #include "roman_convert_to_int.h" #include "roman_clusters.h" static const int ERROR = -1; static bool starts_with(const char *str, RomanCluster cluster); int roman_convert_to_int(const char *numeral) { if (!numeral) return ERROR; int total = 0; for (const RomanCluster *cluster = roman_cluster_largest(); cluster; cluster = roman_cluster_next_smaller(cluster) ) { while (starts_with(numeral, *cluster)) { total += cluster->value; numeral += cluster->length; } } return *numeral ? ERROR : total; } static bool starts_with(const char *str, RomanCluster cluster) { return strncmp(str, cluster.letters, cluster.length) == 0; }
#include <string.h> #include <stdbool.h> #include "roman_convert_to_int.h" #include "roman_clusters.h" static const int ERROR = -1; static bool starts_with(const char *str, RomanCluster cluster); int roman_convert_to_int(const char *numeral) { if (!numeral) return ERROR; int total = 0; for (int cluster_index = 0; cluster_index < ROMAN_CLUSTERS_LENGTH; cluster_index++) { const RomanCluster cluster = ROMAN_CLUSTERS[cluster_index]; while (starts_with(numeral, cluster)) { total += cluster.value; numeral += cluster.length; } } return *numeral ? ERROR : total; } static bool starts_with(const char *str, RomanCluster cluster) { return strncmp(str, cluster.letters, cluster.length) == 0; }
--- +++ @@ -13,13 +13,15 @@ if (!numeral) return ERROR; int total = 0; - for (int cluster_index = 0; cluster_index < ROMAN_CLUSTERS_LENGTH; cluster_index++) + for (const RomanCluster *cluster = roman_cluster_largest(); + cluster; + cluster = roman_cluster_next_smaller(cluster) + ) { - const RomanCluster cluster = ROMAN_CLUSTERS[cluster_index]; - while (starts_with(numeral, cluster)) + while (starts_with(numeral, *cluster)) { - total += cluster.value; - numeral += cluster.length; + total += cluster->value; + numeral += cluster->length; } }
Use cluster iterator in to_int function
mit
greghaskins/roman-calculator.c
67d9df24bf6ac9d6a3397971605cb563fb35c54d
/** * \file fixed_point.h * * * * \author Ethan Burns * \date 2009-01-16 */ #include "stdint.h" #include <limits> /* The type of a fixed point value. This should never be larger than * the size of the type for the 'value' field in the AtomicInt * class. */ typedef unsigned long fp_type; #define fp_sqrt2 1414 #define fp_one 1000 #define fp_infinity (numeric_limits<fp_type>::max())
/** * \file fixed_point.h * * * * \author Ethan Burns * \date 2009-01-16 */ #include "stdint.h" #include <limits> /* The type of a fixed point value. This should never be larger than * the size of the type for the 'value' field in the AtomicInt * class. */ typedef unsigned long fp_type; #define fp_sqrt2 14142 #define fp_one 10000 #define fp_infinity (numeric_limits<fp_type>::max())
--- +++ @@ -16,6 +16,6 @@ * class. */ typedef unsigned long fp_type; -#define fp_sqrt2 14142 -#define fp_one 10000 +#define fp_sqrt2 1414 +#define fp_one 1000 #define fp_infinity (numeric_limits<fp_type>::max())
Use 3 decimal places, the sun uses 32-bit fp_type which chokes with 4.
mit
eaburns/pbnf,eaburns/pbnf,eaburns/pbnf,eaburns/pbnf
0262f2fab71dca4874831d2d87ecaa099c1831d1
#include "syshead.h" #include "dst.h" #include "ip.h" #include "arp.h" int dst_neigh_output(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct netdev *netdev = skb->netdev; uint8_t *dmac = arp_get_hwaddr(iphdr->daddr); int rc; if (dmac) { return netdev_transmit(skb, dmac, ETH_P_IP); } else { rc = arp_request(iphdr->saddr, iphdr->daddr, netdev); while ((dmac = arp_get_hwaddr(iphdr->daddr)) == NULL) { sleep(1); } return netdev_transmit(skb, dmac, ETH_P_IP); } }
#include "syshead.h" #include "dst.h" #include "ip.h" #include "arp.h" int dst_neigh_output(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct netdev *netdev = skb->netdev; uint8_t *dmac = arp_get_hwaddr(iphdr->daddr); int rc; if (dmac) { return netdev_transmit(skb, dmac, ETH_P_IP); } else { rc = arp_request(iphdr->saddr, iphdr->daddr, netdev); free_skb(skb); return rc; } }
--- +++ @@ -14,7 +14,11 @@ return netdev_transmit(skb, dmac, ETH_P_IP); } else { rc = arp_request(iphdr->saddr, iphdr->daddr, netdev); - free_skb(skb); - return rc; + + while ((dmac = arp_get_hwaddr(iphdr->daddr)) == NULL) { + sleep(1); + } + + return netdev_transmit(skb, dmac, ETH_P_IP); } }
Add ugly hack for waiting that ARP cache gets populated We do not have a retransmission system implemented yet, so let's sleep here for a while in order to get the ARP entry if it is missing.
mit
saminiir/level-ip,saminiir/level-ip
e62cfdcc7390d420833d2bead953d8e172719f37
/* Begin CVS Header $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/copasiversion.h,v $ $Revision: 1.4 $ $Name: $ $Author: shoops $ $Date: 2004/02/20 18:15:46 $ End CVS Header */ #ifndef COPASI_VERSION #define COPASI_VERSION #define COPASI_VERSION_MAJOR 4 #define COPASI_VERSION_MINOR 0 #define COPASI_VERSION_BUILD 3 #endif // COPASI_VERSION
/* Begin CVS Header $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/copasiversion.h,v $ $Revision: 1.3 $ $Name: $ $Author: shoops $ $Date: 2004/02/19 03:28:58 $ End CVS Header */ #ifndef COPASI_VERSION #define COPASI_VERSION #define COPASI_VERSION_MAJOR 4 #define COPASI_VERSION_MINOR 0 #define COPASI_VERSION_BUILD 2 #endif // COPASI_VERSION
--- +++ @@ -1,9 +1,9 @@ /* Begin CVS Header $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/copasiversion.h,v $ - $Revision: 1.3 $ + $Revision: 1.4 $ $Name: $ $Author: shoops $ - $Date: 2004/02/19 03:28:58 $ + $Date: 2004/02/20 18:15:46 $ End CVS Header */ #ifndef COPASI_VERSION @@ -11,6 +11,6 @@ #define COPASI_VERSION_MAJOR 4 #define COPASI_VERSION_MINOR 0 -#define COPASI_VERSION_BUILD 2 +#define COPASI_VERSION_BUILD 3 #endif // COPASI_VERSION
Build number increased to 3.
artistic-2.0
copasi/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI
160887b31b1794d15e14ce09bf11a1fa80b6f74c
/* * cameraautoswitch.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #pragma once #include "igameevents.h" #include "../modules.h" class CCommand; class ConCommand; class ConVar; class IConVar; class CameraAutoSwitch : public Module, IGameEventListener2 { public: CameraAutoSwitch(); static bool CheckDependencies(); virtual void FireGameEvent(IGameEvent *event); private: class Panel; Panel *panel; ConVar *enabled; ConVar *killer; ConVar *killer_delay; void ToggleEnabled(IConVar *var, const char *pOldValue, float flOldValue); void ToggleKillerEnabled(IConVar *var, const char *pOldValue, float flOldValue); };
/* * cameraautoswitch.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #include "igameevents.h" #include "../modules.h" class CCommand; class ConCommand; class ConVar; class IConVar; class CameraAutoSwitch : public Module, IGameEventListener2 { public: CameraAutoSwitch(); static bool CheckDependencies(); virtual void FireGameEvent(IGameEvent *event); private: class Panel; Panel *panel; ConVar *enabled; ConVar *killer; ConVar *killer_delay; void ToggleEnabled(IConVar *var, const char *pOldValue, float flOldValue); void ToggleKillerEnabled(IConVar *var, const char *pOldValue, float flOldValue); };
--- +++ @@ -7,6 +7,8 @@ * http://opensource.org/licenses/BSD-2-Clause * */ + +#pragma once #include "igameevents.h"
Add pragma once to camera auto switch header.
bsd-2-clause
fwdcp/StatusSpec,fwdcp/StatusSpec
178691e163ee60902dc23f3de2b8be73b86a2473
#ifndef SRC_UTILS_CUDA_HELPER_H_ #define SRC_UTILS_CUDA_HELPER_H_ #include <cuda.h> #include <cuda_runtime.h> #include <iostream> #include <stdexcept> static void HandleError(cudaError_t error, const char *file, int line) { if (error != cudaSuccess) { printf("%s in %s at line %d\n", cudaGetErrorString(error), file, line); throw std::runtime_error(cudaGetErrorString(error)); } } #define HANDLE_ERROR(error) (HandleError(error, __FILE__, __LINE__)) #define HANDLE_NULL(a) \ { \ if (a == NULL) \ { \ printf("Host memory failed in %s at line %d\n", __FILE__, __LINE__); \ exit(EXIT_FAILURE); \ } \ } #endif // SRC_UTILS_CUDA_HELPER_H_
#ifndef SRC_UTILS_CUDA_HELPER_H_ #define SRC_UTILS_CUDA_HELPER_H_ #include <cuda.h> #include <cuda_runtime.h> #include <iostream> static void HandleError(cudaError_t err, const char *file, int line) { if (err != cudaSuccess) { printf("%s in %s at line %d\n", cudaGetErrorString(err), file, line); exit(EXIT_FAILURE); } } #define HANDLE_ERROR(err) (HandleError(err, __FILE__, __LINE__)) #define HANDLE_NULL(a) \ { \ if (a == NULL) \ { \ printf("Host memory failed in %s at line %d\n", __FILE__, __LINE__); \ exit(EXIT_FAILURE); \ } \ } #endif // SRC_UTILS_CUDA_HELPER_H_
--- +++ @@ -5,17 +5,18 @@ #include <cuda.h> #include <cuda_runtime.h> #include <iostream> +#include <stdexcept> -static void HandleError(cudaError_t err, const char *file, int line) +static void HandleError(cudaError_t error, const char *file, int line) { - if (err != cudaSuccess) + if (error != cudaSuccess) { - printf("%s in %s at line %d\n", cudaGetErrorString(err), file, line); - exit(EXIT_FAILURE); + printf("%s in %s at line %d\n", cudaGetErrorString(error), file, line); + throw std::runtime_error(cudaGetErrorString(error)); } } -#define HANDLE_ERROR(err) (HandleError(err, __FILE__, __LINE__)) +#define HANDLE_ERROR(error) (HandleError(error, __FILE__, __LINE__)) #define HANDLE_NULL(a) \ { \
Throw exception on cuda error to get a stack trace.
mit
Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller
1c48d320cbd3c0789d4bdf4039f2d4188a3087b9
/** * @file * * @date Oct 21, 2013 * @author Eldar Abusalimov */ #include <embox/test.h> #include <string.h> #include <util/bitmap.h> EMBOX_TEST_SUITE("util/bitmap test"); #define TEST_ALINGED_SZ 64 #define TEST_UNALINGED_SZ 100 TEST_CASE("aligned size with red zone after an array") { BITMAP_DECL(bitmap, TEST_ALINGED_SZ + 1); memset(bitmap, 0xAA, sizeof(bitmap)); bitmap_clear_all(bitmap, TEST_ALINGED_SZ); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_ALINGED_SZ), TEST_ALINGED_SZ /* not found */ ); } TEST_CASE("unaligned size") { BITMAP_DECL(bitmap, TEST_UNALINGED_SZ); bitmap_clear_all(bitmap, TEST_UNALINGED_SZ); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), TEST_UNALINGED_SZ /* not found */ ); for (int i = TEST_UNALINGED_SZ-1; i >= 0; --i) { bitmap_set_bit(bitmap, i); test_assert_not_zero(bitmap_test_bit(bitmap, i)); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), i); } }
/** * @file * * @date Oct 21, 2013 * @author Eldar Abusalimov */ #include <embox/test.h> #include <util/bitmap.h> EMBOX_TEST_SUITE("util/bitmap test"); #define TEST_BITMAP_SZ 100 TEST_CASE() { BITMAP_DECL(bitmap, TEST_BITMAP_SZ); bitmap_clear_all(bitmap, TEST_BITMAP_SZ); test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), TEST_BITMAP_SZ /* not found */ ); for (int i = TEST_BITMAP_SZ-1; i >= 0; --i) { bitmap_set_bit(bitmap, i); test_assert_not_zero(bitmap_test_bit(bitmap, i)); test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), i); } }
--- +++ @@ -7,24 +7,36 @@ #include <embox/test.h> +#include <string.h> #include <util/bitmap.h> EMBOX_TEST_SUITE("util/bitmap test"); -#define TEST_BITMAP_SZ 100 +#define TEST_ALINGED_SZ 64 +#define TEST_UNALINGED_SZ 100 -TEST_CASE() { - BITMAP_DECL(bitmap, TEST_BITMAP_SZ); +TEST_CASE("aligned size with red zone after an array") { + BITMAP_DECL(bitmap, TEST_ALINGED_SZ + 1); - bitmap_clear_all(bitmap, TEST_BITMAP_SZ); - test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), - TEST_BITMAP_SZ /* not found */ ); + memset(bitmap, 0xAA, sizeof(bitmap)); + bitmap_clear_all(bitmap, TEST_ALINGED_SZ); - for (int i = TEST_BITMAP_SZ-1; i >= 0; --i) { + test_assert_equal(bitmap_find_first_bit(bitmap, TEST_ALINGED_SZ), + TEST_ALINGED_SZ /* not found */ ); +} + +TEST_CASE("unaligned size") { + BITMAP_DECL(bitmap, TEST_UNALINGED_SZ); + + bitmap_clear_all(bitmap, TEST_UNALINGED_SZ); + test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), + TEST_UNALINGED_SZ /* not found */ ); + + for (int i = TEST_UNALINGED_SZ-1; i >= 0; --i) { bitmap_set_bit(bitmap, i); test_assert_not_zero(bitmap_test_bit(bitmap, i)); - test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), i); + test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), i); } }
Add bitmap test case which reveals a bug
bsd-2-clause
mike2390/embox,abusalimov/embox,vrxfile/embox-trik,mike2390/embox,Kefir0192/embox,Kefir0192/embox,embox/embox,gzoom13/embox,gzoom13/embox,abusalimov/embox,gzoom13/embox,embox/embox,gzoom13/embox,vrxfile/embox-trik,Kefir0192/embox,abusalimov/embox,Kefir0192/embox,mike2390/embox,gzoom13/embox,vrxfile/embox-trik,Kakadu/embox,vrxfile/embox-trik,vrxfile/embox-trik,Kakadu/embox,gzoom13/embox,Kefir0192/embox,mike2390/embox,embox/embox,Kakadu/embox,mike2390/embox,Kakadu/embox,embox/embox,vrxfile/embox-trik,Kakadu/embox,embox/embox,abusalimov/embox,vrxfile/embox-trik,Kakadu/embox,Kefir0192/embox,mike2390/embox,abusalimov/embox,mike2390/embox,gzoom13/embox,Kakadu/embox,Kefir0192/embox,abusalimov/embox,embox/embox
3c065012a278ce325f7f2f64abdb6fa2b78eae41
// Copyright (c) 2016 Brian Barto // // This program is free software; you can redistribute it and/or modify it // under the terms of the MIT License. See LICENSE for more details. #include <string.h> #include "config.h" // Static Variables static char payload[PAYLOAD_SIZE + 1]; void inputpayload_init(void) { memset(payload, 0, sizeof(PAYLOAD_SIZE + 1)); } void inputpayload_set(char *data) { strncpy(payload, data, PAYLOAD_SIZE); } char *inputpayload_get(void) { return payload; } void inputpayload_parse(char *data) { if (strlen(data) > COMMAND_SIZE) strncpy(payload, data + COMMAND_SIZE, PAYLOAD_SIZE); else memset(payload, 0, sizeof(PAYLOAD_SIZE + 1)); }
// Copyright (c) 2016 Brian Barto // // This program is free software; you can redistribute it and/or modify it // under the terms of the MIT License. See LICENSE for more details. #include <string.h> #include "config.h" // Static Variables static char payload[PAYLOAD_SIZE + 1]; void inputpayload_init(void) { memset(payload, 0, sizeof(PAYLOAD_SIZE + 1)); } void inputpayload_set(char *data) { strncpy(payload, data, PAYLOAD_SIZE); } char *inputpayload_get(void) { return payload; } void inputpayload_parse(char *data) { strncpy(payload, data + COMMAND_SIZE, PAYLOAD_SIZE); }
--- +++ @@ -22,5 +22,8 @@ } void inputpayload_parse(char *data) { - strncpy(payload, data + COMMAND_SIZE, PAYLOAD_SIZE); + if (strlen(data) > COMMAND_SIZE) + strncpy(payload, data + COMMAND_SIZE, PAYLOAD_SIZE); + else + memset(payload, 0, sizeof(PAYLOAD_SIZE + 1)); }
Make sure we don't increment data array past it's length when parsing payload modified: src/modules/inputpayload.c
mit
bartobri/spring-server,bartobri/spring-server
456c867d363840b3ab0f16dee605bdccf35130c1
/** * @file * @brief Tools to work with registers */ //@{ #ifndef AVARIX_REGISTER_H__ #define AVARIX_REGISTER_H__ #include <avr/io.h> /** @brief Set a register with I/O CCP disabled * * Interrupts are not disabled during the process. * * @note This can be achieved in less cycles for some I/O registers but this way * is generic. */ static inline void ccp_io_write(volatile uint8_t* addr, uint8_t value) { asm volatile ( "out %0, %1\n\t" "st Z, %3\n\t" : : "i" (&CCP) , "r" (CCP_IOREG_gc) , "z" ((uint16_t)addr) , "r" (value) ); } #endif
/** * @file * @brief Tools to work with registers */ //@{ #ifndef AVARIX_REGISTER_H__ #define AVARIX_REGISTER_H__ #include <avr/io.h> /** @brief Set a register with I/O CCP disabled * * Interrupts are not disabled during the process. * * @note This can be achieved in less cycles for some I/O registers but this way * is generic. */ inline void ccp_io_write(volatile uint8_t* addr, uint8_t value) { asm volatile ( "out %0, %1\n\t" "st Z, %3\n\t" : : "i" (&CCP) , "r" (CCP_IOREG_gc) , "z" ((uint16_t)addr) , "r" (value) ); } #endif
--- +++ @@ -16,7 +16,7 @@ * @note This can be achieved in less cycles for some I/O registers but this way * is generic. */ -inline void ccp_io_write(volatile uint8_t* addr, uint8_t value) +static inline void ccp_io_write(volatile uint8_t* addr, uint8_t value) { asm volatile ( "out %0, %1\n\t"
Fix ccp_io_write() not being static as it should
mit
robotter/avarix,robotter/avarix,robotter/avarix
cc0fdd497c22d442297ec0ac33578272acb7a462
#ifndef FIFO_H #define FIFO_H #include "align.h" #define FIFO_NODE_SIZE (1 << 20 - 2) struct _fifo_node_t; typedef struct DOUBLE_CACHE_ALIGNED { volatile size_t enq DOUBLE_CACHE_ALIGNED; volatile size_t deq DOUBLE_CACHE_ALIGNED; volatile struct { size_t index; struct _fifo_node_t * node; } head DOUBLE_CACHE_ALIGNED; size_t nprocs; } fifo_t; typedef struct DOUBLE_CACHE_ALIGNED _fifo_handle_t { struct _fifo_handle_t * next; struct _fifo_node_t * enq; struct _fifo_node_t * deq; struct _fifo_node_t * hazard; struct _fifo_node_t * retired; int winner; } fifo_handle_t; void fifo_init(fifo_t * fifo, size_t width); void fifo_register(fifo_t * fifo, fifo_handle_t * handle); void * fifo_get(fifo_t * fifo, fifo_handle_t * handle); void fifo_put(fifo_t * fifo, fifo_handle_t * handle, void * data); #endif /* end of include guard: FIFO_H */
#ifndef FIFO_H #define FIFO_H #include "align.h" #define FIFO_NODE_SIZE 510 struct _fifo_node_t; typedef struct DOUBLE_CACHE_ALIGNED { volatile size_t enq DOUBLE_CACHE_ALIGNED; volatile size_t deq DOUBLE_CACHE_ALIGNED; volatile struct { int index; struct _fifo_node_t * node; } head DOUBLE_CACHE_ALIGNED; size_t nprocs; } fifo_t; typedef struct DOUBLE_CACHE_ALIGNED _fifo_handle_t { struct _fifo_handle_t * next; struct _fifo_node_t * enq; struct _fifo_node_t * deq; struct _fifo_node_t * hazard; struct _fifo_node_t * retired; int winner; } fifo_handle_t; void fifo_init(fifo_t * fifo, size_t width); void fifo_register(fifo_t * fifo, fifo_handle_t * handle); void * fifo_get(fifo_t * fifo, fifo_handle_t * handle); void fifo_put(fifo_t * fifo, fifo_handle_t * handle, void * data); #endif /* end of include guard: FIFO_H */
--- +++ @@ -3,7 +3,7 @@ #include "align.h" -#define FIFO_NODE_SIZE 510 +#define FIFO_NODE_SIZE (1 << 20 - 2) struct _fifo_node_t; @@ -11,7 +11,7 @@ volatile size_t enq DOUBLE_CACHE_ALIGNED; volatile size_t deq DOUBLE_CACHE_ALIGNED; volatile struct { - int index; + size_t index; struct _fifo_node_t * node; } head DOUBLE_CACHE_ALIGNED; size_t nprocs;
Use the same size of lcrq.
mit
chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue
8236a6d84a13fa1511aaa8d8dea1b0155fe78c95
#ifndef KERNEL_H #define KERNEL_H void free_write(); extern unsigned int endkernel; enum STATUS_CODE { // General GENERAL_SUCCESS, GENERAL_FAILURE } #endif
#ifndef KERNEL_H #define KERNEL_H void free_write(); extern unsigned int endkernel; #endif
--- +++ @@ -4,4 +4,11 @@ void free_write(); extern unsigned int endkernel; +enum STATUS_CODE +{ + // General + GENERAL_SUCCESS, + GENERAL_FAILURE +} + #endif
Create an enum for all posible function return status codes
bsd-3-clause
TwoUnderscorez/DuckOS,TwoUnderscorez/DuckOS,TwoUnderscorez/DuckOS
8ebc25895f4832b73950ca32522dcb51e8ea8f5d
#ifndef _MAIN_H_ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 #define PROGRAM_MINOR_VERSION 2 #define PROGRAM_PATCH_VERSION 0 extern int quit; #endif /* _MAIN_H_ */
#ifndef _MAIN_H_ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 #define PROGRAM_MINOR_VERSION 1 #define PROGRAM_PATCH_VERSION 1 extern int quit; #endif /* _MAIN_H_ */
--- +++ @@ -2,8 +2,8 @@ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 -#define PROGRAM_MINOR_VERSION 1 -#define PROGRAM_PATCH_VERSION 1 +#define PROGRAM_MINOR_VERSION 2 +#define PROGRAM_PATCH_VERSION 0 extern int quit;
Upgrade version number to 0.2.0
mit
zear/shisen-seki,zear/shisen-seki
a0b563f277f4fe56bc8af372777301d20c5a419b
#ifndef _OPENLIB_FINITE_H #define _OPENLIB_FINITE_H #include <sys/cdefs.h> #define __BSD_VISIBLE 1 #include <../../build/extbld/third_party/lib/OpenLibm/install/openlibm_math.h> static inline int finite(double x) { return isfinite(x); } static inline int finitef(float x) { return isfinite(x); } static inline int finitel(long double x) { return isfinite(x); } #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) __BEGIN_DECLS extern long long int llabs(long long int j); __END_DECLS #endif #endif /* _OPENLIB_FINITE_H */
#ifndef _OPENLIB_FINITE_H #define _OPENLIB_FINITE_H #include <sys/cdefs.h> #define __BSD_VISIBLE 1 #include <../../build/extbld/third_party/lib/OpenLibm/install/openlibm_math.h> static inline int finite(double x) { return isfinite(x); } static inline int finitef(float x) { return isfinite(x); } static inline int finitel(long double x) { return isfinite(x); } #if (defined(__STDC_VERSION__) || __STDC_VERSION__ >= 199901L) __BEGIN_DECLS extern long long int llabs(long long int j); __END_DECLS #endif #endif /* _OPENLIB_FINITE_H */
--- +++ @@ -20,7 +20,7 @@ return isfinite(x); } -#if (defined(__STDC_VERSION__) || __STDC_VERSION__ >= 199901L) +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) __BEGIN_DECLS extern long long int llabs(long long int j); __END_DECLS
third-party: Fix openlibm compilation without defined macro __STDC__
bsd-2-clause
embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox
ca0d5d42bc9c7b8acb6038d3969a5defb2946942
//----------------------------------------------------------------------------- // Element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::at( std::size_t row, std::size_t col ){ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> const T& matrix<T>::at( std::size_t row, std::size_t col ) const{ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){ return 0; } template<class T> const typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ) const{ return 0; }
//----------------------------------------------------------------------------- // Element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::at( std::size_t row, std::size_t col ){ return data_.at(row*cols_+col); } template<class T> const T& matrix<T>::at( std::size_t row, std::size_t col ) const{ return data_.at(row*cols_+col); } template<class T> typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){ return 0; } template<class T> const typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ) const{ return 0; }
--- +++ @@ -4,11 +4,13 @@ template<class T> T& matrix<T>::at( std::size_t row, std::size_t col ){ + // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> const T& matrix<T>::at( std::size_t row, std::size_t col ) const{ + // TODO throw if out of bounds return data_.at(row*cols_+col); }
Add todo comment on at() functions.
mit
actinium/cppMatrix,actinium/cppMatrix
c4589974f09becf2c271e03153fe5e47709186a5
#ifndef SINKMANAGER_H #define SINKMANAGER_H #include <dsnutil/dsnutil_cpp_Export.h> #include <dsnutil/singleton.h> #include <dsnutil/log/base.h> #include <map> #include <string> #include <boost/shared_ptr.hpp> #include <boost/log/sinks.hpp> namespace dsn { namespace log { class dsnutil_cpp_EXPORT SinkManager : public dsn::Singleton<SinkManager>, public Base<SinkManager> { friend class dsn::Singleton<SinkManager>; SinkManager(); ~SinkManager(); public: /// \brief Pointer to a managed log sink typedef boost::shared_ptr<boost::log::sinks::sink> sink_ptr; bool exists(const std::string& name) const; bool add(const std::string& name, const sink_ptr& sink); bool remove(const std::string& name); std::vector<std::string> sinks() const; sink_ptr sink(const std::string& name); private: /// \brief Storage container type for managed log sinks typedef std::map<std::string, sink_ptr> sink_storage; /// \brief Storage container for managed log sinks sink_storage m_sinks; }; } } #endif // SINKMANAGER_H
#ifndef SINKMANAGER_H #define SINKMANAGER_H #include <dsnutil/singleton.h> #include <dsnutil/log/base.h> #include <map> #include <string> #include <boost/shared_ptr.hpp> #include <boost/log/sinks.hpp> namespace dsn { namespace log { class SinkManager : public dsn::Singleton<SinkManager>, public Base<SinkManager> { friend class dsn::Singleton<SinkManager>; SinkManager(); ~SinkManager(); public: /// \brief Pointer to a managed log sink typedef boost::shared_ptr<boost::log::sinks::sink> sink_ptr; bool exists(const std::string& name) const; bool add(const std::string& name, const sink_ptr& sink); bool remove(const std::string& name); std::vector<std::string> sinks() const; sink_ptr sink(const std::string& name); private: /// \brief Storage container type for managed log sinks typedef std::map<std::string, sink_ptr> sink_storage; /// \brief Storage container for managed log sinks sink_storage m_sinks; }; } } #endif // SINKMANAGER_H
--- +++ @@ -1,6 +1,7 @@ #ifndef SINKMANAGER_H #define SINKMANAGER_H +#include <dsnutil/dsnutil_cpp_Export.h> #include <dsnutil/singleton.h> #include <dsnutil/log/base.h> @@ -12,7 +13,7 @@ namespace dsn { namespace log { - class SinkManager : public dsn::Singleton<SinkManager>, public Base<SinkManager> { + class dsnutil_cpp_EXPORT SinkManager : public dsn::Singleton<SinkManager>, public Base<SinkManager> { friend class dsn::Singleton<SinkManager>; SinkManager(); ~SinkManager();
Add missing DLL export for log::SinkManager
bsd-3-clause
png85/dsnutil_cpp
48ebeb144908b83d6ace61a7709267ae65048c7f
#ifndef PHP_FAST_ASSERT_H #define PHP_FAST_ASSERT_H #define PHP_FAST_ASSERT_VERSION "0.1.1" #define PHP_FAST_ASSERT_EXTNAME "fast_assert" #ifdef HAVE_CONFIG_H #include "config.h" #endif extern "C" { #include "php.h" } typedef struct _fast_assert_globals { // global object handles pointing to the 3 commonly used assert objects zend_object_handle invalid_arg_assert_handle; zend_object_handle unexpected_val_assert_handle; zend_object_handle logic_exception_assert_handle; } fast_assert_globals; #ifdef ZTS #define AssertGlobals(v) TSRMG(fa_globals_id, fast_assert_globals *, v) extern int fa_globals_id; #else #define AssertGlobals(v) (fa_globals.v) extern fast_assert_globals fa_globals; #endif /* ZTS */ extern zend_module_entry fast_assert_module_entry; #define phpext_fast_assert_ptr &fast_assert_module_entry; #endif /* PHP_FAST_ASSERT_H */
#ifndef PHP_FAST_ASSERT_H #define PHP_FAST_ASSERT_H #define PHP_FAST_ASSERT_VERSION "0.1" #define PHP_FAST_ASSERT_EXTNAME "fast_assert" #ifdef HAVE_CONFIG_H #include "config.h" #endif extern "C" { #include "php.h" } typedef struct _fast_assert_globals { // global object handles pointing to the 3 commonly used assert objects zend_object_handle invalid_arg_assert_handle; zend_object_handle unexpected_val_assert_handle; zend_object_handle logic_exception_assert_handle; } fast_assert_globals; #ifdef ZTS #define AssertGlobals(v) TSRMG(fa_globals_id, fast_assert_globals *, v) extern int fa_globals_id; #else #define AssertGlobals(v) (fa_globals.v) extern fast_assert_globals fa_globals; #endif /* ZTS */ extern zend_module_entry fast_assert_module_entry; #define phpext_fast_assert_ptr &fast_assert_module_entry; #endif /* PHP_FAST_ASSERT_H */
--- +++ @@ -1,7 +1,7 @@ #ifndef PHP_FAST_ASSERT_H #define PHP_FAST_ASSERT_H -#define PHP_FAST_ASSERT_VERSION "0.1" +#define PHP_FAST_ASSERT_VERSION "0.1.1" #define PHP_FAST_ASSERT_EXTNAME "fast_assert" #ifdef HAVE_CONFIG_H
Add bugfix version to match package version parity
apache-2.0
box/fast_assert,box/fast_assert,box/fast_assert
bbd6b0230feee05c6efae66c8b98b31ae7bf27cb
// Check that clang is able to process response files with extra whitespace. // We generate a dos-style file with \r\n for line endings, and then split // some joined arguments (like "-x c") across lines to ensure that regular // clang (not clang-cl) can process it correctly. // // RUN: printf " -x\r\nc\r\n-DTEST\r\n" > %t.0.txt // RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT // SHORT: extern int it_works; #ifdef TEST extern int it_works; #endif
// Check that clang is able to process response files with extra whitespace. // We generate a dos-style file with \r\n for line endings, and then split // some joined arguments (like "-x c") across lines to ensure that regular // clang (not clang-cl) can process it correctly. // // RUN: echo -en "-x\r\nc\r\n-DTEST\r\n" > %t.0.txt // RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT // SHORT: extern int it_works; #ifdef TEST extern int it_works; #endif
--- +++ @@ -3,7 +3,7 @@ // some joined arguments (like "-x c") across lines to ensure that regular // clang (not clang-cl) can process it correctly. // -// RUN: echo -en "-x\r\nc\r\n-DTEST\r\n" > %t.0.txt +// RUN: printf " -x\r\nc\r\n-DTEST\r\n" > %t.0.txt // RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT // SHORT: extern int it_works;
Use printf instead of "echo -ne". Not all echo commands support "-e". git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@285162 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
a703dbcdce9b95fc4a6ae294b03a5a8707b16f4d
#ifndef MUSICMOBILEGLOBALDEFINE_H #define MUSICMOBILEGLOBALDEFINE_H /* ================================================= * This file is part of the TTK Music Player project * Copyright (c) 2015 - 2017 Greedysky Studio * All rights reserved! * Redistribution and use of the source code or any derivative * works are strictly forbiden. =================================================*/ #include "musicglobal.h" ////////////////////////////////////// ///exoprt /// /// #define MUSIC_EXPORT #ifdef MUSIC_EXPORT # define MUSIC_MOBILE_EXPORT Q_DECL_EXPORT #else # define MUSIC_MOBILE_IMPORT Q_DECL_IMPORT #endif #endif // MUSICMOBILEGLOBALDEFINE_H
#ifndef MUSICMOBILEGLOBALDEFINE_H #define MUSICMOBILEGLOBALDEFINE_H /* ================================================= * This file is part of the TTK Music Player project * Copyright (c) 2015 - 2017 Greedysky Studio * All rights reserved! * Redistribution and use of the source code or any derivative * works are strictly forbiden. =================================================*/ #include "musicglobal.h" ////////////////////////////////////// ///exoprt /// /// #define MUSIC_EXPORT #ifdef MUSIC_EXPORT # define MUSIC_MOBILE_EXPORT Q_DECL_EXPORT #else # define MUSIC_MOBILE_EXPORT Q_DECL_IMPORT #endif #endif // MUSICMOBILEGLOBALDEFINE_H
--- +++ @@ -20,7 +20,7 @@ #ifdef MUSIC_EXPORT # define MUSIC_MOBILE_EXPORT Q_DECL_EXPORT #else -# define MUSIC_MOBILE_EXPORT Q_DECL_IMPORT +# define MUSIC_MOBILE_IMPORT Q_DECL_IMPORT #endif #endif // MUSICMOBILEGLOBALDEFINE_H
Fix dll import name error[132001]
lgpl-2.1
Greedysky/Musicplayer,Greedysky/Musicplayer,Greedysky/Musicplayer
6e5eac20ada828fb2fbcd6fd262fe07e3d16fc54
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * * REMEMBER to update the documentation (especially the varnishlog(1) man * page) whenever this list changes. */ SLTM(Debug) SLTM(Error) SLTM(CLI) SLTM(SessionOpen) SLTM(SessionReuse) SLTM(SessionClose) SLTM(BackendOpen) SLTM(BackendXID) SLTM(BackendReuse) SLTM(BackendClose) SLTM(HttpError) SLTM(ClientAddr) SLTM(Backend) SLTM(Request) SLTM(Response) SLTM(Length) SLTM(Status) SLTM(URL) SLTM(Protocol) SLTM(Header) SLTM(BldHdr) SLTM(LostHeader) SLTM(VCL_call) SLTM(VCL_trace) SLTM(VCL_return) SLTM(XID) SLTM(Hit) SLTM(ExpBan) SLTM(ExpPick) SLTM(ExpKill) SLTM(WorkThread)
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(Debug) SLTM(Error) SLTM(CLI) SLTM(SessionOpen) SLTM(SessionReuse) SLTM(SessionClose) SLTM(BackendOpen) SLTM(BackendXID) SLTM(BackendReuse) SLTM(BackendClose) SLTM(HttpError) SLTM(ClientAddr) SLTM(Backend) SLTM(Request) SLTM(Response) SLTM(Length) SLTM(Status) SLTM(URL) SLTM(Protocol) SLTM(Header) SLTM(BldHdr) SLTM(LostHeader) SLTM(VCL_call) SLTM(VCL_trace) SLTM(VCL_return) SLTM(XID) SLTM(Hit) SLTM(ExpBan) SLTM(ExpPick) SLTM(ExpKill) SLTM(WorkThread)
--- +++ @@ -4,6 +4,8 @@ * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * + * REMEMBER to update the documentation (especially the varnishlog(1) man + * page) whenever this list changes. */ SLTM(Debug)
Add a note to update varnishlog(1) whenever this list changes. git-svn-id: 7d4b18ab7d176792635d6a7a77dd8cbbea8e8daa@418 d4fa192b-c00b-0410-8231-f00ffab90ce4
bsd-2-clause
wikimedia/operations-debs-varnish,CartoDB/Varnish-Cache,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,ssm/pkg-varnish,CartoDB/Varnish-Cache,ssm/pkg-varnish,ssm/pkg-varnish,wikimedia/operations-debs-varnish,CartoDB/Varnish-Cache,ssm/pkg-varnish,ssm/pkg-varnish
b0c1b4beb324942040a5d9fd2abb617f8d83f612
#ifndef PSTR_HELPER_H #define PSTR_HELPER_H #include <avr/pgmspace.h> // Modified PSTR that pushes string into a char* buffer for easy use. // // There is only one buffer so this will cause problems if you need to pass two // strings to one function. #define PSTR2(x) PSTRtoBuffer_P(PSTR(x)) #define PSTR2_BUFFER_SIZE 48 // May need adjusted depending on your needs. char *PSTRtoBuffer_P(PGM_P str); #endif
#ifndef PSTR_HELPER_H #define PSTR_HELPER_H #include <avr/pgmspace.h> // Modified PSTR that pushes string into a char* buffer for easy use. // // There is only one buffer so this will cause problems if you need to pass two // strings to one function. #define PSTR2(x) PSTRtoBuffer_P(PSTR(x)) #define PSTR2_BUFFER_SIZE 32 // May need adjusted depending on your needs. char *PSTRtoBuffer_P(PGM_P str); #endif
--- +++ @@ -8,7 +8,7 @@ // There is only one buffer so this will cause problems if you need to pass two // strings to one function. #define PSTR2(x) PSTRtoBuffer_P(PSTR(x)) -#define PSTR2_BUFFER_SIZE 32 // May need adjusted depending on your needs. +#define PSTR2_BUFFER_SIZE 48 // May need adjusted depending on your needs. char *PSTRtoBuffer_P(PGM_P str);
Increase PSTR2 buffer (fix broken calibration) - No idea how this didn't cause problems before. Luck?
mit
sheaivey/rx5808-pro-diversity,sheaivey/rx5808-pro-diversity,RCDaddy/rx5808-pro-diversity,RCDaddy/rx5808-pro-diversity
554f657af8c33be01a0300518bc313fa13e46d34
#ifndef GUFUNC_SCHEDULER #define GUFUNC_SCHEDULER /* define int64_t and uint64_t for VC9 */ #ifdef _MSC_VER #define int64_t signed __int64 #define uint64_t unsigned __int64 #else #include <stdint.h> #endif #ifndef __SIZEOF_POINTER__ /* MSVC doesn't define __SIZEOF_POINTER__ */ #if defined(_WIN64) #define intp int64_t #define uintp uint64_t #elif defined(_WIN32) #define intp int #define uintp unsigned #else #error "cannot determine size of intp" #endif #elif __SIZEOF_POINTER__ == 8 #define intp int64_t #define uintp uint64_t #else #define intp int #define uintp unsigned #endif #ifdef __cplusplus extern "C" { #endif void do_scheduling(intp num_dim, intp *dims, uintp num_threads, intp *sched, intp debug); #ifdef __cplusplus } #endif #endif
#ifndef GUFUNC_SCHEDULER #define GUFUNC_SCHEDULER #include <stdint.h> #ifndef __SIZEOF_POINTER__ /* MSVC doesn't define __SIZEOF_POINTER__ */ #if defined(_WIN64) #define intp int64_t #define uintp uint64_t #elif defined(_WIN32) #define intp int #define uintp unsigned #else #error "cannot determine size of intp" #endif #elif __SIZEOF_POINTER__ == 8 #define intp int64_t #define uintp uint64_t #else #define intp int #define uintp unsigned #endif #ifdef __cplusplus extern "C" { #endif void do_scheduling(intp num_dim, intp *dims, uintp num_threads, intp *sched, intp debug); #ifdef __cplusplus } #endif #endif
--- +++ @@ -1,11 +1,17 @@ #ifndef GUFUNC_SCHEDULER #define GUFUNC_SCHEDULER -#include <stdint.h> +/* define int64_t and uint64_t for VC9 */ +#ifdef _MSC_VER + #define int64_t signed __int64 + #define uint64_t unsigned __int64 +#else + #include <stdint.h> +#endif #ifndef __SIZEOF_POINTER__ /* MSVC doesn't define __SIZEOF_POINTER__ */ - #if defined(_WIN64) + #if defined(_WIN64) #define intp int64_t #define uintp uint64_t #elif defined(_WIN32)
Fix missing stdint.h on py2.7 vc9
bsd-2-clause
stonebig/numba,numba/numba,cpcloud/numba,cpcloud/numba,stuartarchibald/numba,gmarkall/numba,seibert/numba,sklam/numba,seibert/numba,sklam/numba,stuartarchibald/numba,jriehl/numba,seibert/numba,jriehl/numba,gmarkall/numba,sklam/numba,IntelLabs/numba,stuartarchibald/numba,stonebig/numba,numba/numba,numba/numba,gmarkall/numba,stuartarchibald/numba,seibert/numba,sklam/numba,gmarkall/numba,stonebig/numba,cpcloud/numba,stonebig/numba,gmarkall/numba,numba/numba,cpcloud/numba,jriehl/numba,stonebig/numba,sklam/numba,IntelLabs/numba,IntelLabs/numba,seibert/numba,cpcloud/numba,numba/numba,IntelLabs/numba,jriehl/numba,jriehl/numba,IntelLabs/numba,stuartarchibald/numba
eb0fa7bf4c9d8d24ee597e8777fee446ac55c35b
/*************************************************************************************** * MAIN.C * * Description: Converts raw ADC reads given via character device to time of flight * * (C) 2016 Visaoni * Licensed under the MIT License. **************************************************************************************/ #include <stdint.h> #include <stdio.h> //#include <unistd.h> //#include <string.h> #include <fcntl.h> #include <sys/poll.h> // TODO: Get these value from a shared source along with the firmware #define TIME_BETWEEN_READS_NS 166.7 #define DELAY_TIME_NS 0 #define READS_PER_TX 2000 #define BYTES_PER_READ 2 #define CHARACTER_DEVICE_PATH "/dev/rpmsg_pru31" #define MAX_BUFFER_SIZE (BYTES_PER_READ * READS_PER_TX) double find_tof( uint16_t reads[] ) { size_t max = 0; size_t i; for( i = 0; i < READS_PER_TX; i++ ) { if( reads[i] > reads[max] ) { max = i; } } return DELAY_TIME_NS + max * TIME_BETWEEN_READS_NS; } int main(void) { uint8_t buffer[ MAX_BUFFER_SIZE ]; uint16_t* reads = (uint16_t*)buffer; // Assumes little-endian struct pollfd pollfds[1]; pollfds[0].fd = open( CHARACTER_DEVICE_PATH, O_RDWR ); if( pollfds[0].fd < 0 ) { printf( "Unable to open char device." ); return -1; } // Firmware needs an initial write to grab metadata // msg contents irrelevant // TODO: Should probably handle errors better while( write( pollfds[0].fd, "s", 1 ) < 0 ) { printf( "Problem with initial send. Retrying..." ); } while(1) { // Grab a whole run and then process // TODO: Figure out of this is sufficient or if incremental processing is required for performance size_t total_bytes = 0; while( total_bytes < MAX_BUFFER_SIZE ) { total_bytes += read( pollfds[0].fd, buffer + total_bytes, MAX_BUFFER_SIZE - total_bytes ); } // reads and buffer are aliased double tof = find_tof( reads ); printf( "Time of flight: %d ns", tof ); } return 0; }
/*************************************************************************************** * MAIN.C * * Description: Converts raw ADC reads given via character device to time of flight * * (C) 2016 Visaoni * Licensed under the MIT License. **************************************************************************************/ int main(void) { return 0; }
--- +++ @@ -6,7 +6,77 @@ * (C) 2016 Visaoni * Licensed under the MIT License. **************************************************************************************/ + +#include <stdint.h> +#include <stdio.h> +//#include <unistd.h> +//#include <string.h> +#include <fcntl.h> +#include <sys/poll.h> + +// TODO: Get these value from a shared source along with the firmware +#define TIME_BETWEEN_READS_NS 166.7 +#define DELAY_TIME_NS 0 +#define READS_PER_TX 2000 +#define BYTES_PER_READ 2 + +#define CHARACTER_DEVICE_PATH "/dev/rpmsg_pru31" +#define MAX_BUFFER_SIZE (BYTES_PER_READ * READS_PER_TX) + + +double find_tof( uint16_t reads[] ) +{ + size_t max = 0; + size_t i; + for( i = 0; i < READS_PER_TX; i++ ) + { + if( reads[i] > reads[max] ) + { + max = i; + } + } + + return DELAY_TIME_NS + max * TIME_BETWEEN_READS_NS; +} + int main(void) { + uint8_t buffer[ MAX_BUFFER_SIZE ]; + uint16_t* reads = (uint16_t*)buffer; // Assumes little-endian + + struct pollfd pollfds[1]; + + pollfds[0].fd = open( CHARACTER_DEVICE_PATH, O_RDWR ); + + if( pollfds[0].fd < 0 ) + { + printf( "Unable to open char device." ); + return -1; + } + + // Firmware needs an initial write to grab metadata + // msg contents irrelevant + // TODO: Should probably handle errors better + while( write( pollfds[0].fd, "s", 1 ) < 0 ) + { + printf( "Problem with initial send. Retrying..." ); + } + + + while(1) + { + // Grab a whole run and then process + // TODO: Figure out of this is sufficient or if incremental processing is required for performance + size_t total_bytes = 0; + while( total_bytes < MAX_BUFFER_SIZE ) + { + total_bytes += read( pollfds[0].fd, buffer + total_bytes, MAX_BUFFER_SIZE - total_bytes ); + } + + // reads and buffer are aliased + double tof = find_tof( reads ); + printf( "Time of flight: %d ns", tof ); + } + return 0; }
Set up basic processing framework Constructs read values from character device and passes it through the most basic processing to find time of flight.
mit
thetransformerr/beagle-sonic,Visaoni/beagle-sonic-anemometer,thetransformerr/beagle-sonic,Visaoni/beagle-sonic-anemometer,thetransformerr/beagle-sonic,thetransformerr/beagle-sonic,Visaoni/beagle-sonic-anemometer
706d8d60091b30bc950be8877864f12aed1ab9c0
/* This file is part of the Grantlee template system. Copyright (c) 2010 Stephen Kelly <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the Licence, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <http://www.gnu.org/licenses/>. */ #ifndef GRANTLEE_GUI_EXPORT_H #define GRANTLEE_GUI_EXPORT_H #if defined(_WIN32) || defined(_WIN64) # ifndef GRANTLEE_GUI_EXPORT # if defined(GRANTLEE_GUI_LIB_MAKEDLL) # define GRANTLEE_GUI_EXPORT __declspec(dllexport) # else # define GRANTLEE_GUI_EXPORT __declspec(dllimport) # endif # endif #else # define GRANTLEE_GUI_EXPORT __attribute__((visibility("default"))) #endif #endif
/* This file is part of the Grantlee template system. Copyright (c) 2010 Stephen Kelly <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 only, as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License version 3 for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <http://www.gnu.org/licenses/>. */ #ifndef GRANTLEE_GUI_EXPORT_H #define GRANTLEE_GUI_EXPORT_H #if defined(_WIN32) || defined(_WIN64) # ifndef GRANTLEE_GUI_EXPORT # if defined(GRANTLEE_GUI_LIB_MAKEDLL) # define GRANTLEE_GUI_EXPORT __declspec(dllexport) # else # define GRANTLEE_GUI_EXPORT __declspec(dllimport) # endif # endif #else # define GRANTLEE_GUI_EXPORT __attribute__((visibility("default"))) #endif #endif
--- +++ @@ -5,12 +5,13 @@ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public - License version 3 only, as published by the Free Software Foundation. + License as published by the Free Software Foundation; either version + 2.1 of the Licence, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License version 3 for more details. + Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <http://www.gnu.org/licenses/>.
Fix license header in the export header.
lgpl-2.1
simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee,simonwagner/grantlee,simonwagner/grantlee,simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee,cutelyst/grantlee
d786eea17f6d55643ba7df12859d1e60e0c6cb39
#ifndef BYTECODE_H #define BYTECODE_H #include <iostream> #include <iomanip> using namespace std; enum ByteCode { PUSH = 0, PRINT = 1, END = 2 }; /* Write operations */ void writeOneOperandCall(ofstream* outStream, ByteCode bytecode, string litteral); void writeSimpleCall(ofstream* outStream, ByteCode bytecode); void writeEnd(ofstream* stream); void writeLitteral(ofstream* stream, string value); /* Read operations */ ByteCode readByteCode(ifstream* stream); char readConstantType(ifstream* stream); string readLitteral(ifstream* stream); #endif
#ifndef BYTECODE_H #define BYTECODE_H #include <iostream> #include <iomanip> using namespace std; enum ByteCode { PUSH = 0, PRINT = 1, END = 2 }; void writeOneOperandCall(ofstream* outStream, ByteCode bytecode, string litteral); void writeSimpleCall(ofstream* outStream, ByteCode bytecode); void writeEnd(ofstream* stream); ByteCode readByteCode(ifstream* stream); template<typename T> std::ostream& binary_write(std::ostream* stream, const T& value){ return stream->write(reinterpret_cast<const char*>(&value), sizeof(T)); } template<typename T> std::istream & binary_read(std::istream* stream, T& value) { return stream->read(reinterpret_cast<char*>(&value), sizeof(T)); } std::ostream& binary_write_string(std::ostream* stream, string value); std::string binary_read_string(std::istream* stream); #endif
--- +++ @@ -12,25 +12,17 @@ END = 2 }; +/* Write operations */ + void writeOneOperandCall(ofstream* outStream, ByteCode bytecode, string litteral); void writeSimpleCall(ofstream* outStream, ByteCode bytecode); void writeEnd(ofstream* stream); +void writeLitteral(ofstream* stream, string value); + +/* Read operations */ ByteCode readByteCode(ifstream* stream); - -template<typename T> -std::ostream& binary_write(std::ostream* stream, const T& value){ - return stream->write(reinterpret_cast<const char*>(&value), sizeof(T)); -} - -template<typename T> -std::istream & binary_read(std::istream* stream, T& value) -{ - return stream->read(reinterpret_cast<char*>(&value), sizeof(T)); -} - -std::ostream& binary_write_string(std::ostream* stream, string value); - -std::string binary_read_string(std::istream* stream); +char readConstantType(ifstream* stream); +string readLitteral(ifstream* stream); #endif
Use the new designed library
mit
wichtounet/eddic,vogelsgesang/eddic,wichtounet/eddic,vogelsgesang/eddic,vogelsgesang/eddic,wichtounet/eddic
c2988f448975fa3e9af6ef4f33d725088ebfe568
#ifndef _I2C_H #define _I2C_H #ifndef I2C_FREQ #define I2C_FREQ 100000 #endif struct i2c_iovec_s { uint8_t *base; uint8_t len; }; void i2c_init(void); void i2c_open(void); void i2c_close(void); int8_t i2c_readv(uint8_t address, struct i2c_iovec_s *iov, uint8_t iovcnt); int8_t i2c_writev(uint8_t address, struct i2c_iovec_s *iov, uint8_t iovcnt); int8_t i2c_read(uint8_t address, uint8_t *buf, uint8_t len); int8_t i2c_write(uint8_t address, uint8_t *buf, uint8_t len); int8_t i2c_read_from(uint8_t address, uint8_t reg, uint8_t *buf, uint8_t len); int8_t i2c_write_to(uint8_t address, uint8_t reg, uint8_t *buf, uint8_t len); #endif
#ifndef _I2C_H #define _I2C_H #define I2C_FREQ 100000 struct i2c_iovec_s { uint8_t *base; uint8_t len; }; void i2c_init(void); void i2c_open(void); void i2c_close(void); int8_t i2c_readv(uint8_t address, struct i2c_iovec_s *iov, uint8_t iovcnt); int8_t i2c_writev(uint8_t address, struct i2c_iovec_s *iov, uint8_t iovcnt); int8_t i2c_read(uint8_t address, uint8_t *buf, uint8_t len); int8_t i2c_write(uint8_t address, uint8_t *buf, uint8_t len); int8_t i2c_read_from(uint8_t address, uint8_t reg, uint8_t *buf, uint8_t len); int8_t i2c_write_to(uint8_t address, uint8_t reg, uint8_t *buf, uint8_t len); #endif
--- +++ @@ -1,7 +1,9 @@ #ifndef _I2C_H #define _I2C_H +#ifndef I2C_FREQ #define I2C_FREQ 100000 +#endif struct i2c_iovec_s { uint8_t *base;
Allow I2C_FREQ to be defined externally
mit
pietern/avr-tasks,pietern/avr-tasks
55793ac91e2491d9c9af88aa82792be759ac2039
typedef int myint; myint x = (myint)1; int main(void) { return x-1; }
typedef int myint; myint x = (myint)1;
--- +++ @@ -1,2 +1,8 @@ typedef int myint; myint x = (myint)1; + +int +main(void) +{ + return x-1; +}
[tests] Fix test added in 6fe29dd Tests must have a main function which returns 0.
isc
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
661bc252516e229e3f3769956b1b16c8d40a95eb
#include <stddef.h> // Those types are needed but not defined or used in libcurl headers. typedef size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata); typedef size_t write_data_callback(void *buffer, size_t size, size_t nmemb, void *userp);
#include <stdio.h> // Those types are needed but not defined or used in libcurl headers. typedef size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata); typedef size_t write_data_callback(void *buffer, size_t size, size_t nmemb, void *userp); extern void something_using_callback1(header_callback*); extern void something_using_callback2(write_data_callback*);
--- +++ @@ -1,8 +1,5 @@ -#include <stdio.h> +#include <stddef.h> // Those types are needed but not defined or used in libcurl headers. typedef size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata); typedef size_t write_data_callback(void *buffer, size_t size, size_t nmemb, void *userp); - -extern void something_using_callback1(header_callback*); -extern void something_using_callback2(write_data_callback*);
Remove some hacks from libcurl sample
apache-2.0
JetBrains/kotlin-native,jiaminglu/kotlin-native,JuliusKunze/kotlin-native,wiltonlazary/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,jiaminglu/kotlin-native,JuliusKunze/kotlin-native,JuliusKunze/kotlin-native,JuliusKunze/kotlin-native,JetBrains/kotlin-native,JuliusKunze/kotlin-native,JetBrains/kotlin-native,jiaminglu/kotlin-native,jiaminglu/kotlin-native,JetBrains/kotlin-native,wiltonlazary/kotlin-native,jiaminglu/kotlin-native,JuliusKunze/kotlin-native,jiaminglu/kotlin-native,wiltonlazary/kotlin-native,wiltonlazary/kotlin-native,JuliusKunze/kotlin-native,JuliusKunze/kotlin-native,jiaminglu/kotlin-native,wiltonlazary/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,jiaminglu/kotlin-native
d07295d73267c51bf3d77b97831640db832bacb5
/* * gramp.h - SiriDB Grammar Properties. * * Note: we need this file up-to-date with the grammar. The grammar has * keywords starting with K_ so the will all be sorted. * KW_OFFSET should be set to the first keyword and KW_COUNT needs the * last keyword in the grammar. * */ #ifndef SIRI_GRAMP_H_ #define SIRI_GRAMP_H_ #include <siri/grammar/grammar.h> /* keywords */ #define KW_OFFSET CLERI_GID_K_ACCESS #define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET /* aggregation functions */ #define F_OFFSET CLERI_GID_F_COUNT /* help statements */ #define HELP_OFFSET CLERI_GID_HELP_ACCESS #define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET #if CLERI_VERSION_MINOR >= 12 #define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data) #define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data) #else #define CLERI_NODE_DATA(__node) (__node)->result #define CLERI_NODE_DATA_ADDR(__node) &(__node)->result #endif #endif /* SIRI_GRAMP_H_ */
/* * gramp.h - SiriDB Grammar Properties. * * Note: we need this file up-to-date with the grammar. The grammar has * keywords starting with K_ so the will all be sorted. * KW_OFFSET should be set to the first keyword and KW_COUNT needs the * last keyword in the grammar. * */ #ifndef SIRI_GRAMP_H_ #define SIRI_GRAMP_H_ #include <siri/grammar/grammar.h> /* keywords */ #define KW_OFFSET CLERI_GID_K_ACCESS #define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET /* aggregation functions */ #define F_OFFSET CLERI_GID_F_COUNT /* help statements */ #define HELP_OFFSET CLERI_GID_HELP_ACCESS #define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET #if CLERI_VERSION_MINOR >= 12 #define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data) #define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data) #else #define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->result) #define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->result) #endif #endif /* SIRI_GRAMP_H_ */
--- +++ @@ -29,8 +29,8 @@ #define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data) #define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data) #else -#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->result) -#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->result) +#define CLERI_NODE_DATA(__node) (__node)->result +#define CLERI_NODE_DATA_ADDR(__node) &(__node)->result #endif #endif /* SIRI_GRAMP_H_ */
Update compat with old libcleri
mit
transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server
5c020deef2ee09fe0abe00ad533fba9a2411dd4a
#ifndef AT_TIME_H #define AT_TIME_H // Under Windows, define the gettimeofday() function with corresponding types #ifdef _MSC_VER #include <windows.h> #include <time.h> #include "atSymbols.h" // TYPES struct timezone { int tz_minuteswest; int tz_dsttime; }; // FUNCTIONS ATLAS_SYM int gettimeofday(struct timeval * tv, struct timezone * tz); #else #include <sys/time.h> #endif #endif
#ifndef AT_TIME_H #define AT_TIME_H // Under Windows, define the gettimeofday() function with corresponding types #ifdef _MSC_VER #include <windows.h> #include <time.h> // TYPES struct timezone { int tz_minuteswest; int tz_dsttime; }; // FUNCTIONS int gettimeofday(struct timeval * tv, struct timezone * tz); #else #include <sys/time.h> #endif #endif
--- +++ @@ -7,6 +7,7 @@ #ifdef _MSC_VER #include <windows.h> #include <time.h> + #include "atSymbols.h" // TYPES @@ -18,7 +19,7 @@ // FUNCTIONS - int gettimeofday(struct timeval * tv, struct timezone * tz); + ATLAS_SYM int gettimeofday(struct timeval * tv, struct timezone * tz); #else #include <sys/time.h> #endif
Add the atSymbols to this so the getTimeOfDay function was usable outside of the windows dll.
apache-2.0
ucfistirl/atlas,ucfistirl/atlas
318d87ddc093ded8e70bb41204079c45e73b4e5e
#ifndef GWKV_HT_WRAPPER #define GWKV_HT_WRAPPER #include <stdlib.h> #include "../hashtable/hashtable.h" typedef enum { GET, SET } method; /* Defines for result codes */ #define STORED 0 #define NOT_STORED 1 #define EXISTS 2 #define NOT_FOUND 3 struct { method method_type, const char* key, size_t key_length, const char* value, size_t value_length } operation; /** * Wrapper function to set a value in the hashtable * Returns either STORED or NOT_STORED (defined above) */ int gwkv_server_set (memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length); /** * Wrapper function to read a value from the hashtable * Returns the data if sucessful, or NULL on error * These correspond to the EXISTS and NOT_FOUND codes above */ char* gwkv_server_get (memcached_st *ptr, const char *key, size_t key_length, size_t *value_length); #endif
#ifndef GWKV_HT_WRAPPER #define GWKV_HT_WRAPPER #include <stdlib.h> typedef enum { GET, SET } method; /* Defines for result codes */ #define STORED 0 #define NOT_STORED 1 #define EXISTS 2 #define NOT_FOUND 3 struct { method method_type, const char* key, size_t key_length, const char* value, size_t value_length } operation; /** * Wrapper function to set a value in the hashtable * Returns either STORED or NOT_STORED (defined above) */ int gwkv_memcache_set (memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length); /** * Wrapper function to read a value from the hashtable * Returns the data if sucessful, or NULL on error * These correspond to the EXISTS and NOT_FOUND codes above */ char* gwkv_memcached_get (memcached_st *ptr, const char *key, size_t key_length, size_t *value_length); #endif
--- +++ @@ -2,6 +2,7 @@ #define GWKV_HT_WRAPPER #include <stdlib.h> +#include "../hashtable/hashtable.h" typedef enum { GET, @@ -27,11 +28,11 @@ * Returns either STORED or NOT_STORED (defined above) */ int -gwkv_memcache_set (memcached_st *ptr, - const char *key, - size_t key_length, - const char *value, - size_t value_length); +gwkv_server_set (memcached_st *ptr, + const char *key, + size_t key_length, + const char *value, + size_t value_length); /** * Wrapper function to read a value from the hashtable @@ -39,9 +40,11 @@ * These correspond to the EXISTS and NOT_FOUND codes above */ char* -gwkv_memcached_get (memcached_st *ptr, - const char *key, - size_t key_length, - size_t *value_length); +gwkv_server_get (memcached_st *ptr, + const char *key, + size_t key_length, + size_t *value_length); + + #endif
Change server set/get function names
mit
gwAdvNet2015/gw-kv-store
08a9882cc8cbec97947215a7cdb1f60effe82b15
#include <stdlib.h> #define MAX_MALLOC_SIZE (1<<20) /* One megabyte ought to be enough for anyone */ void *readstat_malloc(size_t len) { if (len > MAX_MALLOC_SIZE || len == 0) { return NULL; } return malloc(len); } void *readstat_calloc(size_t count, size_t size) { if (count > MAX_MALLOC_SIZE || size > MAX_MALLOC_SIZE || count * size > MAX_MALLOC_SIZE) { return NULL; } if (count == 0 || size == 0) { return NULL; } return calloc(count, size); } void *readstat_realloc(void *ptr, size_t len) { if (len > MAX_MALLOC_SIZE || len == 0) { if (ptr) free(ptr); return NULL; } return realloc(ptr, len); }
#include <stdlib.h> #define MAX_MALLOC_SIZE (1<<20) /* One megabyte ought to be enough for anyone */ void *readstat_malloc(size_t len) { if (len > MAX_MALLOC_SIZE || len == 0) { return NULL; } return malloc(len); } void *readstat_calloc(size_t count, size_t size) { if (count > MAX_MALLOC_SIZE || size > MAX_MALLOC_SIZE || count * size > MAX_MALLOC_SIZE) { return NULL; } return calloc(count, size); } void *readstat_realloc(void *ptr, size_t len) { if (len > MAX_MALLOC_SIZE || len == 0) { if (ptr) free(ptr); return NULL; } return realloc(ptr, len); }
--- +++ @@ -13,6 +13,9 @@ if (count > MAX_MALLOC_SIZE || size > MAX_MALLOC_SIZE || count * size > MAX_MALLOC_SIZE) { return NULL; } + if (count == 0 || size == 0) { + return NULL; + } return calloc(count, size); }
Check readstat_calloc for 0-sized input
mit
WizardMac/ReadStat,WizardMac/ReadStat
a40390e142aaf9796ae3fd219e3aabdcda8ee096
#if !defined(_CARMIPRO_H) #define _CARMIPRO_H #include "pvmsdpro.h" #define CARMI_FIRST (SM_LAST+1) #define CARMI_RESPAWN (CARMI_FIRST+1) #define CARMI_CHKPT (CARMI_FIRST+2) #define CARMI_ADDHOST (CARMI_FIRST+3) #define CARMI_SPAWN (CARMI_FIRST+4) #define CARMI_CKPT_ON_VACATE (CARMI_FIRST + 5) #define CARMI_LAST (CARMI_CKPT_ON_VACATE) #define CO_CHECK_FIRST (CARMI_LAST+1) #define CO_CHECK_SIMPLE_CKPT_TASK_TO_FILE (CO_CHECK_FIRST + 1) #define CO_CHECK_RESTART_TASK_FROM_FILE (CO_CHECK_FIRST + 2) #define CO_CHECK_SIMPLE_CKPT_TASK (CO_CHECK_FIRST + 3) #define CO_CHECK_RESTART_TASK (CO_CHECK_FIRST + 4) #define CO_CHECK_SIMPLE_MIGRATE_TASK_TO_HOST (CO_CHECK_FIRST + 5) #define CO_CHECK_SIMPLE_MIGRATE_TASK (CO_CHECK_FIRST + 6) #endif
#if !defined(_CARMIPRO_H) #define _CARMIPRO_H #include "pvmsdpro.h" #define CARMI_FIRST (SM_LAST+1) #define CARMI_RESPAWN (CARMI_FIRST+1) #define CARMI_CHKPT (CARMI_FIRST+2) #define CARMI_ADDHOST (CARMI_FIRST+3) #endif
--- +++ @@ -7,4 +7,15 @@ #define CARMI_RESPAWN (CARMI_FIRST+1) #define CARMI_CHKPT (CARMI_FIRST+2) #define CARMI_ADDHOST (CARMI_FIRST+3) +#define CARMI_SPAWN (CARMI_FIRST+4) +#define CARMI_CKPT_ON_VACATE (CARMI_FIRST + 5) +#define CARMI_LAST (CARMI_CKPT_ON_VACATE) + +#define CO_CHECK_FIRST (CARMI_LAST+1) +#define CO_CHECK_SIMPLE_CKPT_TASK_TO_FILE (CO_CHECK_FIRST + 1) +#define CO_CHECK_RESTART_TASK_FROM_FILE (CO_CHECK_FIRST + 2) +#define CO_CHECK_SIMPLE_CKPT_TASK (CO_CHECK_FIRST + 3) +#define CO_CHECK_RESTART_TASK (CO_CHECK_FIRST + 4) +#define CO_CHECK_SIMPLE_MIGRATE_TASK_TO_HOST (CO_CHECK_FIRST + 5) +#define CO_CHECK_SIMPLE_MIGRATE_TASK (CO_CHECK_FIRST + 6) #endif
Define a whole bunch of new message tags for checkpoint and migration functions.
apache-2.0
zhangzhehust/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,htcondor/htcondor,djw8605/condor,djw8605/condor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,djw8605/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/condor,zhangzhehust/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,htcondor/htcondor
956c6edde28a3b60981059caf7a8bad137f76336
/* * 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.07.00.02-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 7 #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.06.00.12-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 6 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
--- +++ @@ -7,9 +7,9 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.06.00.12-k" +#define QLA2XXX_VERSION "8.07.00.02-k" #define QLA_DRIVER_MAJOR_VER 8 -#define QLA_DRIVER_MINOR_VER 6 +#define QLA_DRIVER_MINOR_VER 7 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
[SCSI] qla2xxx: Update the driver version to 8.07.00.02-k. Signed-off-by: Saurav Kashyap <[email protected]> Signed-off-by: Giridhar Malavali <[email protected]> Signed-off-by: James Bottomley <[email protected]>
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
823c535f2169b755a77a413d5f957e9457c22cb3
#include <X11/Xlib.h> #include "libx11_ruby.h" VALUE rb_mLibX11, rb_cDisplay; static size_t display_memsize(const void *); static const rb_data_type_t display_type = { .wrap_struct_name = "libx11_display", .function = { .dmark = NULL, .dfree = NULL, .dsize = display_memsize, .reserved = { NULL, NULL }, }, .parent = NULL, .data = NULL, .flags = RUBY_TYPED_FREE_IMMEDIATELY, }; static size_t display_memsize(const void *arg) { const Display *display = arg; return sizeof(display); } /* * Xlib XOpenDisplay */ static VALUE rb_libx11_open_display(VALUE self, VALUE display_name) { Display *display; Check_Type(display_name, T_STRING); display = XOpenDisplay(RSTRING_PTR(display_name)); return TypedData_Wrap_Struct(rb_cDisplay, &display_type, display); } /* * Xlib XCloseDisplay */ static VALUE rb_libx11_close_display(VALUE self, VALUE obj) { int ret; Display *display; TypedData_Get_Struct(obj, Display, &display_type, display); ret = XCloseDisplay(display); return INT2FIX(ret); } void Init_libx11_ruby(void) { rb_mLibX11 = rb_define_module("LibX11"); rb_define_singleton_method(rb_mLibX11, "open_display", rb_libx11_open_display, 1); rb_define_singleton_method(rb_mLibX11, "close_display", rb_libx11_close_display, 1); rb_cDisplay = rb_define_class_under(rb_mLibX11, "Display", rb_cData); }
#include "libx11_ruby.h" VALUE rb_mLibX11; void Init_libx11_ruby(void) { rb_mLibX11 = rb_define_module("LibX11"); }
--- +++ @@ -1,9 +1,63 @@ +#include <X11/Xlib.h> #include "libx11_ruby.h" -VALUE rb_mLibX11; +VALUE rb_mLibX11, rb_cDisplay; + +static size_t display_memsize(const void *); + +static const rb_data_type_t display_type = { + .wrap_struct_name = "libx11_display", + .function = { + .dmark = NULL, + .dfree = NULL, + .dsize = display_memsize, + .reserved = { NULL, NULL }, + }, + .parent = NULL, + .data = NULL, + .flags = RUBY_TYPED_FREE_IMMEDIATELY, +}; + +static size_t +display_memsize(const void *arg) +{ + const Display *display = arg; + return sizeof(display); +} + +/* + * Xlib XOpenDisplay + */ +static VALUE +rb_libx11_open_display(VALUE self, VALUE display_name) +{ + Display *display; + Check_Type(display_name, T_STRING); + + display = XOpenDisplay(RSTRING_PTR(display_name)); + return TypedData_Wrap_Struct(rb_cDisplay, &display_type, display); +} + +/* + * Xlib XCloseDisplay + */ +static VALUE +rb_libx11_close_display(VALUE self, VALUE obj) +{ + int ret; + Display *display; + + TypedData_Get_Struct(obj, Display, &display_type, display); + ret = XCloseDisplay(display); + return INT2FIX(ret); +} void Init_libx11_ruby(void) { rb_mLibX11 = rb_define_module("LibX11"); + rb_define_singleton_method(rb_mLibX11, "open_display", rb_libx11_open_display, 1); + rb_define_singleton_method(rb_mLibX11, "close_display", rb_libx11_close_display, 1); + + rb_cDisplay = rb_define_class_under(rb_mLibX11, "Display", rb_cData); }
Add bindings for XOpenDisplay and XCloseDisplay
mit
k0kubun/libx11-ruby,k0kubun/libx11-ruby
d61e95344b2052b6dfa8a96a61fff6b99f08e008
#ifndef REDCARPET_H__ #define REDCARPET_H__ #define RSTRING_NOT_MODIFIED #include "ruby.h" #include <stdio.h> #include <ruby/encoding.h> #define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc) #include "markdown.h" #include "html.h" #define CSTR2SYM(s) (ID2SYM(rb_intern((s)))) void Init_redcarpet_rndr(); struct redcarpet_renderopt { struct html_renderopt html; VALUE link_attributes; VALUE self; VALUE base_class; rb_encoding *active_enc; }; struct rb_redcarpet_rndr { struct sd_callbacks callbacks; struct redcarpet_renderopt options; }; #endif
#ifndef REDCARPET_H__ #define REDCARPET_H__ #define RSTRING_NOT_MODIFIED #include "ruby.h" #include <stdio.h> #ifdef HAVE_RUBY_ENCODING_H # include <ruby/encoding.h> # define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc) #else # define redcarpet_str_new(data, size, enc) rb_str_new(data, size) #endif #include "markdown.h" #include "html.h" #define CSTR2SYM(s) (ID2SYM(rb_intern((s)))) void Init_redcarpet_rndr(); struct redcarpet_renderopt { struct html_renderopt html; VALUE link_attributes; VALUE self; VALUE base_class; #ifdef HAVE_RUBY_ENCODING_H rb_encoding *active_enc; #endif }; struct rb_redcarpet_rndr { struct sd_callbacks callbacks; struct redcarpet_renderopt options; }; #endif
--- +++ @@ -5,12 +5,8 @@ #include "ruby.h" #include <stdio.h> -#ifdef HAVE_RUBY_ENCODING_H -# include <ruby/encoding.h> -# define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc) -#else -# define redcarpet_str_new(data, size, enc) rb_str_new(data, size) -#endif +#include <ruby/encoding.h> +#define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc) #include "markdown.h" #include "html.h" @@ -24,9 +20,7 @@ VALUE link_attributes; VALUE self; VALUE base_class; -#ifdef HAVE_RUBY_ENCODING_H rb_encoding *active_enc; -#endif }; struct rb_redcarpet_rndr {
Remove encoding conditionals that are no longer required These are no longer needed since we don't support Ruby 1.8.x anymore.
mit
emq/redcarpet,fukayatsu/redcarpet,be9/redcarpet,Hacker0x01/redcarpet,emq/redcarpet,fukayatsu/redcarpet,kattybilly/redcarpet,gitcafe-dev/redcarpet,liquorburn/redcarpet,increments/greenmat,liquorburn/redcarpet,increments/greenmat,JuanitoFatas/redcarpet,Hacker0x01/redcarpet,kaneshin/redcarpet,Hacker0x01/redcarpet,increments/greenmat,Hacker0x01/redcarpet,vmg/redcarpet,fukayatsu/redcarpet,JuanitoFatas/redcarpet,be9/redcarpet,vmg/redcarpet,JuanitoFatas/redcarpet,kattybilly/redcarpet,kaneshin/redcarpet,increments/greenmat,emq/redcarpet,gitcafe-dev/redcarpet,be9/redcarpet,liquorburn/redcarpet,vmg/redcarpet,gitcafe-dev/redcarpet,kattybilly/redcarpet,emq/redcarpet,fukayatsu/redcarpet,liquorburn/redcarpet,be9/redcarpet,kattybilly/redcarpet,kaneshin/redcarpet,kaneshin/redcarpet,vmg/redcarpet
7184f9e8ff130e010be0b6db2875d840a2f12edc
//=========================================== // Lumina-DE source code // Copyright (c) 2012, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #ifndef _LUMINA_DESKTOP_GLOBALS_H #define _LUMINA_DESKTOP_GLOBALS_H #include <unistd.h> class SYSTEM{ public: //Current Username static QString user(){ return QString(getlogin()); } //Current Hostname static QString hostname(){ char name[50]; gethostname(name,sizeof(name)); return QString(name); } //Shutdown the system static void shutdown(){ system("(shutdown -p now) &"); } //Restart the system static void restart(){ system("(shutdown -r now) &"); } }; /* class LUMINA{ public: static QIcon getIcon(QString iconname); static QIcon getFileIcon(QString filename); }; */ #endif
//=========================================== // Lumina-DE source code // Copyright (c) 2012, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #ifndef _LUMINA_DESKTOP_GLOBALS_H #define _LUMINA_DESKTOP_GLOBALS_H class SYSTEM{ public: //Current Username static QString user(){ return QString(getlogin()); } //Current Hostname static QString hostname(){ char name[50]; gethostname(name,sizeof(name)); return QString(name); } //Shutdown the system static void shutdown(){ system("(shutdown -p now) &"); } //Restart the system static void restart(){ system("(shutdown -r now) &"); } }; /* class LUMINA{ public: static QIcon getIcon(QString iconname); static QIcon getFileIcon(QString filename); }; */ #endif
--- +++ @@ -6,6 +6,8 @@ //=========================================== #ifndef _LUMINA_DESKTOP_GLOBALS_H #define _LUMINA_DESKTOP_GLOBALS_H + +#include <unistd.h> class SYSTEM{ public:
Fix up the Lumina compilation on 10.x
bsd-2-clause
pcbsd/external-projects,pcbsd/external-projects,pcbsd/external-projects,pcbsd/external-projects
4ede882f2c2b3a2409bddbbd6cee9bbbfdead905
#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
syscoin/syscoin,Crowndev/crowncoin,Infernoman/crowncoin,domob1812/crowncoin,Infernoman/crowncoin,Infernoman/crowncoin,domob1812/crowncoin,Infernoman/crowncoin,syscoin/syscoin,Infernoman/crowncoin,syscoin/syscoin,domob1812/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,domob1812/crowncoin,Crowndev/crowncoin,syscoin/syscoin,Crowndev/crowncoin,Infernoman/crowncoin,domob1812/crowncoin,syscoin/syscoin,domob1812/crowncoin,Crowndev/crowncoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin
674f0d242855b8f901dd29b6fe077aafc67593e4
#ifndef PHEVALUATOR_HAND_H #define PHEVALUATOR_HAND_H #ifdef __cplusplus #include <vector> #include <array> #include <string> #include "card.h" namespace phevaluator { class Hand { public: Hand() {} Hand(const std::vector<Card>& cards); Hand(const Card& card); Hand& operator+=(const Card& card); Hand operator+(const Card& card); const unsigned char& getSize() const { return size_; } const int& getSuitHash() const { return suitHash_; } const std::array<int, 4>& getSuitBinary() const { return suitBinary_; } const std::array<unsigned char, 13> getQuinary() const { return quinary_; } private: unsigned char size_ = 0; int suitHash_ = 0; std::array<int, 4> suitBinary_{{0}}; std::array<unsigned char, 13> quinary_{{0}}; }; } // namespace phevaluator #endif // __cplusplus #endif // PHEVALUATOR_HAND_H
#ifndef PHEVALUATOR_HAND_H #define PHEVALUATOR_HAND_H #ifdef __cplusplus #include <vector> #include <array> #include <string> #include "card.h" namespace phevaluator { class Hand { public: Hand() {} Hand(const std::vector<Card>& cards); Hand(const Card& card); Hand& operator+=(const Card& card); Hand operator+(const Card& card); const unsigned char& getSize() const { return size_; } const int& getSuitHash() const { return suitHash_; } const std::array<int, 4>& getSuitBinary() const { return suitBinary_; } const std::array<unsigned char, 13> getQuinary() const { return quinary_; } private: unsigned char size_ = 0; int suitHash_ = 0; std::array<int, 4> suitBinary_{0}; std::array<unsigned char, 13> quinary_{0}; }; } // namespace phevaluator #endif // __cplusplus #endif // PHEVALUATOR_HAND_H
--- +++ @@ -28,8 +28,8 @@ private: unsigned char size_ = 0; int suitHash_ = 0; - std::array<int, 4> suitBinary_{0}; - std::array<unsigned char, 13> quinary_{0}; + std::array<int, 4> suitBinary_{{0}}; + std::array<unsigned char, 13> quinary_{{0}}; }; } // namespace phevaluator
Fix a Hand type compiling errors in GNU compiler
apache-2.0
HenryRLee/PokerHandEvaluator,HenryRLee/PokerHandEvaluator,HenryRLee/PokerHandEvaluator
72467b21e9d8dced87245dda0aaef49c8965345a
/***** Preamble block ********************************************************* * * This file is part of h5py, a Python interface to the HDF5 library. * * http://www.h5py.org * * Copyright 2008-2013 Andrew Collette and contributors * * License: Standard 3-clause BSD; see "license.txt" for full license terms * and contributor agreement. * ****** End preamble block ****************************************************/ /* Contains compatibility macros and definitions for use by Cython code */ #ifndef H5PY_COMPAT #define H5PY_COMPAT #if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) typedef void *PyMPI_MPI_Message; #define MPI_Message PyMPI_MPI_Message #endif #include <stddef.h> #include "Python.h" #include "numpy/arrayobject.h" #include "hdf5.h" /* The HOFFSET macro can't be used from Cython. */ #define h5py_size_n64 (sizeof(npy_complex64)) #define h5py_size_n128 (sizeof(npy_complex128)) #define h5py_offset_n64_real (HOFFSET(npy_complex64, real)) #define h5py_offset_n64_imag (HOFFSET(npy_complex64, imag)) #define h5py_offset_n128_real (HOFFSET(npy_complex128, real)) #define h5py_offset_n128_imag (HOFFSET(npy_complex128, imag)) #endif
/***** Preamble block ********************************************************* * * This file is part of h5py, a Python interface to the HDF5 library. * * http://www.h5py.org * * Copyright 2008-2013 Andrew Collette and contributors * * License: Standard 3-clause BSD; see "license.txt" for full license terms * and contributor agreement. * ****** End preamble block ****************************************************/ /* Contains compatibility macros and definitions for use by Cython code */ #ifndef H5PY_COMPAT #define H5PY_COMPAT #include <stddef.h> #include "Python.h" #include "numpy/arrayobject.h" #include "hdf5.h" /* The HOFFSET macro can't be used from Cython. */ #define h5py_size_n64 (sizeof(npy_complex64)) #define h5py_size_n128 (sizeof(npy_complex128)) #define h5py_offset_n64_real (HOFFSET(npy_complex64, real)) #define h5py_offset_n64_imag (HOFFSET(npy_complex64, imag)) #define h5py_offset_n128_real (HOFFSET(npy_complex128, real)) #define h5py_offset_n128_imag (HOFFSET(npy_complex128, imag)) #endif
--- +++ @@ -16,6 +16,11 @@ #ifndef H5PY_COMPAT #define H5PY_COMPAT +#if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) +typedef void *PyMPI_MPI_Message; +#define MPI_Message PyMPI_MPI_Message +#endif + #include <stddef.h> #include "Python.h" #include "numpy/arrayobject.h"
Add conditional definition of PyMPI_MPI_Message and MPI_Message PyMPI_MPI_Message. This is needed for MPI_VERSION<3 and a recent version of mpi4py. Follows gh-401 https://groups.google.com/d/topic/h5py/Uw5x3BKwJGU/discussion and https://groups.google.com/d/topic/mpi4py/xnDyYvawB-Q/discussion.
bsd-3-clause
h5py/h5py,h5py/h5py,h5py/h5py
00126c32c776459b75e5d2bfaba28bd261c1510a
/** * main.c * * Copyright (C) 2017 Nickolas Burr <[email protected]> */ #include "common.h" #include "argv.h" #include "daemon.h" #include "usage.h" int main (int argc, char *argv[]) { /** * If the `--help` option was given, display usage details and exit. */ if (in_array(GIT_STASHD_USAGE_OPT, argv, argc)) { pfusage(); printf("%d\n", is_dir("/var/log")); exit(EXIT_SUCCESS); } /** * If the `--daemon` option was given, start a daemon. */ if (in_array("--daemon", argv, argc)) { stashd("/var/log"); } FILE *fp = fopen(GIT_STASHD_LOG_FILE, GIT_STASHD_LOG_MODE); if (!fp) { printf("Error opening file %s\n", GIT_STASHD_LOG_FILE); exit(EXIT_FAILURE); } while (1) { fprintf(fp, "git-stashd started.\n"); sleep(10); break; } fprintf(fp, "git-stashd terminated.\n"); fclose(fp); return EXIT_SUCCESS; }
/** * main.c * * Copyright (C) 2017 Nickolas Burr <[email protected]> */ #include "common.h" #include "argv.h" #include "daemon.h" #include "usage.h" int main (int argc, char *argv[]) { int i; /** * If the `--help` option was given, display usage details and exit */ if (in_array(GIT_STASHD_USAGE_OPT, argv, argc)) { pfusage(); printf("%d\n", is_dir("/var/log")); exit(EXIT_SUCCESS); } /** * Start daemon process */ // stashd(); for (i = 0; i < argc; i += 1) { const char *flag = argv[i]; printf("%s\n", flag); } FILE *fp = fopen(GIT_STASHD_LOG_FILE, GIT_STASHD_LOG_MODE); if (!fp) { printf("Error opening file %s\n", GIT_STASHD_LOG_FILE); exit(EXIT_FAILURE); } while (1) { fprintf(fp, "git-stashd started.\n"); sleep(10); break; } fprintf(fp, "git-stashd terminated.\n"); fclose(fp); return EXIT_SUCCESS; }
--- +++ @@ -10,10 +10,8 @@ #include "usage.h" int main (int argc, char *argv[]) { - int i; - /** - * If the `--help` option was given, display usage details and exit + * If the `--help` option was given, display usage details and exit. */ if (in_array(GIT_STASHD_USAGE_OPT, argv, argc)) { pfusage(); @@ -24,13 +22,10 @@ } /** - * Start daemon process + * If the `--daemon` option was given, start a daemon. */ - // stashd(); - - for (i = 0; i < argc; i += 1) { - const char *flag = argv[i]; - printf("%s\n", flag); + if (in_array("--daemon", argv, argc)) { + stashd("/var/log"); } FILE *fp = fopen(GIT_STASHD_LOG_FILE, GIT_STASHD_LOG_MODE); @@ -43,14 +38,12 @@ while (1) { fprintf(fp, "git-stashd started.\n"); - sleep(10); break; } fprintf(fp, "git-stashd terminated.\n"); - fclose(fp); return EXIT_SUCCESS;
Work on --daemon option handling
mit
nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd
4447cbac38eca7657a77e5d96a4c9f9d9710207c
/* Try to drop the last supplemental group, and print a message to stdout describing what happened. */ #include <errno.h> #include <grp.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> #define NGROUPS_MAX 128 int main() { int group_ct; gid_t groups[NGROUPS_MAX]; group_ct = getgroups(NGROUPS_MAX, groups); if (group_ct == -1) { printf("ERROR\tgetgroups(2) failed with errno=%d\n", errno); return 1; } fprintf(stderr, "found %d groups; trying to drop last group %d\n", group_ct, groups[group_ct - 1]); if (setgroups(group_ct - 1, groups)) { if (errno == EPERM) { printf("SAFE\tsetgroups(2) failed with EPERM\n"); return 0; } else { printf("ERROR\tsetgroups(2) failed with errno=%d\n", errno); return 1; } } else { printf("RISK\tsetgroups(2) succeeded\n"); return 1; } }
/* Try to drop the last supplemental group, and print a message to stdout describing what happened. */ #include <errno.h> #include <grp.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> #define NGROUPS_MAX 32 int main() { int group_ct; gid_t groups[NGROUPS_MAX]; group_ct = getgroups(NGROUPS_MAX, groups); if (group_ct == -1) { printf("ERROR\tgetgroups(2) failed with errno=%d\n", errno); return 1; } fprintf(stderr, "found %d groups; trying to drop last group %d\n", group_ct, groups[group_ct - 1]); if (setgroups(group_ct - 1, groups)) { if (errno == EPERM) { printf("SAFE\tsetgroups(2) failed with EPERM\n"); return 0; } else { printf("ERROR\tsetgroups(2) failed with errno=%d\n", errno); return 1; } } else { printf("RISK\tsetgroups(2) succeeded\n"); return 1; } }
--- +++ @@ -7,7 +7,7 @@ #include <sys/types.h> #include <unistd.h> -#define NGROUPS_MAX 32 +#define NGROUPS_MAX 128 int main() {
Raise maximum groups in chtest to the same number used in ch-run. Signed-off-by: Oliver Freyermuth <[email protected]>
apache-2.0
hpc/charliecloud,hpc/charliecloud,hpc/charliecloud
c9b258415efd0659e53c756ccd979b33afb4e8d4
// RUN: clang -checker-simple -verify %s struct FPRec { void (*my_func)(int * x); }; int bar(int x); int f1_a(struct FPRec* foo) { int x; (*foo->my_func)(&x); return bar(x)+1; // no-warning } int f1_b() { int x; return bar(x)+1; // expected-warning{{Pass-by-value argument in function is undefined.}} } int f2() { int x; if (x+1) // expected-warning{{Branch}} return 1; return 2; } int f2_b() { int x; return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}} } int f3(void) { int i; int *p = &i; if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}} return 0; else return 1; } // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; }; struct s global; void g(int); void f4() { int a; if (global.data == 0) a = 3; if (global.data == 0) g(a); // no-warning }
// RUN: clang -checker-simple -verify %s struct FPRec { void (*my_func)(int * x); }; int bar(int x); int f1_a(struct FPRec* foo) { int x; (*foo->my_func)(&x); return bar(x)+1; // no-warning } int f1_b() { int x; return bar(x)+1; // expected-warning{{Pass-by-value argument in function is undefined.}} } int f2() { int x; if (x+1) // expected-warning{{Branch}} return 1; return 2; } int f2_b() { int x; return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}} } int f3(void) { int i; int *p = &i; if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}} return 0; else return 1; }
--- +++ @@ -41,3 +41,21 @@ else return 1; } + +// RUN: clang -checker-simple -analyzer-store-region -verify %s + +struct s { + int data; +}; + +struct s global; + +void g(int); + +void f4() { + int a; + if (global.data == 0) + a = 3; + if (global.data == 0) + g(a); // no-warning +}
Add test for path-sensitive uninit-val detection involving struct field. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59620 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
89e8a07af3e24ae0f843b80906422d711f73de0a
#define WORD (8 * sizeof(ulong)) #define clz(x) __builtin_clzl(x) #define fls(x) (WORD - clz(x)) #define ffs(x) (__builtin_ctzl(x)) #define get(x, i) ((x) & (1L << (i))) #define set(x, i) (x = (x) | (1L << (i))) #define unset(x, i) (x = (x) & ~(1L << (i)))
#define WORD (8 * sizeof(ulong)) #define clz(x) __builtin_clzl(x) #define fls(x) (WORD - clz(x)) #define ffs(x) (__builtin_ctzl(x)) #define get(x, i) ((x) & (1 << (i))) #define set(x, i) (x = (x) | (1 << (i))) #define unset(x, i) (x = (x) & ~(1 << (i)))
--- +++ @@ -6,8 +6,8 @@ #define ffs(x) (__builtin_ctzl(x)) -#define get(x, i) ((x) & (1 << (i))) +#define get(x, i) ((x) & (1L << (i))) -#define set(x, i) (x = (x) | (1 << (i))) +#define set(x, i) (x = (x) | (1L << (i))) -#define unset(x, i) (x = (x) & ~(1 << (i))) +#define unset(x, i) (x = (x) & ~(1L << (i)))
Fix to literal data types in the macros Thanks for Fu, Bing for noting.
mit
coriolanus/libhhash
84fa2ddd969525d8d92329bda9e9b9457ebc3ddd
#ifndef SCREENSHOT_H_INCLUDED_ #define SCREENSHOT_H_INCLUDED_ #include <vector> #include <string> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/X.h> using namespace std; class X11Screenshot { public: X11Screenshot(XImage * image, int new_width=0, int new_height=0, string downscale_type="lineral"); bool save_to_png(const char * path); bool save_to_jpeg(const char * path, int quality); int get_width(void); int get_height(void); private: int width = 0; int height = 0; vector<vector<unsigned char>> image_data = vector<vector<unsigned char>>(); vector<vector<unsigned char>> process_original(XImage * image); vector<vector<unsigned char>> process_downscale_lineral(XImage * image, int new_width=0, int new_height=0); vector<vector<unsigned char>> process_downscale_bilineral(XImage * image, int new_width=0, int new_height=0); }; #endif
#ifndef SCREENSHOT_H_INCLUDED_ #define SCREENSHOT_H_INCLUDED_ #include <vector> #include <string> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/X.h> using namespace std; class X11Screenshot { public: X11Screenshot(XImage * image); bool save_to_png(const char * path); bool save_to_jpeg(const char * path, int quality); int get_width(void); int get_height(void); private: int width = 0; int height = 0; vector<vector<unsigned char>> image_data; vector<vector<unsigned char>> process_rgb_image(XImage * image); }; #endif
--- +++ @@ -9,7 +9,7 @@ class X11Screenshot { public: - X11Screenshot(XImage * image); + X11Screenshot(XImage * image, int new_width=0, int new_height=0, string downscale_type="lineral"); bool save_to_png(const char * path); bool save_to_jpeg(const char * path, int quality); int get_width(void); @@ -18,8 +18,10 @@ private: int width = 0; int height = 0; - vector<vector<unsigned char>> image_data; - vector<vector<unsigned char>> process_rgb_image(XImage * image); + vector<vector<unsigned char>> image_data = vector<vector<unsigned char>>(); + vector<vector<unsigned char>> process_original(XImage * image); + vector<vector<unsigned char>> process_downscale_lineral(XImage * image, int new_width=0, int new_height=0); + vector<vector<unsigned char>> process_downscale_bilineral(XImage * image, int new_width=0, int new_height=0); }; #endif
Change X11Screenshot structure, add downscale options
mit
Butataki/cpp-x11-make-screenshot
1e30ca0b2926f671dec192f358b8739e63a450c2