commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
80c88c62ea05233e2f613542b8ce476328422364
libevmjit/CompilerHelper.h
libevmjit/CompilerHelper.h
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelper(llvm::IRBuilder<>& _builder); CompilerHelper(const CompilerHelper&) = delete; CompilerHelper& operator=(CompilerHelper) = delete; /// Reference to the IR module being compiled llvm::Module* getModule(); /// Reference to the main module function llvm::Function* getMainFunction(); /// Reference to parent compiler IR builder llvm::IRBuilder<>& m_builder; llvm::IRBuilder<>& getBuilder() { return m_builder; } llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args); friend class RuntimeHelper; }; /// Compiler helper that depends on runtime data class RuntimeHelper : public CompilerHelper { protected: RuntimeHelper(RuntimeManager& _runtimeManager); RuntimeManager& getRuntimeManager() { return m_runtimeManager; } private: RuntimeManager& m_runtimeManager; }; using InsertPointGuard = llvm::IRBuilderBase::InsertPointGuard; } } }
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelper(llvm::IRBuilder<>& _builder); CompilerHelper(const CompilerHelper&) = delete; CompilerHelper& operator=(CompilerHelper) = delete; /// Reference to the IR module being compiled llvm::Module* getModule(); /// Reference to the main module function llvm::Function* getMainFunction(); /// Reference to parent compiler IR builder llvm::IRBuilder<>& m_builder; llvm::IRBuilder<>& getBuilder() { return m_builder; } llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args); friend class RuntimeHelper; }; /// Compiler helper that depends on runtime data class RuntimeHelper : public CompilerHelper { protected: RuntimeHelper(RuntimeManager& _runtimeManager); RuntimeManager& getRuntimeManager() { return m_runtimeManager; } private: RuntimeManager& m_runtimeManager; }; struct InsertPointGuard { explicit InsertPointGuard(llvm::IRBuilderBase& _builder): m_builder(_builder), m_insertPoint(_builder.saveIP()) {} ~InsertPointGuard() { m_builder.restoreIP(m_insertPoint); } private: llvm::IRBuilderBase& m_builder; decltype(m_builder.saveIP()) m_insertPoint; }; } } }
Reimplement InsertPointGuard to avoid LLVM ABI incompatibility.
Reimplement InsertPointGuard to avoid LLVM ABI incompatibility. In general, the NDEBUG flag should match cpp-ethereum and LLVM builds. But this is hard to satisfy as we usually have one system-wide build of LLVM and different builds of cpp-ethereum. This ABI incompatibility hit OSX only in release builds as LLVM is built by homebrew with assertions by default.
C
mit
debris/evmjit,ethcore/evmjit,debris/evmjit,ethcore/evmjit
9e8f0fbbc0448faff7072b7f8fd66b031f9abc80
src/entry.h
src/entry.h
#ifndef ENTRY_H #define ENTRY_H #include <string> #include <memory> namespace diaryengine { class Entry { public: Entry(); ~Entry(); void setTitle(std::string title); std::string title(); private: struct Implementation; std::unique_ptr<Implementation> inside_; }; } #endif // ENTRY_H
#ifndef ENTRY_H #define ENTRY_H #include <string> #include <memory> namespace diaryengine { class Entry { public: Entry(); ~Entry(); void setTitle(std::string title); std::string title(); private: struct Implementation; std::unique_ptr<Implementation> _inside; }; } #endif // ENTRY_H
Rename the implementation pointer to respect naming convention
Rename the implementation pointer to respect naming convention
C
bsd-3-clause
Acce0ss/diary-engine
1ee6c2c3fea091cf61d21e190dcf195b2149bc01
src/main.c
src/main.c
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; for(F = 1; F < argc; F++) { printf("%s", argv[F]);fflush(stdout); // Load the file. FILE * fh = fopen(argv[F], "r"); // Instance the parser. verilog_parser parser = verilog_file_parse(fh); printf(" parser built ");fflush(stdout); // Parse the file and store the result. int result = verilog_parse_buffer(parser); printf(" parser finished");fflush(stdout); verilog_free_parser(parser); printf(" parser freed");fflush(stdout); fclose(fh); if(result == 0) { printf(" - Parse successful\n"); } else { printf(" - Parse failed for\n"); } } } return 0; }
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; for(F = 1; F < argc; F++) { printf("%s", argv[F]);fflush(stdout); // Load the file. FILE * fh = fopen(argv[F], "r"); // Instance the parser. verilog_parser parser = verilog_file_parse(fh); printf(" parser built ");fflush(stdout); // Parse the file and store the result. int result = verilog_parse_buffer(parser); printf(" parser finished");fflush(stdout); verilog_free_parser(parser); printf(" parser freed");fflush(stdout); fclose(fh); if(result == 0) { printf(" - Parse successful\n"); } else { printf(" - Parse failed for\n"); if(argc<=2) return 1; } } } return 0; }
Fix incorrect reporting of successful parsing. On branch master Your branch is ahead of 'github/master' by 3 commits. (use "git push" to publish your local commits)
Fix incorrect reporting of successful parsing. On branch master Your branch is ahead of 'github/master' by 3 commits. (use "git push" to publish your local commits) Changes to be committed: modified: src/main.c
C
mit
ben-marshall/verilog-parser,ben-marshall/verilog-parser,ben-marshall/verilog-parser
1a9fd1ee0be588aa465a2bc405a86bb4669e3288
src/whitgl/logging.c
src/whitgl/logging.c
#include <stdarg.h> #include <stdio.h> #include <whitgl/logging.h> #define LOG_BUFFER_MAX (256) char _buffer[LOG_BUFFER_MAX]; void whitgl_logit(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("%24s:%03d %s\n", file, line, _buffer); } void whitgl_panic(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("PANIC %24s:%03d %s\n", file, line, _buffer); __builtin_trap(); }
#include <stdarg.h> #include <stdio.h> #include <whitgl/logging.h> #define LOG_BUFFER_MAX (256) char _buffer[LOG_BUFFER_MAX]; void whitgl_logit(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("%24s:%03d %s\n", file, line, _buffer); } void whitgl_panic(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("PANIC %24s:%03d %s\n", file, line, _buffer); fflush(stdout); __builtin_trap(); }
Make sure stdout is flushed before trapping in panic
Make sure stdout is flushed before trapping in panic
C
mit
whitingjp/whitgl,whitingjp/whitgl,whitingjp/whitgl,whitingjp/whitgl
082299ce611b1e2878001e0daa2b67dcc01a4a77
MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h
MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @interface NSManagedObject (MagicalRecord_DataImport) - (BOOL) MR_importValuesForKeysWithObject:(id)objectData; + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end @interface NSManagedObject (MagicalRecord_DataImportControls) - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @interface NSManagedObject (MagicalRecord_DataImport) + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end @interface NSManagedObject (MagicalRecord_DataImportControls) - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end
Remove unnecessarily public method from interface
Remove unnecessarily public method from interface
C
mit
naqi/MagicalRecord,naqi/MagicalRecord
2cb62ce24b2e2ddb3bc0ddcee36eb377c1c4b083
TLLayoutTransitioning/TLLayoutTransitioning.h
TLLayoutTransitioning/TLLayoutTransitioning.h
// // TLLayoutTransitioning.h // TLLayoutTransitioning // // Created by Tim Moose on 6/29/15. // Copyright (c) 2015 Tractable Labs. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TLLayoutTransitioning. FOUNDATION_EXPORT double TLLayoutTransitioningVersionNumber; //! Project version string for TLLayoutTransitioning. FOUNDATION_EXPORT const unsigned char TLLayoutTransitioningVersionString[]; <TLLayoutTransitioning/TLTransitionLayout.h> <TLLayoutTransitioning/UICollectionView+TLTransitioning.h>
// // TLLayoutTransitioning.h // TLLayoutTransitioning // // Created by Tim Moose on 6/29/15. // Copyright (c) 2015 Tractable Labs. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TLLayoutTransitioning. FOUNDATION_EXPORT double TLLayoutTransitioningVersionNumber; //! Project version string for TLLayoutTransitioning. FOUNDATION_EXPORT const unsigned char TLLayoutTransitioningVersionString[]; #import <TLLayoutTransitioning/TLTransitionLayout.h> #import <TLLayoutTransitioning/UICollectionView+TLTransitioning.h>
Fix typo in umbrella header
Fix typo in umbrella header
C
mit
wtmoose/TLLayoutTransitioning
a44f98e67ef60d340e76d19e4c5a94ffb2279b0c
src/os/Linux/findself.c
src/os/Linux/findself.c
#include <unistd.h> #include <limits.h> char *os_find_self(void) { // Using PATH_MAX is generally bad, but that's what readlink() says it uses. size_t size = PATH_MAX; char *path = malloc(size); if (readlink("/proc/self/exe", path, size) == 0) { return path; } else { free(path); return NULL; } }
#include <unistd.h> #include <stdlib.h> char *os_find_self(void) { // PATH_MAX (used by readlink(2)) is not necessarily available size_t size = 4096; char *path = malloc(size); size_t used = readlink("/proc/self/exe", path, size); // need strictly less than size, or else we probably truncated if (used < size) { return path; } else { free(path); return NULL; } }
Mend improper use of readlink(2)
Mend improper use of readlink(2) The return-code checking for readlink(2) would never succeed before this change. Also avoid referencing a PATH_MAX that may be missing.
C
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
b7cfa9fd4b789b02d856edb23f2ee4b76fb7aeb8
include/inform/inform.h
include/inform/inform.h
// Copyright 2016 ELIFE. All rights reserved. // Use of this source code is governed by a MIT // license that can be found in the LICENSE file. #pragma once #include <inform/dist.h> #include <inform/entropy.h> #include <inform/state_encoding.h> #include <inform/time_series.h>
Create an "include all" header for the project
Create an "include all" header for the project
C
mit
dglmoore/Inform,ELIFE-ASU/Inform,dglmoore/Inform,ELIFE-ASU/Inform
c0bde2429f69dd551c5c5d78b43e958b4b9370c9
MGSFragariaTextViewDelegate.h
MGSFragariaTextViewDelegate.h
// // MGSFragariaTextViewDelegate.h // Fragaria // // Created by Jim Derry on 2/22/15. // // /** * This protocol defines an interface for delegates that wish * to receive notifications from Fragaria's text view. **/ #pragma mark - MGSFragariaTextViewDelegate Protocol @protocol MGSFragariaTextViewDelegate <NSObject> @optional /** * This notification is send when the paste has been accepted. You can use * this delegate method to query the pasteboard for additional pasteboard content * that may be relevant to the application: eg: a plist that may contain custom data. * @param note is an NSNotification instance. **/ - (void)mgsTextDidPaste:(NSNotification *)note; @end
// // MGSFragariaTextViewDelegate.h // Fragaria // // Created by Jim Derry on 2/22/15. // // /** * This protocol defines an interface for delegates that wish * to receive notifications from Fragaria's text view. **/ #pragma mark - MGSFragariaTextViewDelegate Protocol @protocol MGSFragariaTextViewDelegate <NSTextViewDelegate> @optional /** * This notification is send when the paste has been accepted. You can use * this delegate method to query the pasteboard for additional pasteboard content * that may be relevant to the application: eg: a plist that may contain custom data. * @param note is an NSNotification instance. **/ - (void)mgsTextDidPaste:(NSNotification *)note; @end
Make Fragaria's text view delegate protocol compatible with NSTextViewDelegate.
Make Fragaria's text view delegate protocol compatible with NSTextViewDelegate.
C
apache-2.0
shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,vakoc/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,vakoc/Fragaria,shysaur/Fragaria,shysaur/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria
10482dab9d045436ff3b0a97d92cc60aa80386ab
factorial.c
factorial.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "weecrypt.h" void print_factorial(unsigned n); int main(void) { char buf[512]; mpi_t fib; mpi_init(fib); while (printf("Enter N: ") && fgets(buf, sizeof(buf), stdin)) { unsigned n = (unsigned)strtoul(buf, NULL, 10); if (!n) break; print_factorial(n); } return 0; } void print_factorial(unsigned n) { mpi_t f; mpi_init_u32(f, n); for (unsigned m = 2; m < n; ++m) { mpi_mul_u32(f, m, f); } printf("%u! = ", n), mpi_print_dec(f), printf("\n"); printf("As double: %g\n", mpi_get_d(f)); mpi_free(f); }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "weecrypt.h" void print_factorial(unsigned n); int main(void) { char buf[512]; mpi_t fib; mpi_init(fib); while (printf("Enter N: ") && fgets(buf, sizeof(buf), stdin)) { unsigned n = (unsigned)strtoul(buf, NULL, 10); if (!n) break; print_factorial(n); } return 0; } void print_factorial(unsigned n) { mpi_t f; mpi_init_u32(f, n); printf("%u! = ", n); fflush(stdout); for (unsigned m = 2; m < n; ++m) { mpi_mul_u32(f, m, f); } mpi_print_dec(f), printf("\n"); printf("As double: %g\n", mpi_get_d(f)); mpi_free(f); }
Print N before computing F(N)
Print N before computing F(N)
C
bsd-2-clause
fmela/weecrypt,fmela/weecrypt
43a0a428cd1d3a14cb110149c1e7207cd3362c7c
DocFormats/DFTypes.h
DocFormats/DFTypes.h
// Copyright 2012-2014 UX Productivity Pty Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef DocFormats_DFTypes_h #define DocFormats_DFTypes_h #ifdef _MSC_VER #define ATTRIBUTE_ALIGNED(n) #define ATTRIBUTE_FORMAT(archetype,index,first) #else #define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n))) #define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first))) #endif #ifdef WIN32 #define _CRT_SECURE_NO_WARNINGS #endif #include <sys/types.h> #include <stdint.h> #include <stdarg.h> #endif
// Copyright 2012-2014 UX Productivity Pty Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef DocFormats_DFTypes_h #define DocFormats_DFTypes_h #ifdef _MSC_VER #define ATTRIBUTE_ALIGNED(n) #define ATTRIBUTE_FORMAT(archetype,index,first) #else #define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n))) #define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first))) #endif #ifdef WIN32 #define _CRT_SECURE_NO_WARNINGS #include <windows.h> #endif #include <sys/types.h> #include <stdint.h> #include <stdarg.h> #endif
Include windows.h (indirectly) in all files
Win32: Include windows.h (indirectly) in all files
C
apache-2.0
corinthia/corinthia-docformats,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,corinthia/corinthia-docformats,corinthia/corinthia-docformats,apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,apache/incubator-corinthia
45211b0254ead7397297746a80c5ec93c8c88f6d
otherlibs/unix/setsid.c
otherlibs/unix/setsid.c
/**************************************************************************/ /* */ /* OCaml */ /* */ /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ /* */ /* Copyright 1997 Institut National de Recherche en Informatique et */ /* en Automatique. */ /* */ /* All rights reserved. This file is distributed under the terms of */ /* the GNU Lesser General Public License version 2.1, with the */ /* special exception on linking described in the file LICENSE. */ /* */ /**************************************************************************/ #include <caml/fail.h> #include <caml/mlvalues.h> #include "unixsupport.h" #ifdef HAS_UNISTD #include <unistd.h> #endif CAMLprim value unix_setsid(value unit) { #ifdef HAS_SETSID return Val_int(setsid()); #else invalid_argument("setsid not implemented"); return Val_unit; #endif }
/**************************************************************************/ /* */ /* OCaml */ /* */ /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ /* */ /* Copyright 1997 Institut National de Recherche en Informatique et */ /* en Automatique. */ /* */ /* All rights reserved. This file is distributed under the terms of */ /* the GNU Lesser General Public License version 2.1, with the */ /* special exception on linking described in the file LICENSE. */ /* */ /**************************************************************************/ #include <caml/fail.h> #include <caml/mlvalues.h> #include "unixsupport.h" #ifdef HAS_UNISTD #include <unistd.h> #endif CAMLprim value unix_setsid(value unit) { #ifdef HAS_SETSID return Val_int(setsid()); #else caml_invalid_argument("setsid not implemented"); return Val_unit; #endif }
Remove use of compatibility macros in Cygwin-specific code.
Remove use of compatibility macros in Cygwin-specific code. This fixes PR #892 (commit 13945a71ed2616df9a4672cfc83f8f450ec437a8): there was one compatibility macro remaining in Cygwin-specific code.
C
lgpl-2.1
gerdstolpmann/ocaml,msprotz/ocaml,yunxing/ocaml,yunxing/ocaml,gerdstolpmann/ocaml,msprotz/ocaml,yunxing/ocaml,gerdstolpmann/ocaml,yunxing/ocaml,gerdstolpmann/ocaml,msprotz/ocaml,yunxing/ocaml,msprotz/ocaml,gerdstolpmann/ocaml,msprotz/ocaml
3ff331a9af67827d17aea5cf75e2f49ee4cb36b9
examples/test/testcases-v1/test-control-in-out.c
examples/test/testcases-v1/test-control-in-out.c
// SPDX-License-Identifier: Apache-2.0 // Copyright 2018 Eotvos Lorand University, Budapest, Hungary #include "test.h" fake_cmd_t t4p4s_testcase_test[][RTE_MAX_LCORE] = { { // table lookup hits {FAKE_PKT, 0, 1, FDATA("AA00"), 200, 123, FDATA("AA22")}, // table lookup misses {FAKE_PKT, 0, 1, FDATA("BB00"), 200, 123, FDATA("BB44")}, FEND, }, { FEND, }, }; testcase_t t4p4s_test_suite[MAX_TESTCASES] = { { "test", &t4p4s_testcase_test }, TEST_SUITE_END, };
// SPDX-License-Identifier: Apache-2.0 // Copyright 2018 Eotvos Lorand University, Budapest, Hungary #include "test.h" fake_cmd_t t4p4s_testcase_test[][RTE_MAX_LCORE] = SINGLE_LCORE( // table lookup hits FAST(1, 123, INOUT("AA00", "AA22")), WAIT_FOR_CTL, WAIT_FOR_CTL, WAIT_FOR_CTL, // table lookup misses FAST(1, 123, INOUT("BB00", "BB11")) ); testcase_t t4p4s_test_suite[MAX_TESTCASES] = { { "test", &t4p4s_testcase_test }, TEST_SUITE_END, };
Simplify and fix test case
Simplify and fix test case
C
apache-2.0
P4ELTE/t4p4s,P4ELTE/t4p4s,P4ELTE/t4p4s
11e298829b132c9f192ff754845de178d736b8b2
include/System/plugin.h
include/System/plugin.h
/* $Id$ */ /* Copyright (c) 2008-2014 Pierre Pronchery <[email protected]> */ /* This file is part of DeforaOS System libSystem */ /* This program 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, version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LIBSYSTEM_SYSTEM_PLUGIN_H # define LIBSYSTEM_SYSTEM_PLUGIN_H # include "string.h" /* Plugin */ typedef void Plugin; /* functions */ Plugin * plugin_new(String const * libdir, String const * package, String const * type, String const * name); Plugin * plugin_new_self(void); void plugin_delete(Plugin * plugin); /* useful */ void * plugin_lookup(Plugin * plugin, String const * symbol); #endif /* !LIBSYSTEM_SYSTEM_PLUGIN_H */
/* $Id$ */ /* Copyright (c) 2008-2014 Pierre Pronchery <[email protected]> */ /* This file is part of DeforaOS System libSystem */ /* This program 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, version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LIBSYSTEM_SYSTEM_PLUGIN_H # define LIBSYSTEM_SYSTEM_PLUGIN_H # include "license.h" # include "string.h" /* Plugin */ typedef void Plugin; typedef struct _PluginHeader { char const * name; char const * icon; char const * description; LicenseFlags license; } PluginHeader; /* functions */ Plugin * plugin_new(String const * libdir, String const * package, String const * type, String const * name); Plugin * plugin_new_self(void); void plugin_delete(Plugin * plugin); /* useful */ void * plugin_lookup(Plugin * plugin, String const * symbol); #endif /* !LIBSYSTEM_SYSTEM_PLUGIN_H */
Define a standard header for plug-ins
Define a standard header for plug-ins
C
bsd-2-clause
DeforaOS/libSystem,DeforaOS/libSystem,DeforaOS/libSystem
7f06a7c107b2051ff24cc6d40bbcf024538281cb
include/perfetto/protozero/contiguous_memory_range.h
include/perfetto/protozero/contiguous_memory_range.h
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #include <assert.h> #include <stddef.h> #include <stdint.h> namespace protozero { // Keep this struct trivially constructible (no ctors, no default initializers). struct ContiguousMemoryRange { uint8_t* begin; uint8_t* end; // STL style: one byte past the end of the buffer. inline bool is_valid() const { return begin != nullptr; } inline void reset() { begin = nullptr; } inline size_t size() { return static_cast<size_t>(end - begin); } }; } // namespace protozero #endif // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #include <assert.h> #include <stddef.h> #include <stdint.h> namespace protozero { // Keep this struct trivially constructible (no ctors, no default initializers). struct ContiguousMemoryRange { uint8_t* begin; uint8_t* end; // STL style: one byte past the end of the buffer. inline bool is_valid() const { return begin != nullptr; } inline void reset() { begin = nullptr; } inline size_t size() const { return static_cast<size_t>(end - begin); } }; } // namespace protozero #endif // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
Mark ContiguousMemoryRange::size as const. am: f2c28cd765 am: 1b5ab79b0b
Mark ContiguousMemoryRange::size as const. am: f2c28cd765 am: 1b5ab79b0b Change-Id: I7516d6d8ab17209681d1925c9c2dacde0c2fcef1
C
apache-2.0
google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto
4a243af780afa91bc45377560b469a15613a5125
primitiv/c/cuda_device.h
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_
#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_
Fix calling conventions around CUDA.
Fix calling conventions around CUDA.
C
apache-2.0
odashi/primitiv,odashi/primitiv,odashi/primitiv
f7b356f345a1b91410181d228855552ec0431c76
Framework/MZFormSheetPresentationControllerFramework.h
Framework/MZFormSheetPresentationControllerFramework.h
// // MZFormSheetPresentationControllerFramework.h // MZFormSheetPresentationControllerFramework // #import <UIKit/UIKit.h> //! Project version number for MZFormSheetPresentation. FOUNDATION_EXPORT double MZFormSheetPresentationControllerVersionNumber; //! Project version string for MZFormSheetPresentation. FOUNDATION_EXPORT const unsigned char MZFormSheetPresentationControllerVersionString[]; // In this header, you should import all the public headers of // your framework using statements like // #import <MZFormSheetPresentationController/PublicHeader.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationController.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewController.h> #import <MZFormSheetPresentationController/MZTransition.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimatedTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationContentSizing.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerSegue.h>
// // MZFormSheetPresentationControllerFramework.h // MZFormSheetPresentationControllerFramework // #import <UIKit/UIKit.h> //! Project version number for MZFormSheetPresentation. FOUNDATION_EXPORT double MZFormSheetPresentationControllerVersionNumber; //! Project version string for MZFormSheetPresentation. FOUNDATION_EXPORT const unsigned char MZFormSheetPresentationControllerVersionString[]; // In this header, you should import all the public headers of // your framework using statements like // #import <MZFormSheetPresentationController/PublicHeader.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationController.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewController.h> #import <MZFormSheetPresentationController/MZTransition.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimatedTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationContentSizing.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerSegue.h> #import <MZFormSheetPresentationController/MZBlurEffectAdapter.h>
Add MZBlurEffectAdapter.h to umbrella header
Add MZBlurEffectAdapter.h to umbrella header
C
mit
m1entus/MZFormSheetPresentationController,m1entus/MZFormSheetPresentationController
0e1a86e027b7c58adc7fa9082093a2e42113c2f3
WordPressCom-Stats-iOS/StatsGroup.h
WordPressCom-Stats-iOS/StatsGroup.h
#import <Foundation/Foundation.h> @interface StatsGroup : NSObject @property (nonatomic, strong) NSArray *items; // StatsItem @property (nonatomic, assign) BOOL moreItemsExist; @property (nonatomic, copy) NSString *titlePrimary; @property (nonatomic, copy) NSString *titleSecondary; @property (nonatomic, strong) NSURL *iconUrl; @end
#import <Foundation/Foundation.h> @interface StatsGroup : NSObject @property (nonatomic, strong) NSArray *items; // StatsItem @property (nonatomic, copy) NSString *titlePrimary; @property (nonatomic, copy) NSString *titleSecondary; @property (nonatomic, strong) NSURL *iconUrl; @end
Revert "Added moreItems boolean to data model for a group"
Revert "Added moreItems boolean to data model for a group" This reverts commit ddbdfa290670584080d841244b53d6d3ede11de3.
C
mit
wordpress-mobile/WordPressCom-Stats-iOS,wordpress-mobile/WordPressCom-Stats-iOS
09e34b78eeb6237a87b8ae5fd1860e7a550dccbd
tests/configs/config-wrapper-malloc-0-null.h
tests/configs/config-wrapper-malloc-0-null.h
/* mbedtls_config.h wrapper that forces calloc(0) to return NULL. * Used for testing. */ /* * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * * 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 "mbedtls/mbedtls_config.h" #include <stdlib.h> static inline void *custom_calloc( size_t nmemb, size_t size ) { if( nmemb == 0 || size == 0 ) return( NULL ); return( calloc( nmemb, size ) ); } #define MBEDTLS_PLATFORM_MEMORY #define MBEDTLS_PLATFORM_STD_CALLOC custom_calloc
/* mbedtls_config.h wrapper that forces calloc(0) to return NULL. * Used for testing. */ /* * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * * 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 "mbedtls/mbedtls_config.h" #include <stdlib.h> #ifndef MBEDTLS_PLATFORM_STD_CALLOC static inline void *custom_calloc( size_t nmemb, size_t size ) { if( nmemb == 0 || size == 0 ) return( NULL ); return( calloc( nmemb, size ) ); } #define MBEDTLS_PLATFORM_MEMORY #define MBEDTLS_PLATFORM_STD_CALLOC custom_calloc #endif
Add header guard around malloc(0) returning NULL implementation
Add header guard around malloc(0) returning NULL implementation Make it safe to import the config multiple times without having multiple definition errors. (This prevents errors in the fuzzers in a later patch.) Signed-off-by: Daniel Axtens <[email protected]>
C
apache-2.0
Mbed-TLS/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls
a4e7d742d66ed4fa4f5d0af9c57a2e5c5026d976
content/public/browser/notification_observer.h
content/public/browser/notification_observer.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #pragma once #include "content/common/content_export.h" namespace content { class NotificationDetails; class NotificationSource; // This is the base class for notification observers. When a matching // notification is posted to the notification service, Observe is called. class CONTENT_EXPORT NotificationObserver { public: virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) = 0; protected: NotificationObserver() {} virtual ~NotificationObserver() {} }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #pragma once #include "content/common/content_export.h" namespace content { class NotificationDetails; class NotificationSource; // This is the base class for notification observers. When a matching // notification is posted to the notification service, Observe is called. class CONTENT_EXPORT NotificationObserver { public: virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) = 0; protected: virtual ~NotificationObserver() {} }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_
Remove unnecessary constructor from NotificationObserver.
content: Remove unnecessary constructor from NotificationObserver. BUG=98716 [email protected] Review URL: https://chromiumcodereview.appspot.com/10449076 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@139931 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,patrickm/chromium.src,mogoweb/chromium-crosswalk,dushu1203/chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,keishi/chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,dednal/chromium.src,patrickm/chromium.src,dednal/chromium.src,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,mogoweb/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,ltilve/chromium,ltilve/chromium,Just-D/chromium-1,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,keishi/chromium,zcbenz/cefode-chromium,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,dednal/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,markYoungH/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,keishi/chromium,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,ltilve/chromium,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,ltilve/chromium,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,littlstar/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,nacl-webkit/chrome_deps,ondra-novak/chromium.src,dednal/chromium.src,littlstar/chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,Jonekee/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,dushu1203/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,littlstar/chromium.src,Jonekee/chromium.src,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,keishi/chromium,bright-sparks/chromium-spacewalk,Just-D/chromium-1,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,M4sse/chromium.src,ltilve/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,dednal/chromium.src,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,patrickm/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,littlstar/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,keishi/chromium,ChromiumWebApps/chromium,hujiajie/pa-chromium,keishi/chromium,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,ondra-novak/chromium.src,Chilledheart/chromium,Just-D/chromium-1,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,anirudhSK/chromium,anirudhSK/chromium,patrickm/chromium.src,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,patrickm/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,zcbenz/cefode-chromium,keishi/chromium,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,jaruba/chromium.src,keishi/chromium,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,keishi/chromium,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,Just-D/chromium-1,zcbenz/cefode-chromium,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,hujiajie/pa-chromium,dednal/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,keishi/chromium,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,dushu1203/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish
6f5644a98919e0583f134876de768497a769f5fe
messagebox.c
messagebox.c
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nShowCmd) { LPWSTR *szArgList; int argCount; szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); if (szArgList == NULL) { fprintf(stderr, "Unable to parse the command line.\n"); return 255; } if (argCount < 3 || argCount > 4) { fprintf(stderr, "Batch MessageBox v" VERSION "\n"); fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]); fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n" URL "\nfor the possible values of \"type\". " "ERRORLEVEL is the return value or 255 on\nerror.\n"); return 255; } /* Ignore _wtoi errors. */ int type = _wtoi(szArgList[3]); int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type); LocalFree(szArgList); return button; }
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nCmdShow) { LPWSTR *szArgList; int argCount; szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); if (szArgList == NULL) { fprintf(stderr, "Unable to parse the command line.\n"); return 255; } if (argCount < 3 || argCount > 4) { fprintf(stderr, "Batch MessageBox v" VERSION "\n"); fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]); fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n" URL "\nfor the possible values of \"type\". " "ERRORLEVEL is the return value or 255 on\nerror.\n"); return 255; } /* Ignore _wtoi errors. */ int type = _wtoi(szArgList[3]); int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type); LocalFree(szArgList); return button; }
Rename WinMain argument nShowCmd "nCmdShow"
Rename WinMain argument nShowCmd "nCmdShow"
C
mit
dbohdan/messagebox,dbohdan/messagebox
54c1def2b9395c3f159df69d826832352168d837
src/hello.c
src/hello.c
/* * Challenger 1P Hello World Program for cc65. */ #include <conio.h> #define VIDEO_RAM_START ((char *) 0xd000) int main() { static const char hello_world[] = "Hello world!"; int scrpos; const char *cp; clrscr(); for (cp = hello_world, scrpos = 0x083; *cp; scrpos += 1, cp += 1) { *(VIDEO_RAM_START + scrpos) = *cp; } while (1) { char c = cgetc(); *(VIDEO_RAM_START + scrpos++) = c; } return 0; }
/* * Challenger 1P Hello World Program for cc65. */ #include <conio.h> #define VIDEO_RAM_START ((char *) 0xd000) int main() { static const char hello_world[] = "Hello world!\n"; const char *cp; unsigned int i; clrscr(); for (cp = hello_world; *cp; cp += 1) { cputc(*cp); } for (i = 0; i < 256; i += 1) { cputc((unsigned char ) i); } cputc(' '); cputc((char) wherex()); while (1) { char c = cgetc(); cputc(c); } return 0; }
Replace direct video memory access with cputc() for character output.
Replace direct video memory access with cputc() for character output.
C
mit
smuehlst/c1pctest,smuehlst/c1pctest
a24bd7176760b057b20560d3a55fcae61dc836fe
src/uri_judge/begginer/1160_population_increase.c
src/uri_judge/begginer/1160_population_increase.c
/** https://www.urionlinejudge.com.br/judge/en/problems/view/1160 TODO: Test this conjecture: Since f(x) is the number of inhabitants as a function of x years, such f is a function defined in natural numbers. Then f(x) = rx/100 + s, such that r and s are real (floating) constants, where r is the growing hate percentual (0<=r<=100) and s is the initial population in this experiment. TODO2 Test this conjecture: This loop can be turned into a recurrency relation (ie, a recursive function) TODO3 Test this conjecture: If TODO2 returns True, then this recurrency relation can be turned into a closed form (ie, a regular function). */ #include <stdio.h> int main(){ int testsQtt; int aPopulation, bPopulation; double aPercentualGrowing, bPercentualGrowing; scanf("%d", &testsQtt); char results[testsQtt]; int i, years; for (i = 0; i < testsQtt; i++){ scanf("%d %d %lf %lf", &aPopulation, &bPopulation, &aPercentualGrowing, &bPercentualGrowing); years = 0; while(aPopulation <= bPopulation){ years++; if (years > 100){ break; } aPopulation += (int) (aPopulation*aPercentualGrowing/100); bPopulation += (int) (bPopulation*bPercentualGrowing/100); } results[i] = years; } for (i = 0; i < testsQtt; i++){ if (results[i] > 100){ printf("Mais de 1 seculo.\n"); } else{ printf("%d anos.\n", results[i]); } } return 0; }
Add 1160 solution, but it can be improved!
Add 1160 solution, but it can be improved!
C
unknown
Mazuh/Algs,Mazuh/MISC-Algs,Mazuh/MISC-Algs,Mazuh/Algs,Mazuh/MISC-Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/MISC-Algs
ff54c764470857acc39c47da7c2adcecf09865f8
examples/complex_struct.c
examples/complex_struct.c
#include <stdio.h> typedef struct { int *x; int **y; } inner ; typedef struct { int *g; inner in[3]; } outer; int *ep; int main(int argc, char *argv[]) { outer o; int z = 5; int zzz; printf("%d\n" , z); ep = &z; o.in[2].x = ep; *o.in[2].x = 3; printf("%d\n" , z); inner i; i.x = &zzz; o.in[1] = i; int **ptr = &o.in[0].x; int *p = *ptr; /* outer oo[4]; */ /* oo[2].in[2].y = &ep; */ return 0; }
#include <stdio.h> typedef struct { int *x; int **y; } inner ; typedef struct { int *g; inner in[3]; } outer; int *ep; int main(int argc, char *argv[]) { outer o; int z = 5; int zzz; printf("%d\n" , z); ep = &z; o.in[2].x = ep; *(o.in[2].x) = 3; printf("%d\n" , z); inner i; i.x = &zzz; o.in[1] = i; int **ptr = &(o.in[0].x); int *p = *ptr; /* outer oo[4]; */ /* oo[2].in[2].y = &ep; */ return 0; }
Add parentheses to make example clearer.
Add parentheses to make example clearer.
C
mit
plast-lab/cclyzer,plast-lab/llvm-datalog
a8dcf158b8f6a62e65c8c5fc9b066be8c53260fb
Plugins/Displays/Bezel/GrowlBezelWindowView.h
Plugins/Displays/Bezel/GrowlBezelWindowView.h
// // GrowlBezelWindowView.h // Display Plugins // // Created by Jorge Salvador Caffarena on 09/09/04. // Copyright 2004 Jorge Salvador Caffarena. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GrowlNotificationView.h" @interface GrowlBezelWindowView : GrowlNotificationView { NSImage *icon; NSString *title; NSString *text; SEL action; id target; NSColor *textColor; NSColor *backgroundColor; NSLayoutManager *layoutManager; } - (void) setIcon:(NSImage *)icon; - (void) setTitle:(NSString *)title; - (void) setText:(NSString *)text; - (void) setPriority:(int)priority; - (float) descriptionHeight:(NSString *)text attributes:(NSDictionary *)attributes width:(float)width; - (id) target; - (void) setTarget:(id)object; - (SEL) action; - (void) setAction:(SEL)selector; @end
// // GrowlBezelWindowView.h // Display Plugins // // Created by Jorge Salvador Caffarena on 09/09/04. // Copyright 2004 Jorge Salvador Caffarena. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GrowlNotificationView.h" @interface GrowlBezelWindowView : GrowlNotificationView { NSImage *icon; NSString *title; NSString *text; NSColor *textColor; NSColor *backgroundColor; NSLayoutManager *layoutManager; } - (void) setIcon:(NSImage *)icon; - (void) setTitle:(NSString *)title; - (void) setText:(NSString *)text; - (void) setPriority:(int)priority; - (float) descriptionHeight:(NSString *)text attributes:(NSDictionary *)attributes width:(float)width; - (id) target; - (void) setTarget:(id)object; - (SEL) action; - (void) setAction:(SEL)selector; @end
Remove duplicate members so this compiles again
Remove duplicate members so this compiles again
C
bsd-3-clause
an0nym0u5/growl,Shalaco/shalzers-growl,SalrJupiter/growl,chashion/growl,an0nym0u5/growl,nagyistoce/growl,ylian/growl,ylian/growl,SalrJupiter/growl,chashion/growl,coltonfisher/coltonfisher-growl,ylian/growl,nochkin/growl,CarlosCD/growl,coltonfisher/coltonfisher-growl,timbck2/growl,nagyistoce/growl,nkhorman/archive-growl,tectronics/growl,timbck2/growl,nochkin/growl,morganestes/morganestes-growl,doshinirav/doshinirav-myversion,nkhorman/archive-growl,timbck2/growl,xhruso00/growl,nagyistoce/growl,chashion/growl,coltonfisher/coltonfisher-growl,morganestes/morganestes-growl,Shalaco/shalzers-growl,morganestes/morganestes-growl,doshinirav/doshinirav-myversion,nagyistoce/growl,timbck2/growl,ylian/growl,ylian/growl,CarlosCD/growl,Shalaco/shalzers-growl,SalrJupiter/growl,CarlosCD/growl,an0nym0u5/growl,SalrJupiter/growl,chashion/growl,nochkin/growl,nkhorman/archive-growl,nagyistoce/growl,Shalaco/shalzers-growl,xhruso00/growl,chashion/growl,nochkin/growl,morganestes/morganestes-growl,xhruso00/growl,tectronics/growl,nagyistoce/growl,an0nym0u5/growl,CarlosCD/growl,nochkin/growl,an0nym0u5/growl,xhruso00/growl,tectronics/growl,timbck2/growl,coltonfisher/coltonfisher-growl,doshinirav/doshinirav-myversion,SalrJupiter/growl,tectronics/growl,Shalaco/shalzers-growl,coltonfisher/coltonfisher-growl,nkhorman/archive-growl,nkhorman/archive-growl,coltonfisher/coltonfisher-growl,doshinirav/doshinirav-myversion,an0nym0u5/growl,nochkin/growl,Shalaco/shalzers-growl,morganestes/morganestes-growl,timbck2/growl,Shalaco/shalzers-growl,ylian/growl,doshinirav/doshinirav-myversion,SalrJupiter/growl,morganestes/morganestes-growl,Shalaco/shalzers-growl,tectronics/growl,CarlosCD/growl,Shalaco/shalzers-growl,doshinirav/doshinirav-myversion,doshinirav/doshinirav-myversion,Shalaco/shalzers-growl,Shalaco/shalzers-growl,xhruso00/growl,coltonfisher/coltonfisher-growl,xhruso00/growl,chashion/growl,nkhorman/archive-growl,CarlosCD/growl,CarlosCD/growl,tectronics/growl
c2c430877f6ccdcc12c6e832fffdbcfed799b087
LinkList_reverse_print.c
LinkList_reverse_print.c
#include <stdio.h> #include <stdlib.h> /* Linked List Implementation in C */ // This program aims at "Revering the Link List" typedef struct node{ int data; struct node *link; } node; node* head; //global variable void insert_append(int x){ node* temp; temp = (node*)malloc(sizeof(node)); temp->data = x; temp->link=NULL; if(head!=NULL){ node* temp_travel; temp_travel =head; while(temp_travel->link != NULL){ temp_travel = temp_travel->link; } temp_travel->link = temp; return; } head =temp; return; } void reverse(){ node* prev; prev = NULL; node* current; current=head; node* next; while(current!= NULL){ next=current->link; current->link = prev; prev = current; current=next; } head=prev; return; } void print(){ node* temp = head; printf("list is:"); while(temp!= NULL){ printf(" %d",temp->data); temp = temp->link; } printf("\n"); } int main(){ head = NULL; //empty list insert_append(1); //list is: 1 insert_append(2); //list is: 1 2 insert_append(3); //list is: 1 2 3 insert_append(4); //list is: 1 2 3 4 insert_append(5); //list is: 1 2 3 4 5 print(); reverse(); //list is : 5 4 3 2 1 print(); return 0; }
Add Link List Recusrive Print and reverse print
Add Link List Recusrive Print and reverse print
C
mit
anaghajoshi/C_DataStructures_Algorithms
4dd45b3e9e6c487950117c50336b6d59b9baeb46
libavfilter/allfilters.c
libavfilter/allfilters.c
/* * filter registration * copyright (c) 2008 Vitor Sessak * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avfilter.h" #define REGISTER_VF(X,x) { \ extern AVFilter avfilter_vf_##x ; \ if(ENABLE_VF_##X ) avfilter_register(&avfilter_vf_##x ); } #define REGISTER_VSRC(X,x) { \ extern AVFilter avfilter_vsrc_##x ; \ if(ENABLE_VSRC_##X ) avfilter_register(&avfilter_vsrc_##x ); } void avfilter_register_all(void) { static int initialized; if (initialized) return; initialized = 1; // REGISTER_VF(CROP,crop); }
Add last file of main filter framework
Add last file of main filter framework git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@12076 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
C
lgpl-2.1
prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg
d91dc98abb3ebda043eb97d554fe79e83320e9e2
libopenspotify/sp_user.c
libopenspotify/sp_user.c
#include <spotify/api.h> #include "debug.h" #include "sp_opaque.h" SP_LIBEXPORT(const char *) sp_user_canonical_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented"); return "not-yet-implemented"; } SP_LIBEXPORT(const char *) sp_user_display_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented"); return "not-yet-implemented"; } SP_LIBEXPORT(bool) sp_user_is_loaded(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented"); return 0; }
#include <spotify/api.h> #include "debug.h" #include "sp_opaque.h" SP_LIBEXPORT(const char *) sp_user_canonical_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented\n"); return "not-yet-implemented"; } SP_LIBEXPORT(const char *) sp_user_display_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented\n"); return "not-yet-implemented"; } SP_LIBEXPORT(bool) sp_user_is_loaded(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented\n"); return 0; }
Add missing newlines to DSFYDEBUG() calls
Add missing newlines to DSFYDEBUG() calls
C
bsd-2-clause
noahwilliamsson/openspotify,noahwilliamsson/openspotify
2ed55f8d7eef0709bf1c96356d98605dd28ce442
machine/include/config.h
machine/include/config.h
#ifndef KERN_CONFIG #define KERN_CONFIG #define NUM_STACK_PAGES 2 #define MAX_AMOUNT_OF_CONTEXTS 32 #define NUM_FDS 32 // The trampoline must be mapped at the same vaddr for both the kernel and // the userspace processes. The page is mapped to the last VPN slot available // Sv39 has 39bit adresses: 2^39 - PAGESIZE = 0x80'0000'0000 - 0x100 = 0x80'0000'0000 // It will be mapped twice in the kernel address space #define TRAMPOLINE_VADDR 0x7FFFFFFF00 // The top-most stack address for a user process. As the stack grows downwards, it's best to place it after the trap trampoline to prevent collisions. // As specified by the RISC-V ELF psABI (https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md), // we use a descending full stack, i.e. sp points to the last pushed element in the stack // Thus, USERSPACE_STACK_START shall be positioned one above the actual first stack slot. #define USERSPACE_STACK_START TRAMPOLINE_VADDR #endif
#ifndef KERN_CONFIG #define KERN_CONFIG #define NUM_STACK_PAGES 2 #define MAX_AMOUNT_OF_CONTEXTS 32 #define NUM_FDS 32 // The trampoline must be mapped at the same vaddr for both the kernel and // the userspace processes. The page is mapped to the last VPN slot available // Sv39 has 39bit adresses: 2^39 - PAGESIZE = 0x80'0000'0000 - 0x100 = 0x7F'FFFF'F000 // According to the Sv39 documentation, the vaddr "must have bits 63–39 all equal to bit 38, or else a page-fault // exception will occur", thus the actual vaddr is 0xFFFF'FFFF'FFFF'F000 // It will be mapped twice in the kernel address space #define TRAMPOLINE_VADDR 0xFFFFFFFFFFFFF000 // The top-most stack address for a user process. As the stack grows downwards, it's best to place it after the trap trampoline to prevent collisions. // As specified by the RISC-V ELF psABI (https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md), // we use a descending full stack, i.e. sp points to the last pushed element in the stack // Thus, USERSPACE_STACK_START shall be positioned one above the actual first stack slot. #define USERSPACE_STACK_START TRAMPOLINE_VADDR #endif
Fix trap trampoline virtual address
Fix trap trampoline virtual address [skip ci] We want to map the trap trampoline to the highest possible virtual address, i.e. the last PTE possible. However, Sv39 specifies that bits 39-63 must reflect bit 38's state lest the CPU raises a page fault.
C
bsd-2-clause
cksystemsteaching/selfie,ChristianMoesl/selfie,cksystemsteaching/selfie,ChristianMoesl/selfie,cksystemsteaching/selfie
97d015ba572002c65fab1d4d8256678a9ff7d841
elang/base/zone_vector.h
elang/base/zone_vector.h
// Copyright 2014 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_BASE_ZONE_VECTOR_H_ #define ELANG_BASE_ZONE_VECTOR_H_ #include <vector> #include "elang/base/zone.h" #include "elang/base/zone_allocator.h" namespace elang { ////////////////////////////////////////////////////////////////////// // // ZoneVector // A wrapper subclass for |std::vector|. // template <typename T> class ZoneVector : public std::vector<T, ZoneAllocator<T>> { public: explicit ZoneVector(Zone* zone) : std::vector<T, ZoneAllocator<T>>(ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, size_t size, value_type& val = value_type()) : std::vector<T, ZoneAllocator<T>>(size, val, ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, const std::vector<T>& other) : std::vector<T, ZoneAllocator<T>>(other.begin(), other.end(), ZoneAllocator<T>(zone)) {} }; } // namespace elang #endif // ELANG_BASE_ZONE_VECTOR_H_
// Copyright 2014 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_BASE_ZONE_VECTOR_H_ #define ELANG_BASE_ZONE_VECTOR_H_ #include <vector> #include "elang/base/zone.h" #include "elang/base/zone_allocator.h" namespace elang { ////////////////////////////////////////////////////////////////////// // // ZoneVector // A wrapper subclass for |std::vector|. // template <typename T> class ZoneVector : public std::vector<T, ZoneAllocator<T>> { public: explicit ZoneVector(Zone* zone) : std::vector<T, ZoneAllocator<T>>(ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, size_t size, const value_type& val = value_type()) : std::vector<T, ZoneAllocator<T>>(size, val, ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, const std::vector<T>& other) : std::vector<T, ZoneAllocator<T>>(other.begin(), other.end(), ZoneAllocator<T>(zone)) {} }; } // namespace elang #endif // ELANG_BASE_ZONE_VECTOR_H_
Make |ZoneVector| constructor to take const reference.
elang/base: Make |ZoneVector| constructor to take const reference.
C
apache-2.0
eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang
f4ef4ff9d744adcc8424e6993674b20000c750bf
src/clock_posix.c
src/clock_posix.c
#include <time.h> #include "clock.h" #include "clock_type.h" extern int clock_init(struct Clock **clockp, struct Allocator *allocator) { struct timespec res; if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) { /* unknown clock or insufficient resolution */ return -1; } return clock_init_base(clockp, allocator, 1, 1000); } extern uint64_t clock_ticks(struct Clock const *const clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); (void)clock; return ts.tv_sec * 1000000000LL + ts.tv_nsec; }
#include <time.h> #include "clock.h" #include "clock_type.h" extern int clock_init(struct SPDR_Clock **clockp, struct SPDR_Allocator *allocator) { struct timespec res; if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) { /* unknown clock or insufficient resolution */ return -1; } return clock_init_base(clockp, allocator, 1, 1000); } extern uint64_t clock_ticks(struct SPDR_Clock const *const clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); (void)clock; return ts.tv_sec * 1000000000LL + ts.tv_nsec; }
Fix compilation on posix platforms
Fix compilation on posix platforms
C
mit
uucidl/uu.spdr,uucidl/uu.spdr,uucidl/uu.spdr
5cd8261adec0f6b5de939ecf826ee8638a5a93e4
src/output.c
src/output.c
#include <format.h> #include <string.h> /* strlen */ #include <output.h> #include <unistd.h> /* write */ /* Initially we put data to stdout. */ int cur_out = 1; /* Put data to current output. */ void putd(const char *data, unsigned long len) { (void)write(cur_out,data,len); } void put(const char *data) { putd(data, strlen(data)); } void put_ch(char ch) { char buf[1]; buf[0] = ch; putd(buf,1); } void put_long(long x) { put(format_long(x)); } void put_ulong(unsigned long x) { put(format_ulong(x)); } void put_double(double x) { put(format_double(x)); } void nl(void) { putd("\n",1); } void set_output(int fd) { fsync(cur_out); cur_out = fd; } void put_to_error(void) { set_output(2); }
#include <format.h> #include <string.h> /* strlen */ #include <output.h> #include <unistd.h> /* write */ /* Initially we put data to stdout. */ int cur_out = 1; /* Put data to current output. */ void putd(const char *data, unsigned long len) { ssize_t n = write(cur_out,data,len); (void)n; } void put(const char *data) { putd(data, strlen(data)); } void put_ch(char ch) { char buf[1]; buf[0] = ch; putd(buf,1); } void put_long(long x) { put(format_long(x)); } void put_ulong(unsigned long x) { put(format_ulong(x)); } void put_double(double x) { put(format_double(x)); } void nl(void) { putd("\n",1); } void set_output(int fd) { fsync(cur_out); cur_out = fd; } void put_to_error(void) { set_output(2); }
Work around incompatibility of warn_unused_result on one machine.
Work around incompatibility of warn_unused_result on one machine. On one machine, the call to "write" in output.c gave this compiler error: ignoring return value of ‘write’, declared with attribute warn_unused_result To work around that, the code now grabs the return value and ignores it with (void).
C
mit
chkoreff/Fexl,chkoreff/Fexl
7a0ffdc64e8e522035a7bc74ee3cea0bfeb55cd1
eval/src/vespa/eval/eval/hamming_distance.h
eval/src/vespa/eval/eval/hamming_distance.h
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once namespace vespalib::eval { inline double hamming_distance(double a, double b) { uint8_t x = (uint8_t) a; uint8_t y = (uint8_t) b; return __builtin_popcount(x ^ y); } }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once namespace vespalib::eval { inline double hamming_distance(double a, double b) { uint8_t x = (uint8_t) (int8_t) a; uint8_t y = (uint8_t) (int8_t) b; return __builtin_popcount(x ^ y); } }
Convert from double to signed data type for reference hamming distance.
Convert from double to signed data type for reference hamming distance.
C
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
09a2b4f4234f66c2dc89c269743ba04bf78ae8ba
src/interfaces/odbc/md5.h
src/interfaces/odbc/md5.h
/* File: connection.h * * Description: See "md.h" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __MD5_H__ #define __MD5_H__ #include "psqlodbc.h" #include <stdlib.h> #include <string.h> #ifdef WIN32 #define MD5_ODBC #define FRONTEND #endif #define MD5_PASSWD_LEN 35 /* From c.h */ #ifndef __BEOS__ #ifndef __cplusplus #ifndef bool typedef char bool; #endif #ifndef true #define true ((bool) 1) #endif #ifndef false #define false ((bool) 0) #endif #endif /* not C++ */ #endif /* __BEOS__ */ /* Also defined in include/c.h */ #if SIZEOF_UINT8 == 0 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif /* SIZEOF_UINT8 == 0 */ extern bool md5_hash(const void *buff, size_t len, char *hexsum); extern bool EncryptMD5(const char *passwd, const char *salt, size_t salt_len, char *buf); #endif
/* File: md5.h * * Description: See "md5.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __MD5_H__ #define __MD5_H__ #include "psqlodbc.h" #include <stdlib.h> #include <string.h> #ifdef WIN32 #define MD5_ODBC #define FRONTEND #endif #define MD5_PASSWD_LEN 35 /* From c.h */ #ifndef __BEOS__ #ifndef __cplusplus #ifndef bool typedef char bool; #endif #ifndef true #define true ((bool) 1) #endif #ifndef false #define false ((bool) 0) #endif #endif /* not C++ */ #endif /* __BEOS__ */ /* Also defined in include/c.h */ #if SIZEOF_UINT8 == 0 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif /* SIZEOF_UINT8 == 0 */ extern bool md5_hash(const void *buff, size_t len, char *hexsum); extern bool EncryptMD5(const char *passwd, const char *salt, size_t salt_len, char *buf); #endif
Fix comment at top of file to match file name.
Fix comment at top of file to match file name.
C
apache-2.0
Quikling/gpdb,ashwinstar/gpdb,Quikling/gpdb,Chibin/gpdb,tangp3/gpdb,chrishajas/gpdb,yuanzhao/gpdb,zaksoup/gpdb,zaksoup/gpdb,lpetrov-pivotal/gpdb,xinzweb/gpdb,rvs/gpdb,foyzur/gpdb,foyzur/gpdb,rvs/gpdb,yuanzhao/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,lintzc/gpdb,xinzweb/gpdb,lintzc/gpdb,rubikloud/gpdb,zeroae/postgres-xl,janebeckman/gpdb,zeroae/postgres-xl,foyzur/gpdb,lintzc/gpdb,xuegang/gpdb,ahachete/gpdb,yazun/postgres-xl,techdragon/Postgres-XL,Postgres-XL/Postgres-XL,randomtask1155/gpdb,50wu/gpdb,atris/gpdb,kaknikhil/gpdb,postmind-net/postgres-xl,Quikling/gpdb,kaknikhil/gpdb,royc1/gpdb,zaksoup/gpdb,chrishajas/gpdb,lpetrov-pivotal/gpdb,kmjungersen/PostgresXL,Quikling/gpdb,lisakowen/gpdb,randomtask1155/gpdb,rubikloud/gpdb,Chibin/gpdb,zeroae/postgres-xl,yazun/postgres-xl,yuanzhao/gpdb,0x0FFF/gpdb,0x0FFF/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,randomtask1155/gpdb,lintzc/gpdb,kaknikhil/gpdb,adam8157/gpdb,kmjungersen/PostgresXL,yazun/postgres-xl,cjcjameson/gpdb,tangp3/gpdb,Quikling/gpdb,janebeckman/gpdb,50wu/gpdb,chrishajas/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,Quikling/gpdb,ovr/postgres-xl,CraigHarris/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,Quikling/gpdb,lpetrov-pivotal/gpdb,rvs/gpdb,rubikloud/gpdb,xuegang/gpdb,jmcatamney/gpdb,atris/gpdb,CraigHarris/gpdb,snaga/postgres-xl,jmcatamney/gpdb,royc1/gpdb,rvs/gpdb,jmcatamney/gpdb,lisakowen/gpdb,cjcjameson/gpdb,oberstet/postgres-xl,yuanzhao/gpdb,edespino/gpdb,edespino/gpdb,xuegang/gpdb,rvs/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,greenplum-db/gpdb,ahachete/gpdb,janebeckman/gpdb,jmcatamney/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,Chibin/gpdb,kaknikhil/gpdb,ovr/postgres-xl,adam8157/gpdb,randomtask1155/gpdb,chrishajas/gpdb,atris/gpdb,zaksoup/gpdb,kaknikhil/gpdb,Postgres-XL/Postgres-XL,ashwinstar/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,greenplum-db/gpdb,foyzur/gpdb,Chibin/gpdb,snaga/postgres-xl,xuegang/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,edespino/gpdb,tangp3/gpdb,pavanvd/postgres-xl,Quikling/gpdb,ahachete/gpdb,atris/gpdb,chrishajas/gpdb,tpostgres-projects/tPostgres,postmind-net/postgres-xl,yuanzhao/gpdb,adam8157/gpdb,royc1/gpdb,yazun/postgres-xl,janebeckman/gpdb,ashwinstar/gpdb,atris/gpdb,rvs/gpdb,xuegang/gpdb,janebeckman/gpdb,zaksoup/gpdb,ahachete/gpdb,foyzur/gpdb,xinzweb/gpdb,greenplum-db/gpdb,royc1/gpdb,yazun/postgres-xl,0x0FFF/gpdb,Chibin/gpdb,tangp3/gpdb,zaksoup/gpdb,tpostgres-projects/tPostgres,ahachete/gpdb,royc1/gpdb,lisakowen/gpdb,0x0FFF/gpdb,ahachete/gpdb,0x0FFF/gpdb,atris/gpdb,rubikloud/gpdb,rvs/gpdb,lisakowen/gpdb,jmcatamney/gpdb,techdragon/Postgres-XL,arcivanov/postgres-xl,arcivanov/postgres-xl,kmjungersen/PostgresXL,lpetrov-pivotal/gpdb,kaknikhil/gpdb,kmjungersen/PostgresXL,lisakowen/gpdb,lintzc/gpdb,ovr/postgres-xl,kaknikhil/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,edespino/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,xinzweb/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,greenplum-db/gpdb,techdragon/Postgres-XL,xuegang/gpdb,snaga/postgres-xl,xinzweb/gpdb,arcivanov/postgres-xl,ovr/postgres-xl,xinzweb/gpdb,snaga/postgres-xl,rvs/gpdb,janebeckman/gpdb,adam8157/gpdb,pavanvd/postgres-xl,adam8157/gpdb,xuegang/gpdb,ashwinstar/gpdb,postmind-net/postgres-xl,edespino/gpdb,50wu/gpdb,royc1/gpdb,Postgres-XL/Postgres-XL,xuegang/gpdb,randomtask1155/gpdb,50wu/gpdb,tangp3/gpdb,50wu/gpdb,greenplum-db/gpdb,Quikling/gpdb,ovr/postgres-xl,cjcjameson/gpdb,pavanvd/postgres-xl,Quikling/gpdb,Chibin/gpdb,postmind-net/postgres-xl,Chibin/gpdb,zeroae/postgres-xl,zaksoup/gpdb,rubikloud/gpdb,janebeckman/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,royc1/gpdb,adam8157/gpdb,xinzweb/gpdb,randomtask1155/gpdb,chrishajas/gpdb,jmcatamney/gpdb,50wu/gpdb,janebeckman/gpdb,50wu/gpdb,Chibin/gpdb,edespino/gpdb,tangp3/gpdb,xuegang/gpdb,snaga/postgres-xl,greenplum-db/gpdb,rubikloud/gpdb,zeroae/postgres-xl,zaksoup/gpdb,cjcjameson/gpdb,janebeckman/gpdb,greenplum-db/gpdb,chrishajas/gpdb,yuanzhao/gpdb,rubikloud/gpdb,Chibin/gpdb,oberstet/postgres-xl,lintzc/gpdb,ashwinstar/gpdb,randomtask1155/gpdb,CraigHarris/gpdb,kmjungersen/PostgresXL,foyzur/gpdb,adam8157/gpdb,techdragon/Postgres-XL,lpetrov-pivotal/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,edespino/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,janebeckman/gpdb,ahachete/gpdb,oberstet/postgres-xl,50wu/gpdb,foyzur/gpdb,arcivanov/postgres-xl,CraigHarris/gpdb,adam8157/gpdb,lintzc/gpdb,tangp3/gpdb,Chibin/gpdb,pavanvd/postgres-xl,randomtask1155/gpdb,chrishajas/gpdb,royc1/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,rvs/gpdb,cjcjameson/gpdb,postmind-net/postgres-xl,rvs/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,pavanvd/postgres-xl,lintzc/gpdb,lisakowen/gpdb,rubikloud/gpdb,oberstet/postgres-xl,tangp3/gpdb,ahachete/gpdb,edespino/gpdb,CraigHarris/gpdb,foyzur/gpdb,lisakowen/gpdb,tpostgres-projects/tPostgres,atris/gpdb,arcivanov/postgres-xl
8573926253391f103e73c7b4ec77a6e61b662186
src/utils.h
src/utils.h
#pragma once #include <memory> #include <cstdio> // fopen, fclose #include <openssl/evp.h> #include <openssl/ec.h> namespace JWTXX { namespace Utils { struct FileCloser { void operator()(FILE* fp) { fclose(fp); } }; typedef std::unique_ptr<FILE, FileCloser> FilePtr; struct EVPKeyDeleter { void operator()(EVP_PKEY* key) { EVP_PKEY_free(key); } }; typedef std::unique_ptr<EVP_PKEY, EVPKeyDeleter> EVPKeyPtr; struct EVPMDCTXDeleter { void operator()(EVP_MD_CTX* ctx) { EVP_MD_CTX_destroy(ctx); } }; typedef std::unique_ptr<EVP_MD_CTX, EVPMDCTXDeleter> EVPMDCTXPtr; EVPKeyPtr readPEMPrivateKey(const std::string& fileName); EVPKeyPtr readPEMPublicKey(const std::string& fileName); std::string OPENSSLError(); } }
#pragma once #include <memory> #include <cstdio> // fopen, fclose #include <openssl/evp.h> #include <openssl/ec.h> namespace JWTXX { namespace Utils { struct EVPKeyDeleter { void operator()(EVP_PKEY* key) { EVP_PKEY_free(key); } }; typedef std::unique_ptr<EVP_PKEY, EVPKeyDeleter> EVPKeyPtr; struct EVPMDCTXDeleter { void operator()(EVP_MD_CTX* ctx) { EVP_MD_CTX_destroy(ctx); } }; typedef std::unique_ptr<EVP_MD_CTX, EVPMDCTXDeleter> EVPMDCTXPtr; EVPKeyPtr readPEMPrivateKey(const std::string& fileName); EVPKeyPtr readPEMPublicKey(const std::string& fileName); std::string OPENSSLError(); } }
Move file closer out from public.
Move file closer out from public.
C
mit
madf/jwtxx,madf/jwtxx,RealImage/jwtxx,RealImage/jwtxx
56f322d7e40c891d396ede91242b0c4a05b7e383
bst.c
bst.c
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; };
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; }
Add BST Create function implementation
Add BST Create function implementation
C
mit
MaxLikelihood/CADT
68bf16f8d1e7c8dff8732f8aae4b4b418054216f
test/Driver/darwin-asan-nofortify.c
test/Driver/darwin-asan-nofortify.c
// Make sure AddressSanitizer disables _FORTIFY_SOURCE on Darwin. // REQUIRES: system-darwin // RUN: %clang -faddress-sanitizer %s -E -dM -o - | FileCheck %s // CHECK: #define _FORTIFY_SOURCE 0
// Make sure AddressSanitizer disables _FORTIFY_SOURCE on Darwin. // RUN: %clang -faddress-sanitizer %s -E -dM -target x86_64-darwin - | FileCheck %s // CHECK: #define _FORTIFY_SOURCE 0
Use an explicit target to test that source fortification is off when building for Darwin with -faddress-sanitizer.
Use an explicit target to test that source fortification is off when building for Darwin with -faddress-sanitizer. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@164485 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
67e210737f3c084e3957bfd6bb1a3821180425c1
SymbolicMathFunctions.h
SymbolicMathFunctions.h
#ifndef SYMBOLICMATHNODE_H #define SYMBOLICMATHNODE_H #include <vector> #include "SymbolicMathNode.h" namespace SymbolicMath { // clang-format off Node abs(Node a) { return Node(UnaryFunctionType::ABS, a); } Node acos(Node a) { return Node(UnaryFunctionType::ACOS, a); } Node acosh(Node a) { return Node(UnaryFunctionType::ACOSH, a); } Node asin(Node a) { return Node(UnaryFunctionType::ASIN, a); } Node asinh(Node a) { return Node(UnaryFunctionType::ASINH, a); } Node atan(Node a) { return Node(UnaryFunctionType::ATAN, a); } Node atanh(Node a) { return Node(UnaryFunctionType::ATANH, a); } Node ceil(Node a) { return Node(UnaryFunctionType::CEIL, a); } Node cos(Node a) { return Node(UnaryFunctionType::COS, a); } Node cosh(Node a) { return Node(UnaryFunctionType::COSH, a); } Node cot(Node a) { return Node(UnaryFunctionType::COT, a); } Node csc(Node a) { return Node(UnaryFunctionType::CSC, a); } Node erf(Node a) { return Node(UnaryFunctionType::ERF, a); } Node exp(Node a) { return Node(UnaryFunctionType::EXP, a); } Node exp2(Node a) { return Node(UnaryFunctionType::EXP2, a); } Node floor(Node a) { return Node(UnaryFunctionType::FLOOR, a); } Node log(Node a) { return Node(UnaryFunctionType::LOG, a); } Node log2(Node a) { return Node(UnaryFunctionType::LOG2, a); } Node sec(Node a) { return Node(UnaryFunctionType::SEC, a); } Node sin(Node a) { return Node(UnaryFunctionType::SIN, a); } Node sinh(Node a) { return Node(UnaryFunctionType::SINH, a); } Node tan(Node a) { return Node(UnaryFunctionType::TAN, a); } Node tanh(Node a) { return Node(UnaryFunctionType::TANH, a); } // clang-format on // clang-format off Node atan2(Node a, Node b) { return Node(BinaryFunctionType::ATAN2, a, b); } Node max(Node a, Node b) { return Node(BinaryFunctionType::MAX, a, b); } Node min(Node a, Node b) { return Node(BinaryFunctionType::MIN, a, b); } Node plog(Node a, Node b) { return Node(BinaryFunctionType::PLOG, a, b); } Node pow(Node a, Node b) { return Node(BinaryFunctionType::POW, a, b); } // clang-format on Node conditional(Node a, Node b, Node c) { return Node(ConditionalType::IF, a, b, c); } // end namespace SymbolicMath }
Add functions to build SM trees
Add functions to build SM trees
C
lgpl-2.1
dschwen/mathparse,dschwen/mathparse
76879c5d5204ad38a36e183d8a03e20d9dc0ae56
src/search/util/timeout.h
src/search/util/timeout.h
/* -*- mode:linux -*- */ /** * \file timeout.h * * * * \author Ethan Burns * \date 2008-12-16 */ #define _POSIX_C_SOURCE 200112L void timeout(unsigned int sec);
/* -*- mode:linux -*- */ /** * \file timeout.h * * * * \author Ethan Burns * \date 2008-12-16 */ void timeout(unsigned int sec);
Remove the _POSIX_C_SOURCE def that the sparc doesn't like
Remove the _POSIX_C_SOURCE def that the sparc doesn't like
C
mit
eaburns/pbnf,eaburns/pbnf,eaburns/pbnf,eaburns/pbnf
43afb1bad3a927217f002bb9c3181a59e38839a7
daemon/mcbp_validators.h
daemon/mcbp_validators.h
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2015 Couchbase, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * memcached binary protocol packet validators */ #pragma once #include <memcached/protocol_binary.h> #ifdef __cplusplus extern "C" { #endif typedef protocol_binary_response_status (*mcbp_package_validate)(void *packet); /** * Get the memcached binary protocol validators * * @return the array of 0x100 entries for the package * validators */ mcbp_package_validate *get_mcbp_validators(void); #ifdef __cplusplus } #endif
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2015 Couchbase, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * memcached binary protocol packet validators */ #pragma once #include <memcached/protocol_binary.h> typedef protocol_binary_response_status (*mcbp_package_validate)(void *packet); /** * Get the memcached binary protocol validators * * @return the array of 0x100 entries for the package * validators */ mcbp_package_validate *get_mcbp_validators(void);
Drop C linkage for message validators
Drop C linkage for message validators Change-Id: I5a95a6ddd361ee2009ea399479a7df51733af709 Reviewed-on: http://review.couchbase.org/54979 Tested-by: buildbot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
C
bsd-3-clause
daverigby/kv_engine,owendCB/memcached,owendCB/memcached,daverigby/kv_engine,daverigby/kv_engine,daverigby/memcached,couchbase/memcached,owendCB/memcached,owendCB/memcached,couchbase/memcached,daverigby/memcached,daverigby/memcached,couchbase/memcached,daverigby/memcached,daverigby/kv_engine,couchbase/memcached
920a78097ae079fc6a77fb808c989078134479d7
DeepLinkKit/Categories/NSObject+DPLJSONObject.h
DeepLinkKit/Categories/NSObject+DPLJSONObject.h
@import Foundation; @interface NSObject (DPLJSONObject) /** Returns a JSON compatible version of the receiver. @discussion - NSDictionary and NSArray will call `DPLJSONObject' on all of their items. - Objects in an NSDictionary not keyed by an NSString will be removed. - NSNumbers that are NaN or Inf will be represented by a string. - NSDate objects will be represented as `timeIntervalSinceReferenceDate'. - JSON incompatible objects will return their description. - All NSNulls will be removed because who wants an NSNull. @see NSJSONSerialization */ - (id)DPL_JSONObject; @end
@import Foundation; @interface NSObject (DPLJSONObject) /** Returns a JSON compatible version of the receiver. @discussion - NSDictionary and NSArray will call `DPLJSONObject' on all of their items. - Objects in an NSDictionary not keyed by an NSString will be removed. - NSNumbers that are NaN or Inf will be represented by a string. - NSDate objects will be represented as `timeIntervalSinceReferenceDate'. - JSON incompatible objects will return their description. - All NSNulls will be removed because who wants an NSNull. @see NSJSONSerialization */ - (id)DPL_JSONObject; @end
Fix warning 'Empty paragraph passed to '@discussion' command'
Fix warning 'Empty paragraph passed to '@discussion' command'
C
mit
button/DeepLinkKit,button/DeepLinkKit,button/DeepLinkKit,button/DeepLinkKit
436ff08a08318e1f6cb9ce5e1b8517b6ea00c0c0
tmcd/decls.h
tmcd/decls.h
/* * EMULAB-COPYRIGHT * Copyright (c) 2000-2003 University of Utah and the Flux Group. * All rights reserved. */ #define TBSERVER_PORT 7777 #define TBSERVER_PORT2 14447 #define MYBUFSIZE 2048 #define BOSSNODE_FILENAME "bossnode" /* * As the tmcd changes, incompatable changes with older version of * the software cause problems. Starting with version 3, the client * will tell tmcd what version they are. If no version is included, * assume its DEFAULT_VERSION. * * Be sure to update the versions as the TMCD changes. Both the * tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to * install new versions of each binary when the current version * changes. libsetup.pm module also encodes a current version, so be * sure to change it there too! * * Note, this is assumed to be an integer. No need for 3.23.479 ... * NB: See ron/libsetup.pm. That is version 4! I'll merge that in. */ #define DEFAULT_VERSION 2 #define CURRENT_VERSION 8
/* * EMULAB-COPYRIGHT * Copyright (c) 2000-2003 University of Utah and the Flux Group. * All rights reserved. */ #define TBSERVER_PORT 7777 #define TBSERVER_PORT2 14447 #define MYBUFSIZE 2048 #define BOSSNODE_FILENAME "bossnode" /* * As the tmcd changes, incompatable changes with older version of * the software cause problems. Starting with version 3, the client * will tell tmcd what version they are. If no version is included, * assume its DEFAULT_VERSION. * * Be sure to update the versions as the TMCD changes. Both the * tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to * install new versions of each binary when the current version * changes. libsetup.pm module also encodes a current version, so be * sure to change it there too! * * Note, this is assumed to be an integer. No need for 3.23.479 ... * NB: See ron/libsetup.pm. That is version 4! I'll merge that in. */ #define DEFAULT_VERSION 2 #define CURRENT_VERSION 9
Update to version 9 to match libsetup/tmcd.
Update to version 9 to match libsetup/tmcd.
C
agpl-3.0
nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome
08a9882cc8cbec97947215a7cdb1f60effe82b15
server/gwkv_ht_wrapper.h
server/gwkv_ht_wrapper.h
#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
#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
Change server set/get function names
Change server set/get function names
C
mit
gwAdvNet2015/gw-kv-store
e54d4a7ec72354285ba4b8202a45693b83b75835
common.h
common.h
#ifndef _COMMON_H #define _COMMON_H #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #ifdef _LINUX #include <bsd/string.h> #endif #include <libxml/parser.h> #include <libxml/tree.h> #include <libxml/xmlsave.h> #include <libxml/encoding.h> #include <libxml/xmlstring.h> #include <openssl/bio.h> #include <openssl/evp.h> #ifndef _READLINE #include <histedit.h> #else #include <readline/readline.h> #include <readline/history.h> #endif #define USAGE "[-k database file] [-p password file] [-m cipher mode] [-b] [-v] [-h] [-d]" #define VERSION "kc 2.1" #ifndef _READLINE const char *el_prompt_null(void); #endif const char *prompt_str(void); int malloc_check(void *); char *get_random_str(size_t, char); void version(void); void quit(int); char debug; #endif
#ifndef _COMMON_H #define _COMMON_H #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #ifdef _LINUX #include <bsd/string.h> #endif #include <libxml/parser.h> #include <libxml/tree.h> #include <libxml/xmlsave.h> #include <libxml/encoding.h> #include <libxml/xmlstring.h> #include <openssl/bio.h> #include <openssl/evp.h> #ifndef _READLINE #include <histedit.h> #else #include <readline/readline.h> #include <readline/history.h> #endif #define USAGE "[-k database file] [-p password file] [-m cipher mode] [-b] [-v] [-h] [-d]" #define VERSION "kc 2.1.1" #ifndef _READLINE const char *el_prompt_null(void); #endif const char *prompt_str(void); int malloc_check(void *); char *get_random_str(size_t, char); void version(void); void quit(int); char debug; #endif
Tag 2.1.1 because of the segfault fix.
Tag 2.1.1 because of the segfault fix.
C
bsd-2-clause
levaidaniel/kc,levaidaniel/kc,levaidaniel/kc
2fcac93f99c329fb1d9e7ccf1644db865bada106
gen_message_hashes/hash_func.h
gen_message_hashes/hash_func.h
static inline unsigned int hash_func_string(const char* key) { unsigned int hash = 0; int c; while ((c = *key++) != 0) hash = c + (hash << 6) + (hash << 16) - hash; return hash; }
Add file that holds the string hash function.
Add file that holds the string hash function.
C
mit
gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,mloy/cjet
1d80b38e935401e40bdca2f3faaec4aeba77a716
src/random.h
src/random.h
/** * @file random.h * @ingroup CppAlgorithms * @brief Random utility functions. * * Copyright (c) 2013 Sebastien Rombauts ([email protected]) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) */ /** * @brief Random utility functions. */ class Random { public: /** * @brief Generate a printable alphanumeric character. */ static char GenChar(); /** * @brief Generate a printable alphanumeric string. */ static void GenString(char* str, size_t len); };
/** * @file random.h * @ingroup CppAlgorithms * @brief Random utility functions. * * Copyright (c) 2013 Sebastien Rombauts ([email protected]) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) */ #include <cstddef> // size_t /** * @brief Random utility functions. */ class Random { public: /** * @brief Generate a printable alphanumeric character. */ static char GenChar(); /** * @brief Generate a printable alphanumeric string. */ static void GenString(char* str, size_t len); };
Fix Travis build (missing include for size_t)
Fix Travis build (missing include for size_t)
C
mit
SRombauts/cpp-algorithms,SRombauts/cpp-algorithms
fe18c5e9ff7070f2eefb3d5e922523143929f616
tests/regression/36-octapron/70-signed-overflows.c
tests/regression/36-octapron/70-signed-overflows.c
// SKIP PARAM: --sets ana.activated[+] octApron --sets sem.int.signed_overflow assume_none --disable ana.int.interval // copied from signed-overflows/intervals for octApron int main(void) { int x = 0; while(x != 42) { x++; assert(x >= 1); } }
Add octApron test on signed overflows
Add octApron test on signed overflows
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
b1321ce850ae77ea8d4a3fc0958ec58b404ec10d
chapter3/GameObject.h
chapter3/GameObject.h
#ifndef __GAME_OBJECT_H__ #define __GAME_OBJECT_H__ #include<iostream> #include<SDL2/SDL.h> class GameObject { public: void load(int pX, int pY, int pWidth, int pHeight, std::string pTextureId); void draw(SDL_Renderer *renderer); void update(); void clean() { std::cout << "clean game object"; } protected: std::string textureId; int currentFrame; int currentRow; int x; int y; int width; int height; }; #endif
#ifndef __GAME_OBJECT_H__ #define __GAME_OBJECT_H__ #include<iostream> #include<SDL2/SDL.h> class GameObject { public: virtual void load(int pX, int pY, int pWidth, int pHeight, std::string pTextureId); virtual void draw(SDL_Renderer *renderer); virtual void update(); virtual void clean() {}; protected: std::string textureId; int currentFrame; int currentRow; int x; int y; int width; int height; }; #endif
Include virtual in all methods.
Include virtual in all methods.
C
bsd-2-clause
caiotava/SDLBook
b01a4463c1dbd4854f9fba47af8fa30394640375
TokenArray.h
TokenArray.h
#ifndef _EXCELFORMUAL_TOKEN_ARRAY_H__ #define _EXCELFORMUAL_TOKEN_ARRAY_H__ #include <vector> using std::vector; namespace ExcelFormula{ class Token; class TokenArray{ public: TokenArray(); void toVector(vector<Token*>&); void fromVector(vector<Token*>&); size_t size() {return m_tokens.size();} bool isBOF() {return (m_index <= 0)?true:false;} bool isEOF() {return (m_index >= m_tokens.size())?true:false;} Token* getCurrent(); Token* getNext(); Token* getPrevious(); Token* add(Token*); bool moveNext(); void reset(){m_index = 0;} void releaseAll(); private: size_t m_index; vector<Token*> m_tokens; }; } #endif
#ifndef _EXCELFORMUAL_TOKEN_ARRAY_H__ #define _EXCELFORMUAL_TOKEN_ARRAY_H__ #include <vector> #include <cstddef> using std::vector; namespace ExcelFormula{ class Token; class TokenArray{ public: TokenArray(); void toVector(vector<Token*>&); void fromVector(vector<Token*>&); size_t size() {return m_tokens.size();} bool isBOF() {return (m_index <= 0)?true:false;} bool isEOF() {return (m_index >= m_tokens.size())?true:false;} Token* getCurrent(); Token* getNext(); Token* getPrevious(); Token* add(Token*); bool moveNext(); void reset(){m_index = 0;} void releaseAll(); private: size_t m_index; vector<Token*> m_tokens; }; } #endif
Add missing include for size_t
Add missing include for size_t Fixes compile error: [...] g++ -c -g TokenArray.cpp In file included from TokenArray.cpp:1:0: TokenArray.h:20:4: error: ‘size_t’ does not name a type size_t size() {return m_tokens.size();} ^ TokenArray.h:41:4: error: ‘size_t’ does not name a type size_t m_index; ^
C
mit
lishen2/Excel_formula_parser_cpp
a60af963642a31734c0a628fa79090fa5b7c58b2
include/libport/unistd.h
include/libport/unistd.h
#ifndef LIBPORT_UNISTD_H # define LIBPORT_UNISTD_H # include <libport/detect-win32.h> # include <libport/windows.hh> // Get sleep wrapper # include <libport/config.h> // This is traditional Unix file. # ifdef LIBPORT_HAVE_UNISTD_H # include <unistd.h> # endif // OSX does not have O_LARGEFILE. No information was found whether // some equivalent flag is needed or not. Other projects simply do as // follows. # ifndef O_LARGEFILE # define O_LARGEFILE 0 # endif // This seems to be its WIN32 equivalent. // http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmgch09_topic7. # if defined WIN32 || defined LIBPORT_WIN32 # include <io.h> # endif # ifdef WIN32 # include <direct.h> extern "C" { int chdir (const char* path) { return _chdir(path); } } # endif # if !defined LIBPORT_HAVE_GETCWD # if defined LIBPORT_HAVE__GETCWD # define getcwd _getcwd # elif defined LIBPORT_URBI_ENV_AIBO // Will be defined in libport/unistd.cc. # else # error I need either getcwd() or _getcwd() # endif # endif #endif // !LIBPORT_UNISTD_H
#ifndef LIBPORT_UNISTD_H # define LIBPORT_UNISTD_H # include <libport/detect-win32.h> # include <libport/windows.hh> // Get sleep wrapper # include <libport/config.h> // This is traditional Unix file. # ifdef LIBPORT_HAVE_UNISTD_H # include <unistd.h> # endif // OSX does not have O_LARGEFILE. No information was found whether // some equivalent flag is needed or not. Other projects simply do as // follows. # ifndef O_LARGEFILE # define O_LARGEFILE 0 # endif // This seems to be its WIN32 equivalent. // http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmgch09_topic7. # if defined WIN32 || defined LIBPORT_WIN32 # include <io.h> # endif # ifdef WIN32 # include <direct.h> # define chdir _chdir # endif # if !defined LIBPORT_HAVE_GETCWD # if defined LIBPORT_HAVE__GETCWD # define getcwd _getcwd # elif defined LIBPORT_URBI_ENV_AIBO // Will be defined in libport/unistd.cc. # else # error I need either getcwd() or _getcwd() # endif # endif #endif // !LIBPORT_UNISTD_H
Define chdir as a macro.
Define chdir as a macro. The previous definition was uselessly complicated, and lacked the proper API declaration. * include/libport/unistd.h (chdir): Define as "_chdir".
C
bsd-3-clause
aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport
5c43c3ef287b4aebdddbbf66a6afcdd4d2c47124
TeamSnapSDK/SDK/CollectionJSON/TSDKCollectionJSON.h
TeamSnapSDK/SDK/CollectionJSON/TSDKCollectionJSON.h
// // TSDKCollectionJSON.h // TeamSnapSDK // // Created by Jason Rahaim on 1/10/14. // Copyright (c) 2014 TeamSnap. All rights reserved. // #import <Foundation/Foundation.h> @interface TSDKCollectionJSON : NSObject <NSCoding, NSCopying> @property (nonatomic, strong) NSURL *_Nullable href; @property (nonatomic, strong) NSString *_Nullable version; @property (nonatomic, strong) NSString *_Nullable type; @property (nonatomic, strong) NSString *_Nullable rel; @property (nonatomic, strong) NSString *_Nullable errorTitle; @property (nonatomic, strong) NSString *_Nullable errorMessage; @property (nonatomic, assign) NSInteger errorCode; @property (nonatomic, strong) NSMutableDictionary *_Nullable links; @property (nonatomic, strong) NSMutableDictionary *_Nullable data; @property (nonatomic, strong) NSMutableDictionary *_Nullable commands; @property (nonatomic, strong) NSMutableDictionary *_Nullable queries; @property (nonatomic, strong) id _Nullable collection; +(NSDictionary *_Nullable)dictionaryToCollectionJSON:(NSDictionary *_Nonnull)dictionary; - (instancetype _Nullable)initWithCoder:(NSCoder *_Nonnull)aDecoder; - (instancetype _Nullable)initWithJSON:(NSDictionary *_Nonnull)JSON; + (instancetype _Nullable)collectionJSONForEncodedData:(NSData *_Nonnull)objectData; - (NSString *_Nullable)getObjectiveCHeaderSkeleton; - (NSData *_Nonnull)dataEncodedForSave; @end
// // TSDKCollectionJSON.h // TeamSnapSDK // // Created by Jason Rahaim on 1/10/14. // Copyright (c) 2014 TeamSnap. All rights reserved. // #import <Foundation/Foundation.h> @interface TSDKCollectionJSON : NSObject <NSCoding, NSCopying> @property (nonatomic, strong) NSURL *_Nullable href; @property (nonatomic, strong) NSString *_Nullable version; @property (nonatomic, strong) NSString *_Nullable type; @property (nonatomic, strong) NSString *_Nullable rel; @property (nonatomic, strong) NSString *_Nullable errorTitle; @property (nonatomic, strong) NSString *_Nullable errorMessage; @property (nonatomic, assign) NSInteger errorCode; @property (nonatomic, strong) NSMutableDictionary *_Nullable links; @property (nonatomic, strong) NSMutableDictionary *_Nullable data; @property (nonatomic, strong) NSMutableDictionary *_Nullable commands; @property (nonatomic, strong) NSMutableDictionary *_Nullable queries; @property (nonatomic, strong) NSMutableArray <TSDKCollectionJSON *> *_Nullable collection; + (NSDictionary *_Nullable)dictionaryToCollectionJSON:(NSDictionary *_Nonnull)dictionary; - (instancetype _Nullable)initWithCoder:(NSCoder *_Nonnull)aDecoder; - (instancetype _Nullable)initWithJSON:(NSDictionary *_Nonnull)JSON; + (instancetype _Nullable)collectionJSONForEncodedData:(NSData *_Nonnull)objectData; - (NSString *_Nullable)getObjectiveCHeaderSkeleton; - (NSData *_Nonnull)dataEncodedForSave; @end
Add type to Collection Property
Add type to Collection Property
C
mit
teamsnap/teamsnap-SDK-iOS,teamsnap/teamsnap-SDK-iOS,teamsnap/teamsnap-SDK-iOS
f2c9e4ef2fd88ddebec6d885eb6a9b40efdea4de
simple-examples/static.c
simple-examples/static.c
#include <stdio.h> /* Static functions and static global variables are only visible in * the file that it is declared in. Static variables inside of a * function have a different meaning and is described below */ void foo() { int x = 0; static int staticx = 0; // initialized once; keeps value between invocations of foo(). x++; staticx++; printf("x=%d\n", x); printf("staticx=%d\n", staticx); } int main(void) { for(int i=0; i<10; i++) foo(); }
// Scott Kuhl #include <stdio.h> /* Static functions and static global variables are only visible in * the file that it is declared in. Static variables inside of a * function have a different meaning and is described below */ void foo() { int x = 0; static int staticx = 0; // initialized once; keeps value between invocations of foo(). x++; staticx++; printf("x=%d\n", x); printf("staticx=%d\n", staticx); } int main(void) { for(int i=0; i<10; i++) foo(); }
Add name to top of file.
Add name to top of file.
C
unlicense
skuhl/sys-prog-examples,skuhl/sys-prog-examples,skuhl/sys-prog-examples
ce94377523f8e0aeff726e30222974022dfaae59
src/config.h
src/config.h
/****************************** ** Tsunagari Tile Engine ** ** config.h ** ** Copyright 2011 OmegaSDG ** ******************************/ #ifndef CONFIG_H #define CONFIG_H // === Default Configuration Settings === /* Tsunagari config file. -- Command Line */ #define CLIENT_CONF_FILE "./client.conf" /* Error verbosity level. -- Command Line */ #define MESSAGE_MODE MM_DEBUG /* Milliseconds of button down before starting persistent input in roguelike movement mode. -- Move to World Descriptor */ #define ROGUELIKE_PERSIST_DELAY_INIT 500 /* Milliseconds between persistent input sends in roguelike movement mode. -- Move to World Descriptor */ #define ROGUELIKE_PERSIST_DELAY_CONSECUTIVE 100 /* Time to live in seconds for empty resource cache entries before they are deleted. -- Command Line */ #define CACHE_EMPTY_TTL 300 // === #endif
/****************************** ** Tsunagari Tile Engine ** ** config.h ** ** Copyright 2011 OmegaSDG ** ******************************/ #ifndef CONFIG_H #define CONFIG_H // === Default Configuration Settings === /* Tsunagari config file. -- Command Line */ #define CLIENT_CONF_FILE "./client.conf" /* Error verbosity level. -- Command Line */ #define MESSAGE_MODE MM_DEBUG /* Milliseconds of button down before starting persistent input in roguelike movement mode. -- Move to World Descriptor */ #define ROGUELIKE_PERSIST_DELAY_INIT 500 /* Milliseconds between persistent input sends in roguelike movement mode. -- Move to World Descriptor */ #define ROGUELIKE_PERSIST_DELAY_CONSECUTIVE 100 /* Time to live in seconds for empty resource cache entries before they are deleted. -- Command Line */ #define CACHE_EMPTY_TTL 300 // === // === Compiler Specific Defines === /* Fix snprintf for VisualC++. */ #ifdef _MSC_VER #define snprintf _snprintf #endif // === #endif
Fix snprintf on VisualC++ with a conditional define.
Fix snprintf on VisualC++ with a conditional define.
C
mit
pmer/TsunagariC,pariahsoft/Tsunagari,pariahsoft/Tsunagari,pariahsoft/TsunagariC,pariahsoft/Tsunagari,pariahsoft/Tsunagari,pmer/TsunagariC,pariahsoft/TsunagariC,pariahsoft/TsunagariC,pmer/TsunagariC
d1bc54a8c50707918b85e311d3e32c7870eb983f
webkit/glue/screen_info.h
webkit/glue/screen_info.h
// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. #ifndef WEBKIT_GLUE_SCREEN_INFO_H_ #define WEBKIT_GLUE_SCREEN_INFO_H_ #include "base/gfx/rect.h" namespace webkit_glue { struct ScreenInfo { int depth; int depth_per_component; bool is_monochrome; gfx::Rect rect; gfx::Rect available_rect; }; } // namespace webkit_glue #endif // WEBKIT_GLUE_SCREEN_INFO_H_
Add missing file. Oops :(
Add missing file. Oops :( TBR=dglazkov Review URL: http://codereview.chromium.org/8789 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@4338 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
M4sse/chromium.src,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,patrickm/chromium.src,M4sse/chromium.src,littlstar/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,keishi/chromium,timopulkkinen/BubbleFish,jaruba/chromium.src,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,anirudhSK/chromium,patrickm/chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,Just-D/chromium-1,zcbenz/cefode-chromium,dednal/chromium.src,zcbenz/cefode-chromium,axinging/chromium-crosswalk,zcbenz/cefode-chromium,dednal/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,hujiajie/pa-chromium,rogerwang/chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,Jonekee/chromium.src,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,keishi/chromium,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,ondra-novak/chromium.src,robclark/chromium,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,robclark/chromium,hujiajie/pa-chromium,robclark/chromium,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,M4sse/chromium.src,dednal/chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,zcbenz/cefode-chromium,Just-D/chromium-1,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,ondra-novak/chromium.src,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,jaruba/chromium.src,keishi/chromium,ltilve/chromium,ltilve/chromium,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,rogerwang/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,rogerwang/chromium,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,ltilve/chromium,anirudhSK/chromium,rogerwang/chromium,dushu1203/chromium.src,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,robclark/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,robclark/chromium,robclark/chromium,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,robclark/chromium,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,littlstar/chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,rogerwang/chromium,M4sse/chromium.src,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,rogerwang/chromium,M4sse/chromium.src,robclark/chromium,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,M4sse/chromium.src,ltilve/chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,rogerwang/chromium,junmin-zhu/chromium-rivertrail,keishi/chromium,hgl888/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,axinging/chromium-crosswalk,anirudhSK/chromium,rogerwang/chromium,chuan9/chromium-crosswalk,robclark/chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,Chilledheart/chromium,dednal/chromium.src,patrickm/chromium.src,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,keishi/chromium,M4sse/chromium.src,bright-sparks/chromium-spacewalk,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,Jonekee/chromium.src,dednal/chromium.src,zcbenz/cefode-chromium,ltilve/chromium,markYoungH/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,hujiajie/pa-chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,rogerwang/chromium,patrickm/chromium.src,axinging/chromium-crosswalk,keishi/chromium,Chilledheart/chromium,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,keishi/chromium,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,dednal/chromium.src,mogoweb/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,robclark/chromium,timopulkkinen/BubbleFish,anirudhSK/chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,patrickm/chromium.src,littlstar/chromium.src,jaruba/chromium.src,keishi/chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,littlstar/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,anirudhSK/chromium,hujiajie/pa-chromium,dushu1203/chromium.src,ltilve/chromium,ondra-novak/chromium.src,keishi/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,rogerwang/chromium,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,Chilledheart/chromium,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src
c54058d7b015ad60403f7996a98ba08dc30bf868
src/importers/kredbimporter.h
src/importers/kredbimporter.h
/*************************************************************************** * Copyright © 2004 Jason Kivlighn <[email protected]> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #ifndef KREDBIMPORTER_H #define KREDBIMPORTER_H #include <QString> #include "baseimporter.h" /** Class to import recipes from any other Krecipes database backend. * Note: Though independent of database type, the two databases must have the same structure (i.e. be the same version) * @author Jason Kivlighn */ class KreDBImporter : public BaseImporter { public: KreDBImporter( const QString &dbType, const QString &host = QString(), const QString &user = QString(), const QString &pass = QString(), int port = 0 ); virtual ~KreDBImporter(); private: virtual void parseFile( const QString &file_or_table ); QString dbType; QString host; QString user; QString pass; int port; }; #endif //KREDBIMPORTER_H
/*************************************************************************** * Copyright © 2004 Jason Kivlighn <[email protected]> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #ifndef KREDBIMPORTER_H #define KREDBIMPORTER_H #include <QString> #include "baseimporter.h" /** Class to import recipes from any other Krecipes database backend. * Note: Though independent of database type, the two databases must have the same structure (i.e. be the same version) * @author Jason Kivlighn */ class KreDBImporter : public BaseImporter { public: explicit KreDBImporter( const QString &dbType, const QString &host = QString(), const QString &user = QString(), const QString &pass = QString(), int port = 0 ); virtual ~KreDBImporter(); private: virtual void parseFile( const QString &file_or_table ); QString dbType; QString host; QString user; QString pass; int port; }; #endif //KREDBIMPORTER_H
Fix Krazy warnings: explicit - KreDBImporter
Fix Krazy warnings: explicit - KreDBImporter svn path=/trunk/extragear/utils/krecipes/; revision=1119833
C
lgpl-2.1
eliovir/krecipes,eliovir/krecipes,eliovir/krecipes,eliovir/krecipes
c1f31e37e3ed046237c04ef0dddcb6587d4f88fb
src/libdpdkif/configuration.h
src/libdpdkif/configuration.h
/* * Configurables. Adjust these to be appropriate for your system. */ /* change blacklist parameters (-b) if necessary */ static const char *ealargs[] = { "if_dpdk", "-b 00:00:03.0", "-c 1", "-n 1", }; /* change PORTID to the one your want to use */ #define IF_PORTID 0 /* change to the init method of your NIC driver */ #ifndef PMD_INIT #define PMD_INIT rte_pmd_init_all #endif /* Receive packets in bursts of 16 per read */ #define MAX_PKT_BURST 16
/* * Configurables. Adjust these to be appropriate for your system. */ /* change blacklist parameters (-b) if necessary * If you have more than one interface, you will likely want to blacklist * at least one of them. */ static const char *ealargs[] = { "if_dpdk", "-b 00:00:03.0", "-c 1", "-n 1", }; /* change PORTID to the one your want to use */ #define IF_PORTID 0 /* change to the init method of your NIC driver */ #ifndef PMD_INIT #define PMD_INIT rte_pmd_init_all #endif /* Receive packets in bursts of 16 per read */ #define MAX_PKT_BURST 16
Add note about blacklisting interfaces
Add note about blacklisting interfaces
C
bsd-2-clause
jqyy/drv-netif-dpdk,jqyy/drv-netif-dpdk
600d895282d9e8fe6d2505902ec3e3970a9e19f7
src/mixal_parser_lib/include/mixal/parser.h
src/mixal_parser_lib/include/mixal/parser.h
#pragma once #include <mixal/config.h> #include <mixal/parsers_utils.h> namespace mixal { class MIXAL_PARSER_LIB_EXPORT IParser { public: std::size_t parse_stream(std::string_view str, std::size_t offset = 0); protected: ~IParser() = default; virtual void do_clear() = 0; virtual std::size_t do_parse_stream(std::string_view str, std::size_t offset) = 0; }; inline std::size_t IParser::parse_stream(std::string_view str, std::size_t offset /*= 0*/) { do_clear(); if (offset > str.size()) { return InvalidStreamPosition(); } const auto pos = do_parse_stream(str, offset); if (IsInvalidStreamPosition(pos)) { // Parser is in undetermined state. // Put back in default state for free do_clear(); } return pos; } } // namespace mixal
#pragma once #include <mixal/config.h> #include <mixal/parsers_utils.h> namespace mixal { class MIXAL_PARSER_LIB_EXPORT IParser { public: std::size_t parse_stream(std::string_view str, std::size_t offset = 0); bool is_valid() const; std::string_view str() const; protected: IParser() = default; ~IParser() = default; virtual void do_clear() = 0; virtual std::size_t do_parse_stream(std::string_view str, std::size_t offset) = 0; private: void clear(); private: std::string_view str_; bool is_valid_{false}; }; inline std::size_t IParser::parse_stream(std::string_view str, std::size_t offset /*= 0*/) { clear(); if (offset > str.size()) { return InvalidStreamPosition(); } const auto pos = do_parse_stream(str, offset); if (IsInvalidStreamPosition(pos)) { // Parser is in undetermined state. // Put back in default state for free clear(); return InvalidStreamPosition(); } is_valid_ = true; str_ = str.substr(offset, pos - offset); return pos; } inline void IParser::clear() { is_valid_ = false; do_clear(); } inline bool IParser::is_valid() const { return is_valid_; } inline std::string_view IParser::str() const { return str_; } } // namespace mixal
Extend IParser interface: remember parse state - succesfull or not; what part of string was parsed
Extend IParser interface: remember parse state - succesfull or not; what part of string was parsed
C
mit
grishavanika/mix,grishavanika/mix,grishavanika/mix
fc8db80964b22fd9355745c4efe0e58b37cc02a5
hard_way/ex9.c
hard_way/ex9.c
#include <stdio.h> int main(int argc, char *argv[]){ int numbers[4] = {0}; char name[4] = {'a'}; //first print them out raw printf("numbers: %d %d %d %d.\n", numbers[0], numbers[1], numbers[2], numbers[3]); printf("name each: %c %c %c %c.\n", name[0], name[1], name[2], name[3]); return 0; }
Print out values of first two arrays
Print out values of first two arrays
C
mit
thewazir/learning_c
2924da319e5a0d76d1ce8462c7029e6395884662
test/CodeGen/2010-07-14-overconservative-align.c
test/CodeGen/2010-07-14-overconservative-align.c
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s // PR 5995 struct s { int word; struct { int filler __attribute__ ((aligned (8))); }; }; void func (struct s *s) { // CHECK: load %struct.s** %s.addr, align 8 s->word = 0; }
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s // PR 5995 struct s { int word; struct { int filler __attribute__ ((aligned (8))); }; }; void func (struct s *s) { // CHECK: load %struct.s**{{.*}}align 8 s->word = 0; }
Rewrite matching line to be friendlier to misc buildbots.
Rewrite matching line to be friendlier to misc buildbots. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136168 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
82050d5da0e4be70b0131eb996873e1f686b8d68
ep_testsuite.h
ep_testsuite.h
#ifndef EP_TESTSUITE_H #define EP_TESTSUITE_H 1 #include <memcached/engine.h> #include <memcached/engine_testapp.h> #ifdef __cplusplus extern "C" { #endif MEMCACHED_PUBLIC_API engine_test_t* get_tests(void); MEMCACHED_PUBLIC_API bool setup_suite(struct test_harness *th); #ifdef __cplusplus } #endif #endif
#ifndef EP_TESTSUITE_H #define EP_TESTSUITE_H 1 #include <memcached/engine.h> #include <memcached/engine_testapp.h> #ifdef __cplusplus extern "C" { #endif MEMCACHED_PUBLIC_API engine_test_t* get_tests(void); MEMCACHED_PUBLIC_API bool setup_suite(struct test_harness *th); MEMCACHED_PUBLIC_API bool teardown_suite(); enum test_result prepare(engine_test_t *test); void cleanup(engine_test_t *test, enum test_result result); #ifdef __cplusplus } #endif #endif
Fix test suite compilation errors
Fix test suite compilation errors This fixes some missing function declaration errors: CXX ep_testsuite_la-ep_testsuite.lo cc1plus: warnings being treated as errors ep_testsuite.cc: In function ‘test_result prepare(engine_test_t*)’: ep_testsuite.cc:5425: error: no previous declaration for ‘test_result prepare(engine_test_t*)’ [-Wmissing-declarations] ep_testsuite.cc: In function ‘void cleanup(engine_test_t*, test_result)’: ep_testsuite.cc:5447: error: no previous declaration for ‘void cleanup(engine_test_t*, test_result)’ [-Wmissing-declarations] ep_testsuite.cc: In function ‘bool teardown_suite()’: ep_testsuite.cc:5965: error: no previous declaration for ‘bool teardown_suite()’ [-Wmissing-declarations] make[2]: *** [ep_testsuite_la-ep_testsuite.lo] Error 1 Change-Id: I2363240c962a09740301a4a85f0559bc04981bcd Reviewed-on: http://review.couchbase.org/7913 Tested-by: Filipe David Borba Manana <[email protected]> Reviewed-by: Dustin Sallings <[email protected]>
C
apache-2.0
zbase/ep-engine,daverigby/kv_engine,couchbase/ep-engine,abhinavdangeti/ep-engine,hisundar/ep-engine,couchbaselabs/ep-engine,owendCB/ep-engine,daverigby/kv_engine,jimwwalker/ep-engine,abhinavdangeti/ep-engine,couchbaselabs/ep-engine,couchbase/ep-engine,daverigby/kv_engine,sriganes/ep-engine,jimwwalker/ep-engine,couchbase/ep-engine,membase/ep-engine,daverigby/ep-engine,abhinavdangeti/ep-engine,zbase/ep-engine,sriganes/ep-engine,teligent-ru/ep-engine,membase/ep-engine,owendCB/ep-engine,jimwwalker/ep-engine,membase/ep-engine,teligent-ru/ep-engine,owendCB/ep-engine,abhinavdangeti/ep-engine,zbase/ep-engine,hisundar/ep-engine,couchbaselabs/ep-engine,jimwwalker/ep-engine,teligent-ru/ep-engine,hisundar/ep-engine,daverigby/ep-engine,daverigby/ep-engine,daverigby/kv_engine,zbase/ep-engine,zbase/ep-engine,sriganes/ep-engine,membase/ep-engine,couchbase/ep-engine,owendCB/ep-engine,daverigby/ep-engine,sriganes/ep-engine,teligent-ru/ep-engine,couchbaselabs/ep-engine,couchbaselabs/ep-engine,abhinavdangeti/ep-engine,hisundar/ep-engine
2929c302e27280a7060fc35e1bf1f82719066909
fmpz_mpoly/test/t-init.c
fmpz_mpoly/test/t-init.c
/* Copyright (C) 2016 William Hart This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <gmp.h> #include "flint.h" #include "fmpz.h" #include "fmpz_mpoly.h" #include "ulong_extras.h" int main(void) { int i; FLINT_TEST_INIT(state); flint_printf("void...."); fflush(stdout); /* Check aliasing of a and c */ for (i = 0; i < 1000 * flint_test_multiplier(); i++) { } FLINT_TEST_CLEANUP(state); flint_printf("PASS\n"); return 0; }
Add empty test to prevent build system complaining.
Add empty test to prevent build system complaining.
C
lgpl-2.1
dsroche/flint2,dsroche/flint2,fredrik-johansson/flint2,wbhart/flint2,fredrik-johansson/flint2,dsroche/flint2,wbhart/flint2,dsroche/flint2,fredrik-johansson/flint2,wbhart/flint2
33b703740fd3ade5192bb61492b14cf5cfcebc2c
InputState.h
InputState.h
#ifndef INPUTSTATE_H #define INPUTSTATE_H #include <SDL2/SDL.h> #undef main #include <map> class InputState { public: enum KeyFunction { KF_EXIT, KF_FORWARDS, KF_BACKWARDS, KF_ROTATE_SUN }; InputState(); void readInputState(); bool getKeyState(KeyFunction f); int getAbsoluteMouseX() { return mouse_x; }; int getAbsoluteMouseY() { return mouse_y; }; float getMouseX() { return (float)mouse_x / (float)w; }; float getMouseY() { return (float)mouse_y / (float)h; }; int w, h; int mouse_x, mouse_y; private: Uint8 *keys; Uint8 key_function_to_keycode[3]; }; #endif
#ifndef INPUTSTATE_H #define INPUTSTATE_H #include <SDL2/SDL.h> #undef main #include <map> class InputState { public: enum KeyFunction { KF_EXIT, KF_FORWARDS, KF_BACKWARDS, KF_ROTATE_SUN }; InputState(); void readInputState(); bool getKeyState(KeyFunction f); int getAbsoluteMouseX() { return mouse_x; }; int getAbsoluteMouseY() { return mouse_y; }; float getMouseX() { return (float)mouse_x / (float)w; }; float getMouseY() { return (float)mouse_y / (float)h; }; int w, h; int mouse_x, mouse_y; private: Uint8 *keys; Uint8 key_function_to_keycode[4]; }; #endif
Fix InputSize symbol array size.
Fix InputSize symbol array size.
C
mit
pstiasny/derpengine,pstiasny/derpengine
11d45b0090be38423587ef8d1a0215937932223e
src/memory.c
src/memory.c
/* * Copyright (c) 2009-2012 Petri Lehtinen <[email protected]> * Copyright (c) 2011-2012 Basile Starynkevitch <[email protected]> * * Jansson is free software; you can redistribute it and/or modify it * under the terms of the MIT license. See LICENSE for details. */ #include <stdlib.h> #include <string.h> #include "jansson.h" #include "jansson_private.h" /* memory function pointers */ static json_malloc_t do_malloc = malloc; static json_free_t do_free = free; void *jsonp_malloc(size_t size) { if(!size) return NULL; return (*do_malloc)(size); } void jsonp_free(void *ptr) { if(!ptr) return; (*do_free)(ptr); } char *jsonp_strdup(const char *str) { char *new_str; new_str = jsonp_malloc(strlen(str) + 1); if(!new_str) return NULL; strcpy(new_str, str); return new_str; } void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) { do_malloc = malloc_fn; do_free = free_fn; }
/* * Copyright (c) 2009-2012 Petri Lehtinen <[email protected]> * Copyright (c) 2011-2012 Basile Starynkevitch <[email protected]> * * Jansson is free software; you can redistribute it and/or modify it * under the terms of the MIT license. See LICENSE for details. */ #include <stdlib.h> #include <string.h> #include "jansson.h" #include "jansson_private.h" /* memory function pointers */ static json_malloc_t do_malloc = malloc; static json_free_t do_free = free; void *jsonp_malloc(size_t size) { if(!size) return NULL; return (*do_malloc)(size); } void jsonp_free(void *ptr) { if(!ptr) return; (*do_free)(ptr); } char *jsonp_strdup(const char *str) { char *new_str; size_t len; len = strlen(str); if(len == (size_t)-1) return NULL; new_str = jsonp_malloc(len + 1); if(!new_str) return NULL; strcpy(new_str, str); return new_str; } void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) { do_malloc = malloc_fn; do_free = free_fn; }
Fix integer overflow in jsonp_strdup()
Fix integer overflow in jsonp_strdup() Fixes #129.
C
mit
AmesianX/jansson,markalanj/jansson,Vorne/jansson,OlehKulykov/jansson,bstarynk/jansson,simonfojtu/FireSight,markalanj/jansson,firepick1/jansson,chrullrich/jansson,Mephistophiles/jansson,markalanj/jansson,firepick-delta/FireSight,liu3tao/jansson,rogerz/jansson,firepick1/FireSight,liu3tao/jansson,firepick-delta/FireSight,simonfojtu/FireSight,Mephistophiles/jansson,simonfojtu/FireSight,attie/jansson,rogerz/jansson,akheron/jansson,firepick1/FireSight,slackner/jansson,wirebirdlabs/featherweight-jansson,slackner/jansson,firepick-delta/FireSight,OlehKulykov/jansson,wirebirdlabs/featherweight-jansson,attie/jansson,npmccallum/jansson,akheron/jansson,rogerz/jansson,firepick1/jansson,npmccallum/jansson,firepick1/jansson,chrullrich/jansson,bstarynk/jansson,Vorne/jansson,akheron/jansson,AmesianX/jansson,rogerz/jansson,bstarynk/jansson,firepick1/FireSight
8f020cf00dff0ae6d40f68ba7f901c1c0f784093
ui/base/ime/character_composer.h
ui/base/ime/character_composer.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_BASE_IME_CHARACTER_COMPOSER_H_ #define UI_BASE_IME_CHARACTER_COMPOSER_H_ #pragma once #include <vector> #include "base/basictypes.h" #include "base/string_util.h" namespace ui { // A class to recognize compose and dead key sequence. // Outputs composed character. // // TODO(hashimoto): support unicode character composition starting with // Ctrl-Shift-U. http://crosbug.com/15925 class CharacterComposer { public: CharacterComposer(); ~CharacterComposer(); void Reset(); // Filters keypress. // Returns true if the keypress is recognized as a part of composition // sequence. bool FilterKeyPress(unsigned int keycode); // Returns a string consisting of composed character. // Empty string is returned when there is no composition result. const string16& composed_character() const { return composed_character_; } private: // Remembers keypresses previously filtered. std::vector<unsigned int> compose_buffer_; // A string representing the composed character. string16 composed_character_; DISALLOW_COPY_AND_ASSIGN(CharacterComposer); }; } // namespace ui #endif // UI_BASE_IME_CHARACTER_COMPOSER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_BASE_IME_CHARACTER_COMPOSER_H_ #define UI_BASE_IME_CHARACTER_COMPOSER_H_ #pragma once #include <vector> #include "base/basictypes.h" #include "base/string_util.h" #include "ui/base/ui_export.h" namespace ui { // A class to recognize compose and dead key sequence. // Outputs composed character. // // TODO(hashimoto): support unicode character composition starting with // Ctrl-Shift-U. http://crosbug.com/15925 class UI_EXPORT CharacterComposer { public: CharacterComposer(); ~CharacterComposer(); void Reset(); // Filters keypress. // Returns true if the keypress is recognized as a part of composition // sequence. bool FilterKeyPress(unsigned int keycode); // Returns a string consisting of composed character. // Empty string is returned when there is no composition result. const string16& composed_character() const { return composed_character_; } private: // Remembers keypresses previously filtered. std::vector<unsigned int> compose_buffer_; // A string representing the composed character. string16 composed_character_; DISALLOW_COPY_AND_ASSIGN(CharacterComposer); }; } // namespace ui #endif // UI_BASE_IME_CHARACTER_COMPOSER_H_
Fix link error when component=shared_library is set
Fix link error when component=shared_library is set BUG=103789 TEST=Manual Review URL: http://codereview.chromium.org/8515013 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@109554 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
keishi/chromium,chuan9/chromium-crosswalk,ondra-novak/chromium.src,Jonekee/chromium.src,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,keishi/chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,robclark/chromium,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,patrickm/chromium.src,ondra-novak/chromium.src,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,littlstar/chromium.src,dednal/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,rogerwang/chromium,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,patrickm/chromium.src,Chilledheart/chromium,keishi/chromium,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,Just-D/chromium-1,rogerwang/chromium,hujiajie/pa-chromium,robclark/chromium,anirudhSK/chromium,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,robclark/chromium,dednal/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,M4sse/chromium.src,Chilledheart/chromium,bright-sparks/chromium-spacewalk,Just-D/chromium-1,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,robclark/chromium,markYoungH/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,rogerwang/chromium,dednal/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,rogerwang/chromium,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,anirudhSK/chromium,littlstar/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,zcbenz/cefode-chromium,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,markYoungH/chromium.src,Just-D/chromium-1,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,hujiajie/pa-chromium,hujiajie/pa-chromium,robclark/chromium,anirudhSK/chromium,Just-D/chromium-1,chuan9/chromium-crosswalk,dushu1203/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,rogerwang/chromium,timopulkkinen/BubbleFish,ondra-novak/chromium.src,dushu1203/chromium.src,ltilve/chromium,mogoweb/chromium-crosswalk,robclark/chromium,keishi/chromium,krieger-od/nwjs_chromium.src,rogerwang/chromium,nacl-webkit/chrome_deps,patrickm/chromium.src,patrickm/chromium.src,axinging/chromium-crosswalk,ChromiumWebApps/chromium,dushu1203/chromium.src,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,ltilve/chromium,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,dednal/chromium.src,keishi/chromium,M4sse/chromium.src,dushu1203/chromium.src,hujiajie/pa-chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,littlstar/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,dushu1203/chromium.src,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,robclark/chromium,hgl888/chromium-crosswalk,robclark/chromium,krieger-od/nwjs_chromium.src,ltilve/chromium,anirudhSK/chromium,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,rogerwang/chromium,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,dushu1203/chromium.src,jaruba/chromium.src,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,Fireblend/chromium-crosswalk,rogerwang/chromium,dednal/chromium.src,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,ltilve/chromium,robclark/chromium,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,keishi/chromium,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,robclark/chromium,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,littlstar/chromium.src,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,keishi/chromium,axinging/chromium-crosswalk,anirudhSK/chromium,keishi/chromium,axinging/chromium-crosswalk,ltilve/chromium,Jonekee/chromium.src,anirudhSK/chromium,anirudhSK/chromium,ChromiumWebApps/chromium,markYoungH/chromium.src,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,ltilve/chromium,markYoungH/chromium.src,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,timopulkkinen/BubbleFish,Chilledheart/chromium,Chilledheart/chromium,markYoungH/chromium.src,M4sse/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,rogerwang/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,Chilledheart/chromium,keishi/chromium,patrickm/chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,keishi/chromium,ltilve/chromium,jaruba/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,keishi/chromium,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,dednal/chromium.src,Jonekee/chromium.src
580305a8cda0cb85ee837cf8d8a15ee80ba0c41d
cint/include/iosfwd.h
cint/include/iosfwd.h
#ifndef G__IOSFWD_H #define G__IOSFWD_H #include <iostream.h> typedef basic_streambuf<char, char_traits<char> > streambuf; #endif
#ifndef G__IOSFWD_H #define G__IOSFWD_H #include <iostream.h> #endif
Undo change proposed by Philippe. Too many side effects.
Undo change proposed by Philippe. Too many side effects. git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@5468 27541ba8-7e3a-0410-8455-c3a389f83636
C
lgpl-2.1
dawehner/root,dawehner/root,dawehner/root,bbannier/ROOT,bbannier/ROOT,dawehner/root,dawehner/root,bbannier/ROOT,bbannier/ROOT,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT
f3d275984b116f79fbb8568e72d1707ef12230c5
unix/image.c
unix/image.c
// 13 september 2016 #include "uipriv_unix.h" struct uiImage { uiUnixControl c; GtkWidget *widget; }; uiUnixControlAllDefaults(uiImage) uiImage *uiNewImage(const char *filename) { uiImage *img; uiUnixNewControl(uiImage, img); img->widget = gtk_image_new_from_file(filename); return img; }
// 13 september 2016 #include "uipriv_unix.h" struct uiImage { uiUnixControl c; GtkWidget *widget; }; uiUnixControlAllDefaults(uiImage) void uiImageSetSize(uiImage *i, unsigned int width, unsigned int height) { GdkPixbuf *pixbuf; pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(i->widget)); pixbuf = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); gtk_image_set_from_pixbuf(GTK_IMAGE(i->widget), pixbuf); g_object_unref(pixbuf); } void uiImageGetSize(uiImage *i, unsigned int *width, unsigned int *height) { GdkPixbuf *pixbuf; pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(i->widget)); *width = gdk_pixbuf_get_width(pixbuf); *height = gdk_pixbuf_get_height(pixbuf); } uiImage *uiNewImage(const char *filename) { uiImage *img; uiUnixNewControl(uiImage, img); img->widget = gtk_image_new_from_file(filename); return img; }
Implement getting and setting uiImage size in Gtk
Implement getting and setting uiImage size in Gtk
C
mit
sclukey/libui,sclukey/libui
af7c239ac6629f7bd102b3e648c0dd86c2054407
os/gl/gl_context_nsgl.h
os/gl/gl_context_nsgl.h
// LAF OS Library // Copyright (C) 2022 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef OS_GL_CONTEXT_NSGL_INCLUDED #define OS_GL_CONTEXT_NSGL_INCLUDED #pragma once #include "os/gl/gl_context.h" namespace os { class GLContextNSGL : public GLContext { public: GLContextNSGL(); ~GLContextNSGL(); void setView(id view); bool isValid() override; bool createGLContext() override; void destroyGLContext() override; void makeCurrent() override; void swapBuffers() override; id nsglContext() { return m_nsgl; } private: id m_nsgl = nil; // NSOpenGLContext id m_view = nil; // NSView }; } // namespace os #endif
// LAF OS Library // Copyright (C) 2022 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef OS_GL_CONTEXT_NSGL_INCLUDED #define OS_GL_CONTEXT_NSGL_INCLUDED #pragma once #include "os/gl/gl_context.h" namespace os { class GLContextNSGL : public GLContext { public: GLContextNSGL(); ~GLContextNSGL(); void setView(id view); bool isValid() override; bool createGLContext() override; void destroyGLContext() override; void makeCurrent() override; void swapBuffers() override; id nsglContext() { return m_nsgl; } private: id m_nsgl = nullptr; // NSOpenGLContext id m_view = nullptr; // NSView }; } // namespace os #endif
Replace nil with nullptr in GLContextNSGL to compile correctly
[osx] Replace nil with nullptr in GLContextNSGL to compile correctly
C
mit
aseprite/laf,aseprite/laf
46e2418fc661eb2d58272c995d8579ec67accf69
packages/grpc-native-core/ext/completion_queue.h
packages/grpc-native-core/ext/completion_queue.h
/* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <grpc/grpc.h> #include <v8.h> namespace grpc { namespace node { grpc_completion_queue *GetCompletionQueue(); void CompletionQueueNext(); void CompletionQueueInit(v8::Local<v8::Object> exports); } // namespace node } // namespace grpc
/* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <grpc/grpc.h> #include <v8.h> namespace grpc { namespace node { grpc_completion_queue *GetCompletionQueue(); void CompletionQueueNext(); void CompletionQueueInit(v8::Local<v8::Object> exports); void CompletionQueueForcePoll(); } // namespace node } // namespace grpc
Update completion queue header to match code changes
Update completion queue header to match code changes
C
apache-2.0
grpc/grpc-node,grpc/grpc-node,grpc/grpc-node,grpc/grpc-node
18442c5cf486e16f4cb418a0d7ef2a2dd9ea7c34
Fastor/tensor/ScalarIndexing.h
Fastor/tensor/ScalarIndexing.h
#ifndef SCALAR_INDEXING_NONCONST_H #define SCALAR_INDEXING_NONCONST_H // Scalar indexing non-const //----------------------------------------------------------------------------------------------------------// template<typename... Args, typename std::enable_if<sizeof...(Args)==dimension_t::value && is_arithmetic_pack<Args...>::value,bool>::type =0> FASTOR_INLINE T& operator()(Args ... args) { return _data[get_flat_index(args...)]; } //----------------------------------------------------------------------------------------------------------// #endif // SCALAR_INDEXING_NONCONST_H #ifndef SCALAR_INDEXING_CONST_H #define SCALAR_INDEXING_CONST_H // Scalar indexing const //----------------------------------------------------------------------------------------------------------// template<typename... Args, typename std::enable_if<sizeof...(Args)==dimension_t::value && is_arithmetic_pack<Args...>::value,bool>::type =0> constexpr FASTOR_INLINE const T& operator()(Args ... args) const { return _data[get_flat_index(args...)]; } //----------------------------------------------------------------------------------------------------------// #endif // SCALAR_INDEXING_CONST_H
#ifndef SCALAR_INDEXING_NONCONST_H #define SCALAR_INDEXING_NONCONST_H // Scalar indexing non-const //----------------------------------------------------------------------------------------------------------// template<typename... Args, typename std::enable_if<sizeof...(Args)==dimension_t::value && is_arithmetic_pack<Args...>::value,bool>::type =0> FASTOR_INLINE T& operator()(Args ... args) { return _data[get_flat_index(args...)]; } template<typename Arg, typename std::enable_if<1==dimension_t::value && is_arithmetic_pack<Arg>::value,bool>::type =0> FASTOR_INLINE T& operator[](Arg arg) { return _data[get_flat_index(arg)]; } //----------------------------------------------------------------------------------------------------------// #endif // SCALAR_INDEXING_NONCONST_H #ifndef SCALAR_INDEXING_CONST_H #define SCALAR_INDEXING_CONST_H // Scalar indexing const //----------------------------------------------------------------------------------------------------------// template<typename... Args, typename std::enable_if<sizeof...(Args)==dimension_t::value && is_arithmetic_pack<Args...>::value,bool>::type =0> constexpr FASTOR_INLINE const T& operator()(Args ... args) const { return _data[get_flat_index(args...)]; } template<typename Arg, typename std::enable_if<1==dimension_t::value && is_arithmetic_pack<Arg>::value,bool>::type =0> constexpr FASTOR_INLINE const T& operator[](Arg arg) const { return _data[get_flat_index(arg)]; } //----------------------------------------------------------------------------------------------------------// #endif // SCALAR_INDEXING_CONST_H
Allow indexing by operator[] when dimension is 1
Allow indexing by operator[] when dimension is 1
C
mit
romeric/Fastor,romeric/Fastor,romeric/Fastor
d7519565d22249fa2c0f2ec4c60a2c0e3981b916
features/mbedtls/platform/inc/platform_mbed.h
features/mbedtls/platform/inc/platform_mbed.h
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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. * * This file is part of mbed TLS (https://tls.mbed.org) */ #if defined(DEVICE_TRNG) #define MBEDTLS_ENTROPY_HARDWARE_ALT #endif #if defined(DEVICE_RTC) #define MBEDTLS_HAVE_TIME_DATE #endif #if defined(MBEDTLS_CONFIG_HW_SUPPORT) #include "mbedtls_device.h" #endif
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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. * * This file is part of mbed TLS (https://tls.mbed.org) */ #if defined(DEVICE_TRNG) #define MBEDTLS_ENTROPY_HARDWARE_ALT #endif #if defined(MBEDTLS_CONFIG_HW_SUPPORT) #include "mbedtls_device.h" #endif
Disable MBEDTLS_HAVE_DATE_TIME as ARMCC does not support gmtime
Disable MBEDTLS_HAVE_DATE_TIME as ARMCC does not support gmtime
C
apache-2.0
andcor02/mbed-os,andcor02/mbed-os,betzw/mbed-os,mbedmicro/mbed,c1728p9/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os,betzw/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,betzw/mbed-os,kjbracey-arm/mbed,betzw/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,andcor02/mbed-os,c1728p9/mbed-os,betzw/mbed-os,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,andcor02/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,betzw/mbed-os,c1728p9/mbed-os
6ddc15b9ba5b3b0c811a1ad22131005360474692
libyaul/scu/bus/b/vdp/vdp2_tvmd_display_clear.c
libyaul/scu/bus/b/vdp/vdp2_tvmd_display_clear.c
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <[email protected]> */ #include <vdp2/tvmd.h> #include "vdp-internal.h" void vdp2_tvmd_display_clear(void) { _state_vdp2()->regs.tvmd &= 0x7FFF; /* Change the DISP bit during VBLANK */ vdp2_tvmd_vblank_in_wait(); MEMORY_WRITE(16, VDP2(TVMD), _state_vdp2()->regs.tvmd); }
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <[email protected]> */ #include <vdp2/tvmd.h> #include "vdp-internal.h" void vdp2_tvmd_display_clear(void) { _state_vdp2()->regs.tvmd &= 0x7EFF; /* Change the DISP bit during VBLANK */ vdp2_tvmd_vblank_in_wait(); MEMORY_WRITE(16, VDP2(TVMD), _state_vdp2()->regs.tvmd); }
Clear bit when writing to VDP2(TVMD)
Clear bit when writing to VDP2(TVMD)
C
mit
ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul
f24e70fa3a204565a656594b48ac84c390aa1e8f
libcef_dll/cef_macros.h
libcef_dll/cef_macros.h
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef CEF_LIBCEF_DLL_CEF_MACROS_H_ #define CEF_LIBCEF_DLL_CEF_MACROS_H_ #pragma once #ifdef BUILDING_CEF_SHARED #include "base/macros.h" #else // !BUILDING_CEF_SHARED // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) #endif // !BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CEF_MACROS_H_ // Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef CEF_LIBCEF_DLL_CEF_MACROS_H_ #define CEF_LIBCEF_DLL_CEF_MACROS_H_ #pragma once #ifdef BUILDING_CEF_SHARED #include "base/macros.h" #else // !BUILDING_CEF_SHARED // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) #endif // !BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CEF_MACROS_H_
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef CEF_LIBCEF_DLL_CEF_MACROS_H_ #define CEF_LIBCEF_DLL_CEF_MACROS_H_ #pragma once #ifdef BUILDING_CEF_SHARED #include "base/macros.h" #else // !BUILDING_CEF_SHARED // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) #endif // !BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CEF_MACROS_H_
Remove duplicate content in file.
Remove duplicate content in file. git-svn-id: 66addb63d0c46e75f185859367c4faf62af16cdd@1734 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
C
bsd-3-clause
kuscsik/chromiumembedded,kuscsik/chromiumembedded,kuscsik/chromiumembedded,kuscsik/chromiumembedded
f908528a004812c36a27a6705f8d2453cc9084c4
sesman/libscp/libscp_init.c
sesman/libscp/libscp_init.c
/** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libscp_init.c * @brief libscp initialization code * @author Simone Fedele * */ #include "libscp_init.h" //struct log_config* s_log; /* server API */ int DEFAULT_CC scp_init() { /* if (0 == log) { return 1; } */ //s_log = log; scp_lock_init(); log_message(LOG_LEVEL_WARNING, "[init:%d] libscp initialized", __LINE__); return 0; }
/** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libscp_init.c * @brief libscp initialization code * @author Simone Fedele * */ #include "libscp_init.h" //struct log_config* s_log; /* server API */ int DEFAULT_CC scp_init() { /* if (0 == log) { return 1; } */ //s_log = log; scp_lock_init(); log_message(LOG_LEVEL_DEBUG, "libscp initialized"); return 0; }
Downgrade "libscp initialized" to LOG_LEVEL_DEBUG, remove line number
Downgrade "libscp initialized" to LOG_LEVEL_DEBUG, remove line number It's a bad style to start the log with a cryptic warning.
C
apache-2.0
metalefty/xrdp,moobyfr/xrdp,itamarjp/xrdp,PKRoma/xrdp,PKRoma/xrdp,jsorg71/xrdp,cocoon/xrdp,ubuntu-xrdp/xrdp,ubuntu-xrdp/xrdp,itamarjp/xrdp,neutrinolabs/xrdp,itamarjp/xrdp,moobyfr/xrdp,proski/xrdp,jsorg71/xrdp,metalefty/xrdp,moobyfr/xrdp,neutrinolabs/xrdp,neutrinolabs/xrdp,cocoon/xrdp,metalefty/xrdp,proski/xrdp,cocoon/xrdp,proski/xrdp,jsorg71/xrdp,ubuntu-xrdp/xrdp,PKRoma/xrdp
af2092f1be7ab6af6bd67fcc59009adb2ee51470
mudlib/mud/home/Text/sys/verb/wiz/ooc/system/btune.c
mudlib/mud/home/Text/sys/verb/wiz/ooc/system/btune.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/kotaka.h> #include <kotaka/paths/string.h> #include <kotaka/paths/system.h> #include <kotaka/paths/text.h> #include <kotaka/paths/thing.h> inherit LIB_RAWVERB; void main(object actor, string args) { object user; float interval; user = query_user(); if (user->query_class() < 2) { send_out("You do not have sufficient access rights to tune the bulk sync system.\n"); return; } if (args == "") { send_out("Current bulk sync interval: " + STRINGD->mixed_sprint(BULKD->query_interval()) + "\n"); return; } if (!sscanf(args, "%f", interval)) { send_out("Floats only please.\n"); return; } BULKD->set_interval(interval); send_out("BulkD tuned.\n"); return; }
Add command to tune bulkd
Add command to tune bulkd
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
7359740eaddf6e4c01ccd91fe1044932d019d8e3
Settings/Controls/Label.h
Settings/Controls/Label.h
#pragma once #include "Control.h" #include "../../3RVX/Logger.h" class Label : public Control { public: Label() { } Label(int id, HWND parent) : Control(id, parent) { } };
#pragma once #include "Control.h" #include "../../3RVX/Logger.h" class Label : public Control { public: Label() { } Label(int id, HWND parent) : Control(id, parent) { } Label(int id, DialogBase &parent, bool translate = true) : Control(id, parent, false) { } };
Add a new-style constructor for labels
Add a new-style constructor for labels
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
4160de1a24f5ca414508e396e43ba756d73f8338
Source/PPSSignatureView.h
Source/PPSSignatureView.h
#import <UIKit/UIKit.h> #import <GLKit/GLKit.h> @interface PPSSignatureView : GLKView @property (assign, nonatomic) UIColor *strokeColor; @property (assign, nonatomic) BOOL hasSignature; @property (strong, nonatomic) UIImage *signatureImage; - (void)erase; @end
#import <UIKit/UIKit.h> #import <GLKit/GLKit.h> @interface PPSSignatureView : GLKView @property (assign, nonatomic) IBInspectable UIColor *strokeColor; @property (assign, nonatomic) BOOL hasSignature; @property (strong, nonatomic) UIImage *signatureImage; - (void)erase; @end
Make stroke color an IBInspectable property.
Make stroke color an IBInspectable property.
C
mit
ronaldsmartin/PPSSignatureView
e636d645deee9bf088091fba525ca18f55c516c9
src/common/angleutils.h
src/common/angleutils.h
// // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // angleutils.h: Common ANGLE utilities. #ifndef COMMON_ANGLEUTILS_H_ #define COMMON_ANGLEUTILS_H_ // A macro to disallow the copy constructor and operator= functions // This must be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) template <typename T, unsigned int N> inline unsigned int ArraySize(T(&)[N]) { return N; } #if defined(_MSC_VER) #define snprintf _snprintf #endif #define VENDOR_ID_AMD 0x1002 #define VENDOR_ID_INTEL 0x8086 #define VENDOR_ID_NVIDIA 0x10DE #define GL_BGRA4_ANGLEX 0x6ABC #define GL_BGR5_A1_ANGLEX 0x6ABD #endif // COMMON_ANGLEUTILS_H_
// // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // angleutils.h: Common ANGLE utilities. #ifndef COMMON_ANGLEUTILS_H_ #define COMMON_ANGLEUTILS_H_ // A macro to disallow the copy constructor and operator= functions // This must be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) template <typename T, unsigned int N> inline unsigned int ArraySize(T(&)[N]) { return N; } template <typename T, unsigned int N> void SafeRelease(T (&resourceBlock)[N]) { for (unsigned int i = 0; i < N; i++) { SafeRelease(resourceBlock[i]); } } template <typename T> void SafeRelease(T& resource) { if (resource) { resource->Release(); resource = NULL; } } #if defined(_MSC_VER) #define snprintf _snprintf #endif #define VENDOR_ID_AMD 0x1002 #define VENDOR_ID_INTEL 0x8086 #define VENDOR_ID_NVIDIA 0x10DE #define GL_BGRA4_ANGLEX 0x6ABC #define GL_BGR5_A1_ANGLEX 0x6ABD #endif // COMMON_ANGLEUTILS_H_
Add helper functions to safely release Windows COM resources, and arrays of COM resources.
Add helper functions to safely release Windows COM resources, and arrays of COM resources. TRAC #22656 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: 2a1ef23f1c4b6a1dbccd5f9514022461535c55c0@2014 736b8ea6-26fd-11df-bfd4-992fa37f6226
C
bsd-3-clause
ehsan/angle,xuxiandi/angleproject,xin3liang/platform_external_chromium_org_third_party_angle_dx11,MIPS/external-chromium_org-third_party-angle_dx11,shairai/angleproject,MIPS/external-chromium_org-third_party-angle,xin3liang/platform_external_chromium_org_third_party_angle,RepublicMaster/angleproject,vvuk/angle-old,android-ia/platform_external_chromium_org_third_party_angle,KalebDark/angleproject,android-ia/platform_external_chromium_org_third_party_angle,MIPS/external-chromium_org-third_party-angle_dx11,MIPS/external-chromium_org-third_party-angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,jgcaaprom/android_external_chromium_org_third_party_angle,android-ia/platform_external_chromium_org_third_party_angle,jgcaaprom/android_external_chromium_org_third_party_angle,jgcaaprom/android_external_chromium_org_third_party_angle,KTXSoftware/angleproject,cantren/angleproject,MSOpenTech/angle-win8.0,cantren/angleproject,KalebDark/angleproject,ehsan/angle,RepublicMaster/angleproject,vvuk/angle-old,android-ia/platform_external_chromium_org_third_party_angle,MIPS/external-chromium_org-third_party-angle,xin3liang/platform_external_chromium_org_third_party_angle_dx11,themusicgod1/angleproject,MSOpenTech/angle-win8.0,android-ia/platform_external_chromium_org_third_party_angle_dx11,android-ia/platform_external_chromium_org_third_party_angle_dx11,cvsuser-chromium/chromium-third-party_angle_dx11,pombreda/angleproject,themusicgod1/angleproject,xin3liang/platform_external_chromium_org_third_party_angle,MIPS/external-chromium_org-third_party-angle_dx11,KTXSoftware/angleproject,ehsan/angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,themusicgod1/angleproject,xuxiandi/angleproject,stammen/angleproject,MIPS/external-chromium_org-third_party-angle,KTXSoftware/angleproject,KalebDark/angleproject,KTXSoftware/angleproject,xin3liang/platform_external_chromium_org_third_party_angle,pombreda/angleproject,cvsuser-chromium/chromium-third-party_angle_dx11,shairai/angleproject,MIPS/external-chromium_org-third_party-angle_dx11,MSOpenTech/angle-win8.0,shairai/angleproject,RepublicMaster/angleproject,cvsuser-chromium/chromium-third-party_angle_dx11,geekboxzone/lollipop_external_chromium_org_third_party_angle,pombreda/angleproject,RepublicMaster/angleproject,KalebDark/angleproject,cantren/angleproject,pombreda/angleproject,android-ia/platform_external_chromium_org_third_party_angle_dx11,vvuk/angle-old,vvuk/angle-old,ehsan/angle,cantren/angleproject,xuxiandi/angleproject,KTXSoftware/angleproject,geekboxzone/lollipop_external_chromium_org_third_party_angle,cvsuser-chromium/chromium-third-party_angle_dx11,xin3liang/platform_external_chromium_org_third_party_angle,MSOpenTech/angle-win8.0,jgcaaprom/android_external_chromium_org_third_party_angle,xin3liang/platform_external_chromium_org_third_party_angle_dx11,themusicgod1/angleproject,stammen/angleproject,xuxiandi/angleproject,xin3liang/platform_external_chromium_org_third_party_angle_dx11,android-ia/platform_external_chromium_org_third_party_angle_dx11,stammen/angleproject,shairai/angleproject,stammen/angleproject
aa18a176915c652969964763a767b00453655423
source/system/Array.h
source/system/Array.h
#ifndef OOC_ARRAY_H_ #define OOC_ARRAY_H_ #define array_malloc(size) calloc(1, (size)) #define array_free free #include <stdint.h> #define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc((size) * sizeof(type)) }); #if defined(safe) #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index] = value) #else #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[index] = value) #endif #define _lang_array__Array_free(array) { array_free(array.data); } typedef struct { size_t length; void* data; } _lang_array__Array; #endif
#ifndef OOC_ARRAY_H_ #define OOC_ARRAY_H_ #define array_malloc(size) calloc(1, (size)) #define array_free free #include <stdint.h> #define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc((size) * sizeof(type)) }); #if defined(safe) #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[(index < 0 || index >= array.length) ? kean_exception_outOfBoundsException_throw(index, array.length), -1 : index] = value) #else #define _lang_array__Array_get(array, index, type) ( \ ((type*) array.data)[index]) #define _lang_array__Array_set(array, index, type, value) \ (((type*) array.data)[index] = value) #endif #define _lang_array__Array_free(array) { array_free(array.data); array.data = NULL; array.length = 0; } typedef struct { size_t length; void* data; } _lang_array__Array; #endif
Set pointer to array data to null after free
Set pointer to array data to null after free
C
mit
firog/ooc-kean,magic-lang/ooc-kean,thomasfanell/ooc-kean,simonmika/ooc-kean,simonmika/ooc-kean,sebastianbaginski/ooc-kean,sebastianbaginski/ooc-kean,thomasfanell/ooc-kean,fredrikbryntesson/ooc-kean,firog/ooc-kean,fredrikbryntesson/ooc-kean,magic-lang/ooc-kean
a7074f2fe3c4f0eac5efb79ea6896319038dbe9f
test/asan/TestCases/printf-4.c
test/asan/TestCases/printf-4.c
// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: sprintf is not intercepted on Windows yet. // XFAIL: win32 #include <stdio.h> int main() { volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; volatile char buf[2]; fputs(stderr, "before sprintf"); sprintf((char *)buf, "%c %d %.3f %s\n", c, x, f, s); fputs(stderr, "after sprintf"); fputs(stderr, (const char *)buf); return 0; // Check that size of output buffer is sanitized. // CHECK-ON: before sprintf // CHECK-ON-NOT: after sprintf // CHECK-ON: stack-buffer-overflow // CHECK-ON-NOT: 0 12 1.239 34 }
// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: sprintf is not intercepted on Windows yet. // XFAIL: win32 #include <stdio.h> int main() { volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; volatile char buf[2]; fputs("before sprintf\n", stderr); sprintf((char *)buf, "%c %d %.3f %s\n", c, x, f, s); fputs("after sprintf", stderr); fputs((const char *)buf, stderr); return 0; // Check that size of output buffer is sanitized. // CHECK-ON: before sprintf // CHECK-ON-NOT: after sprintf // CHECK-ON: stack-buffer-overflow // CHECK-ON-NOT: 0 12 1.239 34 }
Fix order of arguments to fputs
Fix order of arguments to fputs This time actually tested on Linux, where the test is not XFAILed. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@263294 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
24aa328ddab86fd861961b1d68091d334d773d75
slobrok/src/vespa/slobrok/server/reconfigurable_stateserver.h
slobrok/src/vespa/slobrok/server/reconfigurable_stateserver.h
// 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; }; }
// 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; }; }
Adjust forward declarations in slobrok.
Adjust forward declarations in slobrok.
C
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
4fe769ebf1a4a71fb90ac7e37a747aadc07052ea
numpy/core/src/multiarray/convert_datatype.h
numpy/core/src/multiarray/convert_datatype.h
#ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_ #define _NPY_ARRAY_CONVERT_DATATYPE_H_ NPY_NO_EXPORT PyObject * PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran); #endif
#ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_ #define _NPY_ARRAY_CONVERT_DATATYPE_H_ NPY_NO_EXPORT PyObject * PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran); NPY_NO_EXPORT int PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp); NPY_NO_EXPORT PyArray_VectorUnaryFunc * PyArray_GetCastFunc(PyArray_Descr *descr, int type_num); NPY_NO_EXPORT int PyArray_CanCastSafely(int fromtype, int totype); NPY_NO_EXPORT Bool PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to); NPY_NO_EXPORT int PyArray_ObjectType(PyObject *op, int minimum_type); NPY_NO_EXPORT PyArrayObject ** PyArray_ConvertToCommonType(PyObject *op, int *retn); NPY_NO_EXPORT int PyArray_ValidType(int type); #endif
Add API for datatype conversion.
Add API for datatype conversion.
C
bsd-3-clause
rgommers/numpy,WarrenWeckesser/numpy,larsmans/numpy,ssanderson/numpy,numpy/numpy-refactor,rudimeier/numpy,Dapid/numpy,tynn/numpy,ddasilva/numpy,sigma-random/numpy,dimasad/numpy,githubmlai/numpy,skymanaditya1/numpy,BMJHayward/numpy,chatcannon/numpy,numpy/numpy-refactor,Yusa95/numpy,hainm/numpy,ewmoore/numpy,ogrisel/numpy,grlee77/numpy,gmcastil/numpy,NextThought/pypy-numpy,nbeaver/numpy,dwillmer/numpy,empeeu/numpy,leifdenby/numpy,SunghanKim/numpy,nbeaver/numpy,chatcannon/numpy,rajathkumarmp/numpy,andsor/numpy,abalkin/numpy,tynn/numpy,ChanderG/numpy,yiakwy/numpy,Linkid/numpy,numpy/numpy,astrofrog/numpy,jorisvandenbossche/numpy,gmcastil/numpy,Srisai85/numpy,sinhrks/numpy,grlee77/numpy,ssanderson/numpy,jankoslavic/numpy,musically-ut/numpy,rmcgibbo/numpy,mortada/numpy,BabeNovelty/numpy,mingwpy/numpy,jschueller/numpy,mattip/numpy,endolith/numpy,argriffing/numpy,mattip/numpy,mhvk/numpy,WillieMaddox/numpy,jonathanunderwood/numpy,pizzathief/numpy,dch312/numpy,kirillzhuravlev/numpy,mhvk/numpy,dwf/numpy,Srisai85/numpy,jorisvandenbossche/numpy,groutr/numpy,BMJHayward/numpy,ddasilva/numpy,behzadnouri/numpy,pdebuyl/numpy,mattip/numpy,GaZ3ll3/numpy,MaPePeR/numpy,shoyer/numpy,ekalosak/numpy,pizzathief/numpy,felipebetancur/numpy,naritta/numpy,KaelChen/numpy,MichaelAquilina/numpy,mindw/numpy,dwf/numpy,sigma-random/numpy,tdsmith/numpy,Yusa95/numpy,Anwesh43/numpy,madphysicist/numpy,dimasad/numpy,GaZ3ll3/numpy,dimasad/numpy,endolith/numpy,skymanaditya1/numpy,drasmuss/numpy,skymanaditya1/numpy,drasmuss/numpy,CMartelLML/numpy,ViralLeadership/numpy,endolith/numpy,dwf/numpy,dwillmer/numpy,naritta/numpy,ContinuumIO/numpy,ChristopherHogan/numpy,stuarteberg/numpy,njase/numpy,brandon-rhodes/numpy,ESSS/numpy,immerrr/numpy,mortada/numpy,githubmlai/numpy,dato-code/numpy,jakirkham/numpy,WillieMaddox/numpy,rgommers/numpy,musically-ut/numpy,yiakwy/numpy,ahaldane/numpy,naritta/numpy,dimasad/numpy,larsmans/numpy,sigma-random/numpy,astrofrog/numpy,mortada/numpy,dato-code/numpy,sinhrks/numpy,andsor/numpy,pizzathief/numpy,simongibbons/numpy,madphysicist/numpy,stuarteberg/numpy,bmorris3/numpy,pelson/numpy,NextThought/pypy-numpy,Dapid/numpy,nbeaver/numpy,Eric89GXL/numpy,stefanv/numpy,pelson/numpy,seberg/numpy,pizzathief/numpy,trankmichael/numpy,cjermain/numpy,musically-ut/numpy,drasmuss/numpy,argriffing/numpy,kirillzhuravlev/numpy,WillieMaddox/numpy,pelson/numpy,numpy/numpy,SiccarPoint/numpy,ajdawson/numpy,tacaswell/numpy,tynn/numpy,larsmans/numpy,pdebuyl/numpy,sonnyhu/numpy,ogrisel/numpy,naritta/numpy,utke1/numpy,mindw/numpy,grlee77/numpy,moreati/numpy,seberg/numpy,madphysicist/numpy,Srisai85/numpy,MSeifert04/numpy,ContinuumIO/numpy,anntzer/numpy,jakirkham/numpy,MSeifert04/numpy,WarrenWeckesser/numpy,ekalosak/numpy,rudimeier/numpy,rgommers/numpy,abalkin/numpy,chiffa/numpy,bertrand-l/numpy,hainm/numpy,githubmlai/numpy,b-carter/numpy,rhythmsosad/numpy,larsmans/numpy,MichaelAquilina/numpy,dch312/numpy,AustereCuriosity/numpy,immerrr/numpy,argriffing/numpy,rgommers/numpy,embray/numpy,numpy/numpy,bringingheavendown/numpy,dwf/numpy,yiakwy/numpy,joferkington/numpy,CMartelLML/numpy,endolith/numpy,dwillmer/numpy,MSeifert04/numpy,trankmichael/numpy,immerrr/numpy,mwiebe/numpy,bertrand-l/numpy,ChanderG/numpy,grlee77/numpy,sinhrks/numpy,groutr/numpy,madphysicist/numpy,moreati/numpy,hainm/numpy,kirillzhuravlev/numpy,KaelChen/numpy,pbrod/numpy,WarrenWeckesser/numpy,rajathkumarmp/numpy,gfyoung/numpy,skymanaditya1/numpy,ChristopherHogan/numpy,rhythmsosad/numpy,jankoslavic/numpy,skwbc/numpy,matthew-brett/numpy,behzadnouri/numpy,GaZ3ll3/numpy,BabeNovelty/numpy,rhythmsosad/numpy,Yusa95/numpy,simongibbons/numpy,mhvk/numpy,hainm/numpy,pdebuyl/numpy,has2k1/numpy,MSeifert04/numpy,cjermain/numpy,MaPePeR/numpy,Srisai85/numpy,moreati/numpy,trankmichael/numpy,sinhrks/numpy,mwiebe/numpy,GrimDerp/numpy,sigma-random/numpy,Anwesh43/numpy,Anwesh43/numpy,cjermain/numpy,trankmichael/numpy,mathdd/numpy,ekalosak/numpy,stefanv/numpy,numpy/numpy-refactor,SunghanKim/numpy,anntzer/numpy,WarrenWeckesser/numpy,mindw/numpy,rudimeier/numpy,rherault-insa/numpy,anntzer/numpy,gmcastil/numpy,cowlicks/numpy,ChanderG/numpy,njase/numpy,rmcgibbo/numpy,nguyentu1602/numpy,rajathkumarmp/numpy,felipebetancur/numpy,stefanv/numpy,ChanderG/numpy,AustereCuriosity/numpy,chatcannon/numpy,CMartelLML/numpy,andsor/numpy,ChristopherHogan/numpy,ahaldane/numpy,numpy/numpy-refactor,AustereCuriosity/numpy,joferkington/numpy,pyparallel/numpy,SiccarPoint/numpy,groutr/numpy,has2k1/numpy,njase/numpy,leifdenby/numpy,embray/numpy,simongibbons/numpy,astrofrog/numpy,pbrod/numpy,Anwesh43/numpy,bringingheavendown/numpy,jakirkham/numpy,mingwpy/numpy,bertrand-l/numpy,cowlicks/numpy,mingwpy/numpy,GaZ3ll3/numpy,joferkington/numpy,astrofrog/numpy,ahaldane/numpy,Linkid/numpy,kiwifb/numpy,solarjoe/numpy,BMJHayward/numpy,mathdd/numpy,seberg/numpy,tacaswell/numpy,grlee77/numpy,skwbc/numpy,maniteja123/numpy,KaelChen/numpy,ajdawson/numpy,NextThought/pypy-numpy,pbrod/numpy,solarjoe/numpy,Dapid/numpy,simongibbons/numpy,ahaldane/numpy,ewmoore/numpy,matthew-brett/numpy,brandon-rhodes/numpy,mattip/numpy,Linkid/numpy,Yusa95/numpy,dato-code/numpy,cowlicks/numpy,jschueller/numpy,jankoslavic/numpy,nguyentu1602/numpy,jorisvandenbossche/numpy,ViralLeadership/numpy,Eric89GXL/numpy,githubmlai/numpy,immerrr/numpy,behzadnouri/numpy,mwiebe/numpy,NextThought/pypy-numpy,SunghanKim/numpy,charris/numpy,bmorris3/numpy,bringingheavendown/numpy,has2k1/numpy,pbrod/numpy,has2k1/numpy,nguyentu1602/numpy,anntzer/numpy,MSeifert04/numpy,jorisvandenbossche/numpy,empeeu/numpy,shoyer/numpy,shoyer/numpy,nguyentu1602/numpy,musically-ut/numpy,solarjoe/numpy,GrimDerp/numpy,rhythmsosad/numpy,charris/numpy,dwillmer/numpy,seberg/numpy,ogrisel/numpy,ESSS/numpy,MaPePeR/numpy,rmcgibbo/numpy,SiccarPoint/numpy,pyparallel/numpy,Eric89GXL/numpy,stefanv/numpy,ewmoore/numpy,maniteja123/numpy,tacaswell/numpy,jankoslavic/numpy,matthew-brett/numpy,jakirkham/numpy,MichaelAquilina/numpy,mhvk/numpy,jschueller/numpy,matthew-brett/numpy,rherault-insa/numpy,ewmoore/numpy,joferkington/numpy,mathdd/numpy,matthew-brett/numpy,pyparallel/numpy,ESSS/numpy,numpy/numpy-refactor,pdebuyl/numpy,embray/numpy,kirillzhuravlev/numpy,shoyer/numpy,KaelChen/numpy,ViralLeadership/numpy,rudimeier/numpy,jorisvandenbossche/numpy,ajdawson/numpy,madphysicist/numpy,sonnyhu/numpy,mingwpy/numpy,numpy/numpy,ogrisel/numpy,bmorris3/numpy,mindw/numpy,sonnyhu/numpy,charris/numpy,dch312/numpy,ChristopherHogan/numpy,dch312/numpy,charris/numpy,tdsmith/numpy,astrofrog/numpy,simongibbons/numpy,rherault-insa/numpy,bmorris3/numpy,shoyer/numpy,b-carter/numpy,mortada/numpy,sonnyhu/numpy,rmcgibbo/numpy,tdsmith/numpy,dwf/numpy,utke1/numpy,andsor/numpy,embray/numpy,kiwifb/numpy,Eric89GXL/numpy,jakirkham/numpy,Linkid/numpy,felipebetancur/numpy,pelson/numpy,ddasilva/numpy,gfyoung/numpy,ajdawson/numpy,pizzathief/numpy,MichaelAquilina/numpy,MaPePeR/numpy,GrimDerp/numpy,ogrisel/numpy,leifdenby/numpy,pbrod/numpy,WarrenWeckesser/numpy,chiffa/numpy,stuarteberg/numpy,GrimDerp/numpy,SunghanKim/numpy,kiwifb/numpy,ekalosak/numpy,ssanderson/numpy,jschueller/numpy,b-carter/numpy,empeeu/numpy,embray/numpy,brandon-rhodes/numpy,SiccarPoint/numpy,jonathanunderwood/numpy,rajathkumarmp/numpy,mhvk/numpy,stefanv/numpy,abalkin/numpy,cowlicks/numpy,mathdd/numpy,CMartelLML/numpy,skwbc/numpy,tdsmith/numpy,gfyoung/numpy,pelson/numpy,dato-code/numpy,brandon-rhodes/numpy,maniteja123/numpy,cjermain/numpy,stuarteberg/numpy,jonathanunderwood/numpy,ContinuumIO/numpy,utke1/numpy,yiakwy/numpy,ewmoore/numpy,BabeNovelty/numpy,empeeu/numpy,chiffa/numpy,felipebetancur/numpy,BabeNovelty/numpy,ahaldane/numpy,BMJHayward/numpy
05375b10cfd6e060242c9786fb7887dcd3850ebc
Wangscape/noise/module/codecs/NoiseQualityCodec.h
Wangscape/noise/module/codecs/NoiseQualityCodec.h
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> namespace spotify { namespace json { template<> struct default_codec_t<noise::NoiseQuality> { using NoiseQuality = noise::NoiseQuality; static codec::enumeration_t<NoiseQuality, codec::string_t> codec() { auto codec = codec::enumeration<NoiseQuality, std::string>({ {NoiseQuality::QUALITY_FAST, "Fast"}, {NoiseQuality::QUALITY_STD, "Standard"}, {NoiseQuality::QUALITY_BEST, "Best"} }); return codec; } }; } }
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> namespace spotify { namespace json { template<> struct default_codec_t<noise::NoiseQuality> { using NoiseQuality = noise::NoiseQuality; static codec::one_of_t< codec::enumeration_t<NoiseQuality, codec::number_t<int>>, codec::enumeration_t<NoiseQuality, codec::string_t>> codec() { auto codec_str = codec::enumeration<NoiseQuality, std::string>({ {NoiseQuality::QUALITY_FAST, "Fast"}, {NoiseQuality::QUALITY_STD, "Standard"}, {NoiseQuality::QUALITY_BEST, "Best"} }); auto codec_int = codec::enumeration<NoiseQuality, int>({ {NoiseQuality::QUALITY_FAST, 0}, {NoiseQuality::QUALITY_STD, 1}, {NoiseQuality::QUALITY_BEST, 2} }); return codec::one_of(codec_int, codec_str); } }; } }
Allow specification of NoiseQuality with an int
Allow specification of NoiseQuality with an int
C
mit
Wangscape/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape,serin-delaunay/Wangscape
23439b2341320a973b1c135abc541236de6550bf
hack_malloc.c
hack_malloc.c
#define _GNU_SOURCE #include <stdio.h> #include <stddef.h> #include <unistd.h> #include <sys/mman.h> void* malloc(size_t size) { printf("malloc... "); size += sizeof(size_t); int page_size = getpagesize(); int rem = size % page_size; if (rem > 0) { size += page_size - rem; } void* addr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); if (addr == MAP_FAILED) { printf("fail\n"); return NULL; } printf("ok\n"); *(size_t*)addr = size; return (size_t*)addr + 1; } void free (void *ptr) { printf("free... "); size_t* real_ptr = (size_t*)ptr - 1; if (!munmap(real_ptr, *real_ptr)) { printf("ok\n"); } else { printf("fail\n"); } }
#define _GNU_SOURCE #include <stdio.h> #include <stddef.h> #include <unistd.h> #include <sys/mman.h> void* malloc(size_t size) { write(STDOUT_FILENO, "malloc... ", 10); size += sizeof(size_t); int page_size = getpagesize(); int rem = size % page_size; if (rem > 0) { size += page_size - rem; } void* addr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); if (addr == MAP_FAILED) { write(STDOUT_FILENO, "fail\n", 5); return NULL; } write(STDOUT_FILENO, "ok\n", 3); *(size_t*)addr = size; return (size_t*)addr + 1; } void free (void *ptr) { write(STDOUT_FILENO, "free... ", 8); size_t* real_ptr = (size_t*)ptr - 1; if (!munmap(real_ptr, *real_ptr)) { write(STDOUT_FILENO, "ok\n", 3); } else { write(STDOUT_FILENO, "fail\n", 5); } }
Replace printf with safe write to stdout
Replace printf with safe write to stdout
C
mit
vmarkovtsev/hack_malloc,vmarkovtsev/hack_malloc
885f4c45b69e79b59acd437fd14d7243e5c55d73
blaze/util/Misalignment.h
blaze/util/Misalignment.h
//================================================================================================= /*! // \file blaze/util/Misalignment.h // \brief Header file for the misalignment function // // Copyright (C) 2013 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group 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 _BLAZE_UTIL_MISALIGNMENT_H_ #define _BLAZE_UTIL_MISALIGNMENT_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/system/Inline.h> #include <blaze/util/Types.h> #include <blaze/util/typetraits/AlignmentOf.h> namespace blaze { //================================================================================================= // // SIZETRAIT CLASS DEFINITION // //================================================================================================= //************************************************************************************************* /*!\brief Computes the misalignment of the given address. // \ingroup util // // \param address The address to be checked. // \return The number of bytes the given address is misaligned. // // This function computes the misalignment of the given address with respect to the given data // type \a Type and the available instruction set (SSE, AVX, ...). It returns the number of bytes // the address is larger than the next smaller properly aligned address. */ template< typename T > BLAZE_ALWAYS_INLINE size_t misalignment( const T* address ) { return ( reinterpret_cast<size_t>( address ) % AlignmentOf<T>::value ); } //************************************************************************************************* } // namespace blaze #endif
Add the 'misalignment' utitlity function
Add the 'misalignment' utitlity function
C
bsd-3-clause
byzhang/blaze,byzhang/blaze,byzhang/blaze
500af378f68af6e6438ad7375d933b0b788e8142
src/plugins/test_swap.c
src/plugins/test_swap.c
#include <glib/gprintf.h> int main (int argc, char **argv) { gboolean succ = FALSE; gchar *err_msg = NULL; succ = bd_swap_mkswap ("/dev/xd1", "SWAP", &err_msg); if (succ) puts ("Succeded."); else g_printf ("Not succeded: %s\n", err_msg); succ = bd_swap_swapon ("/dev/xd1", 5, &err_msg); if (succ) puts ("Succeded."); else g_printf ("Not succeded: %s\n", err_msg); return 0; }
#include <glib/gprintf.h> int main (int argc, char **argv) { gboolean succ = FALSE; gchar *err_msg = NULL; succ = bd_swap_mkswap ("/dev/xd1", "SWAP", &err_msg); if (succ) puts ("Succeded."); else g_printf ("Not succeded: %s", err_msg); succ = bd_swap_swapon ("/dev/xd1", 5, &err_msg); if (succ) puts ("Succeded."); else g_printf ("Not succeded: %s", err_msg); return 0; }
Remove newlines from the swap test outputs
Remove newlines from the swap test outputs They are already included in the utility's output.
C
lgpl-2.1
atodorov/libblockdev,snbueno/libblockdev,rhinstaller/libblockdev,atodorov/libblockdev,atodorov/libblockdev,vpodzime/libblockdev,dashea/libblockdev,rhinstaller/libblockdev,rhinstaller/libblockdev,snbueno/libblockdev,vpodzime/libblockdev,vpodzime/libblockdev,dashea/libblockdev
41b1df604617bdde59bb722b9247c16fa4677d94
lib/memzip/lexermemzip.c
lib/memzip/lexermemzip.c
#include <stdlib.h> #include "py/lexer.h" #include "memzip.h" mp_lexer_t *mp_lexer_new_from_file(const char *filename) { void *data; size_t len; if (memzip_locate(filename, &data, &len) != MZ_OK) { return NULL; } return mp_lexer_new_from_str_len(qstr_from_str(filename), (const char *)data, (mp_uint_t)len, 0); }
#include <stdlib.h> #include "py/lexer.h" #include "py/runtime.h" #include "py/mperrno.h" #include "memzip.h" mp_lexer_t *mp_lexer_new_from_file(const char *filename) { void *data; size_t len; if (memzip_locate(filename, &data, &len) != MZ_OK) { mp_raise_OSError(MP_ENOENT); } return mp_lexer_new_from_str_len(qstr_from_str(filename), (const char *)data, (mp_uint_t)len, 0); }
Make lexer constructor raise exception when file not found.
lib/memzip: Make lexer constructor raise exception when file not found.
C
mit
blazewicz/micropython,cwyark/micropython,infinnovation/micropython,selste/micropython,cwyark/micropython,bvernoux/micropython,PappaPeppar/micropython,pozetroninc/micropython,chrisdearman/micropython,henriknelson/micropython,AriZuu/micropython,MrSurly/micropython,micropython/micropython-esp32,torwag/micropython,Peetz0r/micropython-esp32,MrSurly/micropython-esp32,pramasoul/micropython,alex-robbins/micropython,deshipu/micropython,toolmacher/micropython,adafruit/circuitpython,deshipu/micropython,adafruit/circuitpython,adafruit/circuitpython,hiway/micropython,ryannathans/micropython,selste/micropython,adafruit/circuitpython,infinnovation/micropython,dmazzella/micropython,toolmacher/micropython,HenrikSolver/micropython,adafruit/circuitpython,tobbad/micropython,oopy/micropython,MrSurly/micropython-esp32,MrSurly/micropython-esp32,Peetz0r/micropython-esp32,adafruit/micropython,micropython/micropython-esp32,torwag/micropython,henriknelson/micropython,AriZuu/micropython,kerneltask/micropython,micropython/micropython-esp32,pozetroninc/micropython,toolmacher/micropython,torwag/micropython,HenrikSolver/micropython,AriZuu/micropython,swegener/micropython,lowRISC/micropython,alex-robbins/micropython,bvernoux/micropython,swegener/micropython,HenrikSolver/micropython,SHA2017-badge/micropython-esp32,pramasoul/micropython,chrisdearman/micropython,micropython/micropython-esp32,deshipu/micropython,kerneltask/micropython,puuu/micropython,AriZuu/micropython,tralamazza/micropython,alex-robbins/micropython,infinnovation/micropython,torwag/micropython,selste/micropython,henriknelson/micropython,trezor/micropython,oopy/micropython,pfalcon/micropython,puuu/micropython,Peetz0r/micropython-esp32,alex-robbins/micropython,oopy/micropython,AriZuu/micropython,puuu/micropython,cwyark/micropython,blazewicz/micropython,henriknelson/micropython,hiway/micropython,adafruit/micropython,trezor/micropython,PappaPeppar/micropython,hiway/micropython,TDAbboud/micropython,swegener/micropython,Timmenem/micropython,PappaPeppar/micropython,infinnovation/micropython,SHA2017-badge/micropython-esp32,MrSurly/micropython,pfalcon/micropython,infinnovation/micropython,trezor/micropython,pfalcon/micropython,Peetz0r/micropython-esp32,Timmenem/micropython,trezor/micropython,tralamazza/micropython,swegener/micropython,blazewicz/micropython,ryannathans/micropython,SHA2017-badge/micropython-esp32,micropython/micropython-esp32,kerneltask/micropython,SHA2017-badge/micropython-esp32,TDAbboud/micropython,lowRISC/micropython,adafruit/circuitpython,pozetroninc/micropython,adafruit/micropython,ryannathans/micropython,lowRISC/micropython,tobbad/micropython,pramasoul/micropython,bvernoux/micropython,MrSurly/micropython-esp32,kerneltask/micropython,adafruit/micropython,bvernoux/micropython,Timmenem/micropython,tralamazza/micropython,selste/micropython,puuu/micropython,deshipu/micropython,MrSurly/micropython,hiway/micropython,blazewicz/micropython,dmazzella/micropython,torwag/micropython,Timmenem/micropython,TDAbboud/micropython,swegener/micropython,tobbad/micropython,pfalcon/micropython,kerneltask/micropython,Peetz0r/micropython-esp32,chrisdearman/micropython,TDAbboud/micropython,MrSurly/micropython,cwyark/micropython,SHA2017-badge/micropython-esp32,oopy/micropython,pfalcon/micropython,hiway/micropython,HenrikSolver/micropython,ryannathans/micropython,henriknelson/micropython,lowRISC/micropython,PappaPeppar/micropython,chrisdearman/micropython,toolmacher/micropython,lowRISC/micropython,pozetroninc/micropython,pozetroninc/micropython,blazewicz/micropython,MrSurly/micropython,ryannathans/micropython,pramasoul/micropython,toolmacher/micropython,puuu/micropython,chrisdearman/micropython,tobbad/micropython,deshipu/micropython,pramasoul/micropython,TDAbboud/micropython,trezor/micropython,PappaPeppar/micropython,HenrikSolver/micropython,dmazzella/micropython,MrSurly/micropython-esp32,dmazzella/micropython,oopy/micropython,cwyark/micropython,Timmenem/micropython,alex-robbins/micropython,selste/micropython,bvernoux/micropython,tralamazza/micropython,adafruit/micropython,tobbad/micropython
67d9df24bf6ac9d6a3397971605cb563fb35c54d
src/roman_convert_to_int.c
src/roman_convert_to_int.c
#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; }
#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; }
Use cluster iterator in to_int function
Use cluster iterator in to_int function
C
mit
greghaskins/roman-calculator.c
2c0f601424bb82be02e2334c54b2b6ccb0cae9bc
Wangscape/codecs/OptionsCodec.h
Wangscape/codecs/OptionsCodec.h
#pragma once #include <spotify/json.hpp> #include "Options.h" #include "metaoutput/codecs/FilenamesCodec.h" #include "TerrainSpecCodec.h" #include "TileFormatCodec.h" using namespace spotify::json::codec; namespace spotify { namespace json { template<> struct default_codec_t<Options> { static object_t<Options> codec() { auto codec = object<Options>(); codec.required("OutputDirectory", &Options::outputDirectory); codec.required("Terrains", &Options::terrains); codec.required("TileFormat", &Options::tileFormat); codec.required("Cliques", &Options::cliques); codec.required("MetaOutput", &Options::outputFilenames); codec.required("CalculatorMode", &Options::CalculatorMode, codec::enumeration<tilegen::alpha::CalculatorMode, std::string>({ {tilegen::alpha::CalculatorMode::Max, "Max"}, {tilegen::alpha::CalculatorMode::Linear, "Linear"}})); return codec; } }; } }
#pragma once #include <spotify/json.hpp> #include "Options.h" #include "metaoutput/codecs/FilenamesCodec.h" #include "TerrainSpecCodec.h" #include "TileFormatCodec.h" using namespace spotify::json::codec; namespace spotify { namespace json { template<> struct default_codec_t<Options> { static object_t<Options> codec() { auto codec = object<Options>(); codec.required("OutputDirectory", &Options::outputDirectory); codec.required("Terrains", &Options::terrains); codec.required("TileFormat", &Options::tileFormat); codec.required("Cliques", &Options::cliques); codec.required("MetaOutput", &Options::outputFilenames); codec.required("AlphaCalculatorMode", &Options::CalculatorMode, codec::enumeration<tilegen::alpha::CalculatorMode, std::string>({ {tilegen::alpha::CalculatorMode::Max, "Max"}, {tilegen::alpha::CalculatorMode::Linear, "Linear"}})); return codec; } }; } }
Revert to AlphaCalculatorMode in options codec
Revert to AlphaCalculatorMode in options codec
C
mit
Wangscape/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape
6dee7b6820ee89ef41561a005645f0ecda59c2ea
kernel/port/data.c
kernel/port/data.c
#include <stddef.h> #include <kernel/port/data.h> void enq(Queue *q, List *item) { item->next = NULL; if(!q->tail) { q->head = item; q->tail = item; } else { q->tail->next = item; } } List *deq(Queue *q) { if(!q->head) { return NULL; } List *ret = q->head; q->head = q->head->next; if(!q->head) { q->tail = NULL; } ret->next = NULL; return ret; }
#include <stddef.h> #include <kernel/port/data.h> void enq(Queue *q, List *item) { item->next = NULL; if(!q->tail) { q->head = item; q->tail = item; } else { q->tail->next = item; q->tail = item; } } List *deq(Queue *q) { if(!q->head) { return NULL; } List *ret = q->head; q->head = q->head->next; if(!q->head) { q->tail = NULL; } ret->next = NULL; return ret; }
Fix a bug in the queue implementation
Fix a bug in the queue implementation Unfortunately this was not the problem with the scheduler. For some reason we're never getting a second timer interrupt.
C
isc
zenhack/zero,zenhack/zero,zenhack/zero
b58c6841e09d91905747830d2d4471f55392765d
libevmjit/CompilerHelper.h
libevmjit/CompilerHelper.h
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelper(llvm::IRBuilder<>& _builder); CompilerHelper(const CompilerHelper&) = delete; CompilerHelper& operator=(CompilerHelper) = delete; /// Reference to the IR module being compiled llvm::Module* getModule(); /// Reference to the main module function llvm::Function* getMainFunction(); /// Reference to parent compiler IR builder llvm::IRBuilder<>& m_builder; llvm::IRBuilder<>& getBuilder() { return m_builder; } llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args); friend class RuntimeHelper; }; /// Compiler helper that depends on runtime data class RuntimeHelper : public CompilerHelper { protected: RuntimeHelper(RuntimeManager& _runtimeManager); RuntimeManager& getRuntimeManager() { return m_runtimeManager; } private: RuntimeManager& m_runtimeManager; }; using InsertPointGuard = llvm::IRBuilderBase::InsertPointGuard; } } }
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelper(llvm::IRBuilder<>& _builder); CompilerHelper(const CompilerHelper&) = delete; CompilerHelper& operator=(CompilerHelper) = delete; /// Reference to the IR module being compiled llvm::Module* getModule(); /// Reference to the main module function llvm::Function* getMainFunction(); /// Reference to parent compiler IR builder llvm::IRBuilder<>& m_builder; llvm::IRBuilder<>& getBuilder() { return m_builder; } llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args); friend class RuntimeHelper; }; /// Compiler helper that depends on runtime data class RuntimeHelper : public CompilerHelper { protected: RuntimeHelper(RuntimeManager& _runtimeManager); RuntimeManager& getRuntimeManager() { return m_runtimeManager; } private: RuntimeManager& m_runtimeManager; }; struct InsertPointGuard { explicit InsertPointGuard(llvm::IRBuilderBase& _builder): m_builder(_builder), m_insertPoint(_builder.saveIP()) {} ~InsertPointGuard() { m_builder.restoreIP(m_insertPoint); } private: llvm::IRBuilderBase& m_builder; decltype(m_builder.saveIP()) m_insertPoint; }; } } }
Reimplement InsertPointGuard to avoid LLVM ABI incompatibility.
Reimplement InsertPointGuard to avoid LLVM ABI incompatibility. In general, the NDEBUG flag should match cpp-ethereum and LLVM builds. But this is hard to satisfy as we usually have one system-wide build of LLVM and different builds of cpp-ethereum. This ABI incompatibility hit OSX only in release builds as LLVM is built by homebrew with assertions by default.
C
mit
ethereum/evmjit,ethereum/evmjit,ethereum/evmjit
f4836c754a5b37064d49220e1be97d46a28b9d8b
include/llvm/Intrinsics.h
include/llvm/Intrinsics.h
//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===// // // This file defines a set of enums which allow processing of intrinsic // functions. Values of these enum types are returned by // Function::getIntrinsicID. // //===----------------------------------------------------------------------===// #ifndef LLVM_INTRINSICS_H #define LLVM_INTRINSICS_H /// LLVMIntrinsic Namespace - This namespace contains an enum with a value for /// every intrinsic/builtin function known by LLVM. These enum values are /// returned by Function::getIntrinsicID(). /// namespace LLVMIntrinsic { enum ID { not_intrinsic = 0, // Must be zero va_start, // Used to represent a va_start call in C va_end, // Used to represent a va_end call in C va_copy, // Used to represent a va_copy call in C setjmp, // Used to represent a setjmp call in C longjmp, // Used to represent a longjmp call in C }; } #endif
//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===// // // This file defines a set of enums which allow processing of intrinsic // functions. Values of these enum types are returned by // Function::getIntrinsicID. // //===----------------------------------------------------------------------===// #ifndef LLVM_INTRINSICS_H #define LLVM_INTRINSICS_H /// LLVMIntrinsic Namespace - This namespace contains an enum with a value for /// every intrinsic/builtin function known by LLVM. These enum values are /// returned by Function::getIntrinsicID(). /// namespace LLVMIntrinsic { enum ID { not_intrinsic = 0, // Must be zero va_start, // Used to represent a va_start call in C va_end, // Used to represent a va_end call in C va_copy, // Used to represent a va_copy call in C setjmp, // Used to represent a setjmp call in C longjmp, // Used to represent a longjmp call in C //===------------------------------------------------------------------===// // This section defines intrinsic functions used to represent Alpha // instructions... // alpha_ctlz, // CTLZ (count leading zero): counts the number of leading // zeros in the given ulong value alpha_cttz, // CTTZ (count trailing zero): counts the number of trailing // zeros in the given ulong value alpha_ctpop, // CTPOP (count population): counts the number of ones in // the given ulong value alpha_umulh, // UMULH (unsigned multiply quadword high): Takes two 64-bit // (ulong) values, and returns the upper 64 bits of their // 128 bit product as a ulong }; } #endif
Add alpha intrinsics, contributed by Rahul Joshi
Add alpha intrinsics, contributed by Rahul Joshi git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@7372 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm
68c4d8ab89f17d621f69786cbb751976afce72f4
lib/assert2.h
lib/assert2.h
#pragma once #include <cassert> #include <string> #define assert2(expr, str) \ ((expr) \ ? __ASSERT_VOID_CAST (0)\ : __assert_fail ((std::string(__STRING(expr)) + "; " + (str)).c_str(), __FILE__, __LINE__, __ASSERT_FUNCTION))
#pragma once #include <cassert> #include <string> #if __GNUC__ #define assert2(expr, str) \ ((expr) \ ? __ASSERT_VOID_CAST (0)\ : __assert_fail ((std::string(__STRING(expr)) + "; " + (str)).c_str(), __FILE__, __LINE__, __ASSERT_FUNCTION)) #elif __clang__ #define assert2(expr, str) \ ((expr) \ ? (void)(0)\ : __assert_rtn ((std::string(__STRING(expr)) + "; " + (str)).c_str(), __FILE__, __LINE__, __func__)) #else #define assert2(expr, str) assert(expr) #endif
Work better on various versions of clang.
Work better on various versions of clang.
C
mit
tewalds/morat,yotomyoto/morat,tewalds/morat,tewalds/morat,yotomyoto/morat,yotomyoto/morat
359ce984aa895a88248856bb338f7c5484da1443
crypto/openssh/version.h
crypto/openssh/version.h
/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */ /* $FreeBSD$ */ #ifndef SSH_VERSION #define SSH_VERSION (ssh_version_get()) #define SSH_VERSION_BASE "OpenSSH_3.6.1p1" #define SSH_VERSION_ADDENDUM "FreeBSD-20030423" const char *ssh_version_get(void); void ssh_version_set_addendum(const char *add); #endif /* SSH_VERSION */
/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */ /* $FreeBSD$ */ #ifndef SSH_VERSION #define SSH_VERSION (ssh_version_get()) #define SSH_VERSION_BASE "OpenSSH_3.6.1p1" #define SSH_VERSION_ADDENDUM "FreeBSD-20030916" const char *ssh_version_get(void); void ssh_version_set_addendum(const char *add); #endif /* SSH_VERSION */
Update the OpenSSH addendum string for the buffer handling fix.
Update the OpenSSH addendum string for the buffer handling fix.
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
77a03785213b62287c316cf819430457078f713f
src/condor_ckpt/fcntl.h
src/condor_ckpt/fcntl.h
#if defined(AIX32) && defined(__cplusplus ) # include "fix_gnu_fcntl.h" #elif defined(AIX32) && !defined(__cplusplus ) typedef unsigned short ushort; # include <fcntl.h> #elif defined(ULTRIX42) && defined(__cplusplus ) # include "fix_gnu_fcntl.h" #else # include <fcntl.h> #endif
#if defined(__cplusplus) && !defined(OSF1) /* GNU G++ */ # include "fix_gnu_fcntl.h" #elif defined(AIX32) /* AIX bsdcc */ # typedef unsigned short ushort; # include <fcntl.h> #else /* Everybody else */ # include <fcntl.h> #endif
Make things depend on the compiler (G++, bsdcc, others) rather than on specific platforms.
Make things depend on the compiler (G++, bsdcc, others) rather than on specific platforms.
C
apache-2.0
djw8605/condor,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,bbockelm/condor-network-accounting,neurodebian/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/condor,djw8605/htcondor,djw8605/condor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,neurodebian/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,djw8605/condor,htcondor/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco
3bbe9e5aab0bcd51b95b3f718cb790807931d82b
chrome/browser/extensions/extension_message_handler.h
chrome/browser/extensions/extension_message_handler.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #pragma once #include "content/browser/renderer_host/render_view_host_observer.h" class Profile; struct ExtensionHostMsg_DomMessage_Params; // Filters and dispatches extension-related IPC messages that arrive from // renderer/extension processes. This object is created for renderers and also // ExtensionHost/BackgroundContents. Contrast this with ExtensionTabHelper, // which is only created for TabContents. class ExtensionMessageHandler : public RenderViewHostObserver { public: // |sender| is guaranteed to outlive this object. explicit ExtensionMessageHandler(RenderViewHost* render_view_host); virtual ~ExtensionMessageHandler(); // RenderViewHostObserver overrides. virtual bool OnMessageReceived(const IPC::Message& message); private: // Message handlers. void OnPostMessage(int port_id, const std::string& message); void OnRequest(const ExtensionHostMsg_DomMessage_Params& params); DISALLOW_COPY_AND_ASSIGN(ExtensionMessageHandler); }; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #pragma once #include "content/browser/renderer_host/render_view_host_observer.h" class Profile; struct ExtensionHostMsg_DomMessage_Params; // Filters and dispatches extension-related IPC messages that arrive from // renderers. There is one of these objects for each RenderViewHost in Chrome. // Contrast this with ExtensionTabHelper, which is only created for TabContents. class ExtensionMessageHandler : public RenderViewHostObserver { public: // |sender| is guaranteed to outlive this object. explicit ExtensionMessageHandler(RenderViewHost* render_view_host); virtual ~ExtensionMessageHandler(); // RenderViewHostObserver overrides. virtual bool OnMessageReceived(const IPC::Message& message); private: // Message handlers. void OnPostMessage(int port_id, const std::string& message); void OnRequest(const ExtensionHostMsg_DomMessage_Params& params); DISALLOW_COPY_AND_ASSIGN(ExtensionMessageHandler); }; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_
Clarify class comment for ExtensionMessageHandler.
Clarify class comment for ExtensionMessageHandler. [email protected] git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@82674 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
yitian134/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,ropik/chromium
f978f33427f4f3d5273f5b13b776bfbab9e66f16
ReactiveAlamofire/ReactiveAlamofire.h
ReactiveAlamofire/ReactiveAlamofire.h
// // ReactiveAlamofire.h // ReactiveAlamofire // // Created by Srdan Rasic on 23/04/16. // Copyright © 2016 ReactiveKit. All rights reserved. // //! Project version number for ReactiveAlamofire. FOUNDATION_EXPORT double ReactiveAlamofireVersionNumber; //! Project version string for ReactiveAlamofire. FOUNDATION_EXPORT const unsigned char ReactiveAlamofireVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <ReactiveAlamofire/PublicHeader.h>
// // ReactiveAlamofire.h // ReactiveAlamofire // // Created by Srdan Rasic on 23/04/16. // Copyright © 2016 ReactiveKit. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for ReactiveAlamofire. FOUNDATION_EXPORT double ReactiveAlamofireVersionNumber; //! Project version string for ReactiveAlamofire. FOUNDATION_EXPORT const unsigned char ReactiveAlamofireVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <ReactiveAlamofire/PublicHeader.h>
Use Foundation framework instead of UIKit.
Use Foundation framework instead of UIKit.
C
mit
ReactiveKit/ReactiveAlamofire,ReactiveKit/ReactiveAlamofire
e2971406eb3b2ecdd211b9e7403fa02ae725b115
misc/miscfn.h
misc/miscfn.h
#ifndef H_MISCFN #define H_MISCFN #include "config.h" #if HAVE_FNMATCH_H #include <fnmatch.h> #else #include "misc-fnmatch.h" #endif #if HAVE_GLOB_H #include <glob.h> #else #include "misc-glob.h" #endif #if ! HAVE_S_IFSOCK #define S_IFSOCK (0) #endif #if ! HAVE_S_ISLNK #define S_ISLNK(mode) ((mode) & S_IFLNK) #endif #if ! HAVE_S_ISSOCK #define S_ISSOCK(mode) ((mode) & S_IFSOCK) #endif #if NEED_STRINGS_H #include <strings.h> #endif #if ! HAVE_REALPATH char *realpath(const char *path, char resolved_path []); #endif #if NEED_TIMEZONE #include <sys/stdtypes.h> extern time_t timezone; #endif #if NEED_MYREALLOC #include <sys/stdtypes.h> #define realloc(ptr,size) myrealloc(ptr,size) extern void *myrealloc(void *, size_t); #endif #if HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #endif
#ifndef H_MISCFN #define H_MISCFN #include "config.h" #if HAVE_FNMATCH_H #include <fnmatch.h> #else #include "misc-fnmatch.h" #endif #if HAVE_GLOB_H #include <glob.h> #else #include "misc-glob.h" #endif #if ! HAVE_S_IFSOCK #define S_IFSOCK (0) #endif #if ! HAVE_S_ISLNK #define S_ISLNK(mode) ((mode) & S_IFLNK) #endif #if ! HAVE_S_ISSOCK #define S_ISSOCK(mode) ((mode) & S_IFSOCK) #endif #if NEED_STRINGS_H #include <strings.h> #endif #if ! HAVE_REALPATH char *realpath(const char *path, char resolved_path []); #endif #if NEED_TIMEZONE #include <sys/stdtypes.h> extern time_t timezone; #endif #if NEED_MYREALLOC #include <sys/stdtypes.h> #define realloc(ptr,size) myrealloc(ptr,size) extern void *myrealloc(void *, size_t); #endif #if HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #if HAVE_LIMITS_H #include <limits.h> #endif #endif
Include <limits.h> if it's available.
Include <limits.h> if it's available.
C
lgpl-2.1
devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5
971068ecfa82cea5b21a3ccc962e95b7cdb5f38d
app/tx/main.c
app/tx/main.c
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
Send only one packet at a time.
Send only one packet at a time.
C
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
922128855ca81ca6d5cad13df91eb312e81057b9
GITBlob.h
GITBlob.h
// // GITBlob.h // CocoaGit // // Created by Geoffrey Garside on 29/06/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GITObject.h" @interface GITBlob : GITObject { NSData * data; } #pragma mark - #pragma mark Properties @property(retain) NSData * data; #pragma mark - #pragma mark Init Methods - (id)initWithContentsOfFile:(NSString*)filePath; - (id)initWithData:(NSData*)dataContent; #pragma mark - #pragma mark Instance Methods - (BOOL)write; - (BOOL)writeWithError:(NSError**)errorPtr; @end
// // GITBlob.h // CocoaGit // // Created by Geoffrey Garside on 29/06/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GITObject.h" @interface GITBlob : GITObject { NSData * data; } #pragma mark - #pragma mark Properties @property(retain) NSData * data; #pragma mark - #pragma mark Reading existing Blob objects - (id)initFromHash:(NSString*)objectHash; #pragma mark - #pragma mark Creating new Blob objects - (id)initWithData:(NSData*)dataContent; - (id)initWithContentsOfFile:(NSString*)filePath; #pragma mark - #pragma mark Instance Methods - (BOOL)write; - (BOOL)writeWithError:(NSError**)errorPtr; @end
Add pragmas to differentiate init method types
Add pragmas to differentiate init method types
C
mit
schacon/cocoagit,schacon/cocoagit,geoffgarside/cocoagit,geoffgarside/cocoagit
e9d6b3358ac35901ccc6a4a5a317670fa469db25
arch/arm/include/asm/smp_scu.h
arch/arm/include/asm/smp_scu.h
#ifndef __ASMARM_ARCH_SCU_H #define __ASMARM_ARCH_SCU_H #define SCU_PM_NORMAL 0 #define SCU_PM_DORMANT 2 #define SCU_PM_POWEROFF 3 #ifndef __ASSEMBLER__ unsigned int scu_get_core_count(void __iomem *); void scu_enable(void __iomem *); int scu_power_mode(void __iomem *, unsigned int); #endif #endif
#ifndef __ASMARM_ARCH_SCU_H #define __ASMARM_ARCH_SCU_H #define SCU_PM_NORMAL 0 #define SCU_PM_DORMANT 2 #define SCU_PM_POWEROFF 3 #ifndef __ASSEMBLER__ #include <asm/cputype.h> static inline bool scu_a9_has_base(void) { return read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9; } static inline unsigned long scu_a9_get_base(void) { unsigned long pa; asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa)); return pa; } unsigned int scu_get_core_count(void __iomem *); void scu_enable(void __iomem *); int scu_power_mode(void __iomem *, unsigned int); #endif #endif
Add API to detect SCU base address from CP15
ARM: Add API to detect SCU base address from CP15 Add API to detect SCU base address from CP15. Signed-off-by: Hiroshi Doyu <[email protected]> Acked-by: Russell King <[email protected]> Signed-off-by: Stephen Warren <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas