after
stringlengths
72
2.11k
before
stringlengths
21
1.55k
diff
stringlengths
85
2.31k
instruction
stringlengths
20
1.71k
license
stringclasses
13 values
repos
stringlengths
7
82.6k
commit
stringlengths
40
40
// IBM_PROLOG_BEGIN_TAG // This is an automatically generated prolog. // // $Source: src/include/sys/interrupt.h $ // // IBM CONFIDENTIAL // // COPYRIGHT International Business Machines Corp. 2011 // // p1 // // Object Code Only (OCO) source materials // Licensed Internal Code Source Materials // IBM HostBoot Licensed Internal Code // // The source code for this program is not published or other- // wise divested of its trade secrets, irrespective of what has // been deposited with the U.S. Copyright Office. // // Origin: 30 // // IBM_PROLOG_END #ifndef __INTERRUPT_H #define __INTERRUPT_H extern const char* INTR_MSGQ; /** * INTR constants */ enum { ICPBAR_SCOM_ADDR = 0x020109ca, //!< for P8, P7 = 0x02011C09 // This BAR value agrees with simics (for now) ICPBAR_VAL = 0x03FBFF90, //!< ICPBAR value bits[0:29]>>34 }; #endif
// IBM_PROLOG_BEGIN_TAG // This is an automatically generated prolog. // // $Source: src/include/sys/interrupt.h $ // // IBM CONFIDENTIAL // // COPYRIGHT International Business Machines Corp. 2011 // // p1 // // Object Code Only (OCO) source materials // Licensed Internal Code Source Materials // IBM HostBoot Licensed Internal Code // // The source code for this program is not published or other- // wise divested of its trade secrets, irrespective of what has // been deposited with the U.S. Copyright Office. // // Origin: 30 // // IBM_PROLOG_END #ifndef __INTERRUPT_H #define __INTERRUPT_H extern const char* INTR_MSGQ; /** * INTR constants */ enum { ICPBAR_SCOM_ADDR = 0x020109c9, //!< for P8, P7 = 0x02011C09 // This BAR value agrees with simics (for now) ICPBAR_VAL = 0x03FBFF90, //!< ICPBAR value bits[0:29]>>34 }; #endif
--- +++ @@ -31,7 +31,7 @@ */ enum { - ICPBAR_SCOM_ADDR = 0x020109c9, //!< for P8, P7 = 0x02011C09 + ICPBAR_SCOM_ADDR = 0x020109ca, //!< for P8, P7 = 0x02011C09 // This BAR value agrees with simics (for now) ICPBAR_VAL = 0x03FBFF90, //!< ICPBAR value bits[0:29]>>34 };
Fix IPC BAR scom address Change-Id: Ib3e13d892e58faa12082d6a09a1f6b504af44ae5 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1058 Reviewed-by: Thi N. Tran <25a2bca7ae5a8ea03be09ca8d282480c08c13052@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: Mark W. Wenning <32e1305d9513301b64a3e92b63a7c80399d0fb59@us.ibm.com> Reviewed-by: A. Patrick Williams III <c87e37b1a4035affd737b461af89fb722d635f4d@us.ibm.com>
apache-2.0
Over-enthusiastic/hostboot,csmart/hostboot,Over-enthusiastic/hostboot,csmart/hostboot,alvintpwang/hostboot,Over-enthusiastic/hostboot,open-power/hostboot,alvintpwang/hostboot,open-power/hostboot,alvintpwang/hostboot,Over-enthusiastic/hostboot,Over-enthusiastic/hostboot,alvintpwang/hostboot,open-power/hostboot,open-power/hostboot,csmart/hostboot,alvintpwang/hostboot,open-power/hostboot,csmart/hostboot,csmart/hostboot
70961ee3265e37813c4fb89dfd7a5660ae4b189a
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode)); n->left = NULL; n->right = NULL; n->p = NULL; n->k = k; } void BST_Inorder_Tree_Walk(BSTNode* n, void (f)(void*)) { if (n != NULL) { BST_Inorder_Tree_Walk(n->left, f); f(n->k); BST_Inorder_Tree_Walk(n->right, f); } } void BST_Preorder_Tree_Walk(BSTNode* n, void (f)(void*)) { if (n != NULL) { f(n->k); BST_Preorder_Tree_Walk(n->left, f); BST_Preorder_Tree_Walk(n->right, f); } }
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode)); n->left = NULL; n->right = NULL; n->p = NULL; n->k = k; } void BST_Inorder_Tree_Walk(BSTNode* n, void (f)(void*)) { if (n != NULL) { BST_Inorder_Tree_Walk(n->left, f); f(n->k); BST_Inorder_Tree_Walk(n->right, f); } }
--- +++ @@ -41,3 +41,13 @@ } } +void BST_Preorder_Tree_Walk(BSTNode* n, void (f)(void*)) +{ + if (n != NULL) + { + f(n->k); + BST_Preorder_Tree_Walk(n->left, f); + BST_Preorder_Tree_Walk(n->right, f); + } +} +
Add BST preorder traversal function implementation
mit
MaxLikelihood/CADT
36a0988c4468386c7d52d9c1ff4cc09b615f4bf9
// 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_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #pragma once #include "base/basictypes.h" #include "base/compiler_specific.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" namespace content { class RenderView; } // This class draws the given color on a PageOverlay of a WebView. class WebViewColorOverlay : public WebKit::WebPageOverlay { public: WebViewColorOverlay(content::RenderView* render_view, SkColor color); virtual ~WebViewColorOverlay(); private: // WebKit::WebPageOverlay implementation: virtual void paintPageOverlay(WebKit::WebCanvas* canvas); content::RenderView* render_view_; SkColor color_; DISALLOW_COPY_AND_ASSIGN(WebViewColorOverlay); }; #endif // CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_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_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #pragma once #include "base/basictypes.h" #include "base/compiler_specific.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" namespace content { class RenderView; } // This class draws the given color on a PageOverlay of a WebView. class WebViewColorOverlay : public WebKit::WebPageOverlay { public: WebViewColorOverlay(content::RenderView* render_view, SkColor color); virtual ~WebViewColorOverlay(); private: // WebKit::WebPageOverlay implementation: virtual void paintPageOverlay(WebKit::WebCanvas* canvas); content::RenderView* render_view_; SkColor color_; DISALLOW_COPY_AND_ASSIGN(WebViewColorOverlay); }; #endif // CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
--- +++ @@ -10,7 +10,7 @@ #include "base/compiler_specific.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" namespace content { class RenderView;
Fix build break from the future. TBR=pfeldman Review URL: http://codereview.chromium.org/8801036 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@113098 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,ropik/chromium
4bc83be34066a7a42c6297db983e1d9066e14d3e
#include <stdint.h> void outb(uint16_t port, uint8_t value) { asm volatile ("outb %1, %0" : : "dN" (port), "a" (value)); } unsigned char inb(uint16_t port) { unsigned char ret; asm volatile ("inb %1, %0" : "=a" (ret) : "dN" (port)); return ret; } void outl(uint16_t port, uint32_t value) { asm volatile ("outl %1, %0" : : "dN" (port), "a" (value)); } uint32_t inl(uint16_t port) { uint32_t ret; asm volatile ("inl %1, %0" : "=a" (ret) : "dN" (port)); return ret; }
#include <stdint.h> void outb(uint16_t port, uint8_t value) { asm volatile ("outb %1, %0" : : "dN" (port), "a" (value)); } unsigned char inb(uint16_t port) { unsigned char ret; asm volatile ("inb %1, %0" : "=a" (ret) : "dN" (port)); return ret; }
--- +++ @@ -9,3 +9,13 @@ asm volatile ("inb %1, %0" : "=a" (ret) : "dN" (port)); return ret; } + +void outl(uint16_t port, uint32_t value) { + asm volatile ("outl %1, %0" : : "dN" (port), "a" (value)); +} + +uint32_t inl(uint16_t port) { + uint32_t ret; + asm volatile ("inl %1, %0" : "=a" (ret) : "dN" (port)); + return ret; +}
Add inl and outl functions
mit
simon-andrews/norby,simon-andrews/norby,simon-andrews/norby
342b576de5cc3fd0aad536171d68b414ffc0fc3d
#pragma once //------------------------------------------------------------------------------ /** @class Oryol::Render::PrimitiveType @brief primitive type enum (triangle strips, lists, etc...) */ #include "Core/Types.h" namespace Oryol { namespace Render { class PrimitiveType { public: /// primitive type enum (don't change order, append to end!) enum Code { Points = 0, ///< point list LineStrip, ///< line strip LineLoop, ///< closed line loop Lines, ///< line list TriangleStrip, ///< triangle strip TriangleFan, ///< triangle fan Triangles, ///< triangle list NumPrimitiveTypes, ///< number of primitive types InvalidPrimitiveType, ///< invalid primitive type value }; /// convert to string static const char* ToString(Code c); /// convert from string static Code FromString(const char* str); }; } // namespace Render } // namespace Oryol
#pragma once //------------------------------------------------------------------------------ /** @class Oryol::Render::PrimitiveType @brief primitive type enum (triangle strips, lists, etc...) */ #include "Core/Types.h" namespace Oryol { namespace Render { class PrimitiveType { public: /// primitive type enum enum Code { Points, ///< point list LineStrip, ///< line strip LineLoop, ///< closed line loop Lines, ///< line list TriangleStrip, ///< triangle strip TriangleFan, ///< triangle fan Triangles, ///< triangle list NumPrimitiveTypes, ///< number of primitive types InvalidPrimitiveType, ///< invalid primitive type value }; /// convert to string static const char* ToString(Code c); /// convert from string static Code FromString(const char* str); }; } // namespace Render } // namespace Oryol
--- +++ @@ -11,9 +11,9 @@ class PrimitiveType { public: - /// primitive type enum + /// primitive type enum (don't change order, append to end!) enum Code { - Points, ///< point list + Points = 0, ///< point list LineStrip, ///< line strip LineLoop, ///< closed line loop Lines, ///< line list
Make sure primitive type enum starts at 0
mit
tempbottle/oryol,ejkoy/oryol,tempbottle/oryol,ejkoy/oryol,mgerhardy/oryol,tempbottle/oryol,code-disaster/oryol,wangscript/oryol,mgerhardy/oryol,waywardmonkeys/oryol,xfxdev/oryol,mgerhardy/oryol,xfxdev/oryol,wangscript/oryol,bradparks/oryol,zhakui/oryol,waywardmonkeys/oryol,code-disaster/oryol,aonorin/oryol,mgerhardy/oryol,ejkoy/oryol,xfxdev/oryol,code-disaster/oryol,aonorin/oryol,bradparks/oryol,ejkoy/oryol,floooh/oryol,floooh/oryol,ejkoy/oryol,wangscript/oryol,bradparks/oryol,zhakui/oryol,bradparks/oryol,ejkoy/oryol,wangscript/oryol,xfxdev/oryol,zhakui/oryol,zhakui/oryol,aonorin/oryol,waywardmonkeys/oryol,code-disaster/oryol,aonorin/oryol,wangscript/oryol,waywardmonkeys/oryol,waywardmonkeys/oryol,bradparks/oryol,floooh/oryol,aonorin/oryol,code-disaster/oryol,mgerhardy/oryol,tempbottle/oryol,aonorin/oryol,tempbottle/oryol,floooh/oryol,xfxdev/oryol,wangscript/oryol,floooh/oryol,tempbottle/oryol,bradparks/oryol,bradparks/oryol,code-disaster/oryol,tempbottle/oryol,waywardmonkeys/oryol,wangscript/oryol,xfxdev/oryol,code-disaster/oryol,aonorin/oryol,ejkoy/oryol,xfxdev/oryol,floooh/oryol,zhakui/oryol,mgerhardy/oryol,zhakui/oryol,zhakui/oryol,mgerhardy/oryol,waywardmonkeys/oryol
dff6ed304ba6c58a273d234384ca12fd59f03b86
#ifndef DICT_H_ #define DICT_H_ #include <cassert> #include <cstring> #include <tr1/unordered_map> #include <string> #include <vector> #include <boost/functional/hash.hpp> #include "wordid.h" class Dict { typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map; public: Dict() : b0_("<bad0>") { words_.reserve(1000); } inline int max() const { return words_.size(); } inline WordID Convert(const std::string& word, bool frozen = false) { Map::iterator i = d_.find(word); if (i == d_.end()) { if (frozen) return 0; words_.push_back(word); d_[word] = words_.size(); return words_.size(); } else { return i->second; } } inline WordID Convert(const std::vector<std::string>& words, bool frozen = false) { std::string word= ""; for (std::vector<std::string>::const_iterator it=words.begin(); it != words.end(); ++it) { if (it != words.begin()) word += "__"; word += *it; } return Convert(word, frozen); } inline const std::string& Convert(const WordID& id) const { if (id == 0) return b0_; assert(id <= words_.size()); return words_[id-1]; } void clear() { words_.clear(); d_.clear(); } private: const std::string b0_; std::vector<std::string> words_; Map d_; }; #endif
#ifndef DICT_H_ #define DICT_H_ #include <cassert> #include <cstring> #include <tr1/unordered_map> #include <string> #include <vector> #include <boost/functional/hash.hpp> #include "wordid.h" class Dict { typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map; public: Dict() : b0_("<bad0>") { words_.reserve(1000); } inline int max() const { return words_.size(); } inline WordID Convert(const std::string& word, bool frozen = false) { Map::iterator i = d_.find(word); if (i == d_.end()) { if (frozen) return 0; words_.push_back(word); d_[word] = words_.size(); return words_.size(); } else { return i->second; } } inline const std::string& Convert(const WordID& id) const { if (id == 0) return b0_; assert(id <= words_.size()); return words_[id-1]; } void clear() { words_.clear(); d_.clear(); } private: const std::string b0_; std::vector<std::string> words_; Map d_; }; #endif
--- +++ @@ -13,9 +13,12 @@ class Dict { typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map; + public: Dict() : b0_("<bad0>") { words_.reserve(1000); } + inline int max() const { return words_.size(); } + inline WordID Convert(const std::string& word, bool frozen = false) { Map::iterator i = d_.find(word); if (i == d_.end()) { @@ -28,12 +31,26 @@ return i->second; } } + + inline WordID Convert(const std::vector<std::string>& words, bool frozen = false) { + std::string word= ""; + for (std::vector<std::string>::const_iterator it=words.begin(); + it != words.end(); ++it) { + if (it != words.begin()) word += "__"; + word += *it; + } + + return Convert(word, frozen); + } + inline const std::string& Convert(const WordID& id) const { if (id == 0) return b0_; assert(id <= words_.size()); return words_[id-1]; } + void clear() { words_.clear(); d_.clear(); } + private: const std::string b0_; std::vector<std::string> words_;
Update utility functions to work with pyp-topics. git-svn-id: 357248c53bdac2d7b36f7ee045286eb205fcf757@49 ec762483-ff6d-05da-a07a-a48fb63a330f
apache-2.0
pks/cdec-dtrain-legacy,kho/mr-cdec,kho/mr-cdec,agesmundo/FasterCubePruning,agesmundo/FasterCubePruning,kho/mr-cdec,agesmundo/FasterCubePruning,pks/cdec-dtrain-legacy,pks/cdec-dtrain-legacy,agesmundo/FasterCubePruning,pks/cdec-dtrain-legacy,agesmundo/FasterCubePruning,kho/mr-cdec,kho/mr-cdec,agesmundo/FasterCubePruning,pks/cdec-dtrain-legacy,kho/mr-cdec,pks/cdec-dtrain-legacy
9705782c98265c05bc87a10b1fb69bd35781c754
#include <stddef.h> #include <kernel/port/heap.h> #include <kernel/port/units.h> #include <kernel/port/stdio.h> #include <kernel/port/panic.h> #include <kernel/arch/lock.h> static mutex_t heap_lock; /* round_up returns `n` rounded to the next value that is zero * modulo `align`. */ static uintptr_t round_up(uintptr_t n, uintptr_t align) { if (n % align) { return n + (align - (n % align)); } return n; } uintptr_t heap_next, heap_end; void heap_init(uintptr_t start, uintptr_t end) { heap_next = start; heap_end = end; } void *kalloc_align(uintptr_t size, uintptr_t alignment) { wait_acquire(&heap_lock); heap_next = round_up(heap_next, alignment); uintptr_t ret = heap_next; heap_next += size; if(heap_next > heap_end) { panic("Out of space!"); } release(&heap_lock); return (void*)ret; } void *kalloc(uintptr_t size) { return kalloc_align(size, sizeof(uintptr_t)); } void kfree(void *ptr, uintptr_t size) { }
#include <stddef.h> #include <kernel/port/heap.h> #include <kernel/port/units.h> #include <kernel/port/stdio.h> #include <kernel/port/panic.h> /* round_up returns `n` rounded to the next value that is zero * modulo `align`. */ static uintptr_t round_up(uintptr_t n, uintptr_t align) { if (n % align) { return n + (align - (n % align)); } return n; } uintptr_t heap_next, heap_end; void heap_init(uintptr_t start, uintptr_t end) { heap_next = start; heap_end = end; } void *kalloc_align(uintptr_t size, uintptr_t alignment) { heap_next = round_up(heap_next, alignment); uintptr_t ret = heap_next; heap_next += size; if(heap_next > heap_end) { panic("Out of space!"); } return (void*)ret; } void *kalloc(uintptr_t size) { return kalloc_align(size, sizeof(uintptr_t)); } void kfree(void *ptr, uintptr_t size) { }
--- +++ @@ -3,6 +3,9 @@ #include <kernel/port/units.h> #include <kernel/port/stdio.h> #include <kernel/port/panic.h> +#include <kernel/arch/lock.h> + +static mutex_t heap_lock; /* round_up returns `n` rounded to the next value that is zero * modulo `align`. */ @@ -21,12 +24,14 @@ } void *kalloc_align(uintptr_t size, uintptr_t alignment) { + wait_acquire(&heap_lock); heap_next = round_up(heap_next, alignment); uintptr_t ret = heap_next; heap_next += size; if(heap_next > heap_end) { panic("Out of space!"); } + release(&heap_lock); return (void*)ret; }
Put a lock around kalloc*
isc
zenhack/zero,zenhack/zero,zenhack/zero
d45a05e3563085b8131f3a84c4f3b16c3fab7908
#pragma once #include <istream> #include <memory> #include <vector> #include "types.h" #include "mbc.h" class Cartridge { const static size_t max_rom_size = 0x400000; // 4 MB std::vector<u8> rom; std::vector<u8> ram; std::unique_ptr<MemoryBankController> mbc; public: Cartridge() : rom(max_rom_size), ram(0x20000), mbc(new MBC1(rom, ram)) { } void load_rom(std::istream& src) { src.read(reinterpret_cast<char *>(rom.data()), max_rom_size); } u8 get8(uint address) const { return mbc->get8(address); } void set8(uint address, u8 value) { mbc->set8(address, value); } };
#pragma once #include <istream> #include <memory> #include <vector> #include "types.h" #include "mbc.h" class Cartridge { const static size_t max_rom_size = 0x400000; // 4 MB std::vector<u8> rom; std::vector<u8> ram; std::unique_ptr<MemoryBankController> mbc; public: Cartridge() : rom(max_rom_size), ram(0x2000), mbc(new MBC1(rom, ram)) {} void load_rom(std::istream& src) { src.read(reinterpret_cast<char *>(rom.data()), max_rom_size); } u8 get8(uint address) const { return mbc->get8(address); } void set8(uint address, u8 value) { mbc->set8(address, value); } };
--- +++ @@ -14,7 +14,7 @@ std::unique_ptr<MemoryBankController> mbc; public: - Cartridge() : rom(max_rom_size), ram(0x2000), mbc(new MBC1(rom, ram)) {} + Cartridge() : rom(max_rom_size), ram(0x20000), mbc(new MBC1(rom, ram)) { } void load_rom(std::istream& src) {
Cartridge: Make RAM 128KB - big enough for any game
mit
alastair-robertson/gameboy,alastair-robertson/gameboy,alastair-robertson/gameboy
9c3ee047dd5168c456c6b2fd6674c99b82aa04fe
#ifndef LOG_H #define LOG_H #include "types.h" #include <fstream> class Statement; class Exp; class LocationSet; class RTL; class Log { public: Log() { } virtual Log &operator<<(const char *str) = 0; virtual Log &operator<<(Statement *s); virtual Log &operator<<(Exp *e); virtual Log &operator<<(RTL *r); virtual Log &operator<<(int i); virtual Log &operator<<(char c); virtual Log &operator<<(double d); virtual Log &operator<<(ADDRESS a); virtual Log &operator<<(LocationSet *l); Log &operator<<(std::string& s) {return operator<<(s.c_str());} virtual ~Log() {}; virtual void tail(); }; class FileLogger : public Log { protected: std::ofstream out; public: FileLogger(); // Implemented in boomerang.cpp void tail(); virtual Log &operator<<(const char *str) { out << str << std::flush; return *this; } virtual ~FileLogger() {}; }; // For older MSVC compilers #if defined(_MSC_VER) && (_MSC_VER <= 1200) static std::ostream& operator<<(std::ostream& s, QWord val) { char szTmp[42]; // overkill, but who counts sprintf(szTmp, "%I64u", val); s << szTmp; return s; } #endif #endif
#ifndef LOG_H #define LOG_H #include "types.h" #include <fstream> class Statement; class Exp; class LocationSet; class RTL; class Log { public: Log() { } virtual Log &operator<<(const char *str) = 0; virtual Log &operator<<(Statement *s); virtual Log &operator<<(Exp *e); virtual Log &operator<<(RTL *r); virtual Log &operator<<(int i); virtual Log &operator<<(char c); virtual Log &operator<<(double d); virtual Log &operator<<(ADDRESS a); virtual Log &operator<<(LocationSet *l); Log &operator<<(std::string& s) {return operator<<(s.c_str());} virtual ~Log() {}; virtual void tail(); }; class FileLogger : public Log { protected: std::ofstream out; public: FileLogger(); // Implemented in boomerang.cpp void tail(); virtual Log &operator<<(const char *str) { out << str << std::flush; return *this; } virtual ~FileLogger() {}; }; #endif
--- +++ @@ -41,4 +41,15 @@ virtual ~FileLogger() {}; }; +// For older MSVC compilers +#if defined(_MSC_VER) && (_MSC_VER <= 1200) +static std::ostream& operator<<(std::ostream& s, QWord val) +{ + char szTmp[42]; // overkill, but who counts + sprintf(szTmp, "%I64u", val); + s << szTmp; + return s; +} #endif + +#endif
Fix for older MSVC compilers without operator<< for long longs (not tested on MSVC6)
bsd-3-clause
xujun10110/boomerang,xujun10110/boomerang,nemerle/boomerang,nemerle/boomerang,nemerle/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,nemerle/boomerang,nemerle/boomerang,nemerle/boomerang,nemerle/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,xujun10110/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,xujun10110/boomerang,nemerle/boomerang
020bf65a067d187bdb2dd54a118f7b3f461535a1
#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; }
#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; }
--- +++ @@ -4,7 +4,7 @@ #include "clock_type.h" -extern int clock_init(struct Clock **clockp, struct Allocator *allocator) +extern int clock_init(struct SPDR_Clock **clockp, struct SPDR_Allocator *allocator) { struct timespec res; @@ -16,7 +16,7 @@ return clock_init_base(clockp, allocator, 1, 1000); } -extern uint64_t clock_ticks(struct Clock const *const clock) +extern uint64_t clock_ticks(struct SPDR_Clock const *const clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);
Fix compilation on posix platforms
mit
uucidl/uu.spdr,uucidl/uu.spdr,uucidl/uu.spdr
f4ef4ff9d744adcc8424e6993674b20000c750bf
#ifndef SCHEME_BASIC_TYPES_H #define SCHEME_BASIC_TYPES_H #include "SchemeType.h" extern const SchemeType SchemeBool; extern const SchemeCons *const SchemeBoolTrue; extern const SchemeCons *const SchemeBoolFalse; extern const SchemeType SchemeTuple; extern const SchemeCons *const SchemeTupleTuple; extern const SchemeType SchemeList; extern const SchemeCons *const SchemeListCons; extern const SchemeCons *const SchemeListEmpty; extern const SchemeType SchemeOption; extern const SchemeCons *const SchemeOptionNone; extern const SchemeCons *const SchemeOptionSome; extern const SchemeType SchemeEither; static void SchemeMarshalBool(Scheme *context, bool value) { SchemeObj *val = &context->value; val->hdr.kind = SCHEME_KIND_VAL; val->hdr.variant = value ? SchemeBoolTrue->hdr.variant : SchemeBoolFalse->hdr.variant; val->hdr.size = 0; val->word.type = &SchemeBool; } #endif /* !SCHEME_BASIC_TYPES_H */
#ifndef SCHEME_BASIC_TYPES_H #define SCHEME_BASIC_TYPES_H #include "SchemeType.h" extern const SchemeType SchemeBool; extern const SchemeCons *const SchemeBoolTrue; extern const SchemeCons *const SchemeBoolFalse; extern const SchemeType SchemeTuple; extern const SchemeCons *const SchemeTupleTuple; extern const SchemeType SchemeList; extern const SchemeCons *const SchemeListCons; extern const SchemeCons *const SchemeListEmpty; extern const SchemeType SchemeOption; extern const SchemeCons *const SchemeOptionNone; extern const SchemeCons *const SchemeOptionSome; extern const SchemeType SchemeEither; #endif /* !SCHEME_BASIC_TYPES_H */
--- +++ @@ -16,4 +16,16 @@ extern const SchemeCons *const SchemeOptionSome; extern const SchemeType SchemeEither; +static void +SchemeMarshalBool(Scheme *context, bool value) +{ + SchemeObj *val = &context->value; + val->hdr.kind = SCHEME_KIND_VAL; + val->hdr.variant = value ? + SchemeBoolTrue->hdr.variant : SchemeBoolFalse->hdr.variant; + val->hdr.size = 0; + val->word.type = &SchemeBool; +} + + #endif /* !SCHEME_BASIC_TYPES_H */
Add function for marshaling C booleans into Scheme.
mit
bassettmb/scheme
5cef25695718f2bbb2505ff63f1d2557d9429fcf
// SKIP PARAM: --enable ana.int.interval --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none // This is part of 34-localization, but also symlinked to 36-apron. // ALSO: --enable ana.int.interval --set solver slr3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none // Example from Halbwachs-Henry, SAS 2012 // Localized widening or restart policy should be able to prove that i <= j+3 // if the abstract domain is powerful enough. void main() { int i = 0; while (i<4) { int j=0; while (j<4) { i=i+1; j=j+1; } i = i-j+1; assert(i <= j+3); } return ; }
// SKIP PARAM: --enable ana.int.interval --set solver td3 --enable ana.base.partition-arrays.enabled --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none // This is part of 34-localization, but also symlinked to 36-apron. // ALSO: --enable ana.int.interval --set solver slr3 --enable ana.base.partition-arrays.enabled --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none // Example from Halbwachs-Henry, SAS 2012 // Localized widening or restart policy should be able to prove that i <= j+3 // if the abstract domain is powerful enough. void main() { int i = 0; while (i<4) { int j=0; while (j<4) { i=i+1; j=j+1; } i = i-j+1; assert(i <= j+3); } return ; }
--- +++ @@ -1,7 +1,7 @@ -// SKIP PARAM: --enable ana.int.interval --set solver td3 --enable ana.base.partition-arrays.enabled --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none +// SKIP PARAM: --enable ana.int.interval --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none // This is part of 34-localization, but also symlinked to 36-apron. -// ALSO: --enable ana.int.interval --set solver slr3 --enable ana.base.partition-arrays.enabled --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none +// ALSO: --enable ana.int.interval --set solver slr3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none // Example from Halbwachs-Henry, SAS 2012 // Localized widening or restart policy should be able to prove that i <= j+3 // if the abstract domain is powerful enough.
Fix partitioned array option in additional test
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
2c058b10c0dc3b2df2fb6d0a203c2abca300c794
// // Created by Borin Ouch on 2016-03-22. // #ifndef SFML_TEST_GAME_STATE_H #define SFML_TEST_GAME_STATE_H #include "game.h" class GameState { public: Game* game; virtual void draw(const float dt) = 0; virtual void update(const float dt) = 0; virtual void handleInput() = 0; virtual ~GameState() {}; }; #endif //SFML_TEST_GAME_STATE_H
// // Created by Borin Ouch on 2016-03-22. // #ifndef SFML_TEST_GAME_STATE_H #define SFML_TEST_GAME_STATE_H #include "game.h" class GameState { public: Game* game; virtual void draw(const float dt) = 0; virtual void update(const float dt) = 0; virtual void handleInput() = 0; }; #endif //SFML_TEST_GAME_STATE_H
--- +++ @@ -17,6 +17,8 @@ virtual void draw(const float dt) = 0; virtual void update(const float dt) = 0; virtual void handleInput() = 0; + + virtual ~GameState() {}; };
Add virtual destructor to game state
mit
aceiii/sfml-city-builder
4f7bf9e92189558747c5298830afd2f9a591b5e8
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2016 The Bitcoin Ocho developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_CONSENSUS_H #define BITCOIN_CONSENSUS_CONSENSUS_H /** The maximum allowed size for a serialized block, in bytes (network rule) */ /** Bitcoin Ocho, we multiply by 8 for Ocho */ static const unsigned int MAX_BLOCK_SIZE = 1000000*8; /** The maximum allowed number of signature check operations in a block (network rule) */ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 100; /** Flags for nSequence and nLockTime locks */ enum { /* Interpret sequence numbers as relative lock-time constraints. */ LOCKTIME_VERIFY_SEQUENCE = (1 << 0), /* Use GetMedianTimePast() instead of nTime for end point timestamp. */ LOCKTIME_MEDIAN_TIME_PAST = (1 << 1), }; #endif // BITCOIN_CONSENSUS_CONSENSUS_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_CONSENSUS_H #define BITCOIN_CONSENSUS_CONSENSUS_H /** The maximum allowed size for a serialized block, in bytes (network rule) */ static const unsigned int MAX_BLOCK_SIZE = 1000000; /** The maximum allowed number of signature check operations in a block (network rule) */ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 100; /** Flags for nSequence and nLockTime locks */ enum { /* Interpret sequence numbers as relative lock-time constraints. */ LOCKTIME_VERIFY_SEQUENCE = (1 << 0), /* Use GetMedianTimePast() instead of nTime for end point timestamp. */ LOCKTIME_MEDIAN_TIME_PAST = (1 << 1), }; #endif // BITCOIN_CONSENSUS_CONSENSUS_H
--- +++ @@ -1,5 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers +// Copyright (c) 2016 The Bitcoin Ocho developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -7,7 +8,8 @@ #define BITCOIN_CONSENSUS_CONSENSUS_H /** The maximum allowed size for a serialized block, in bytes (network rule) */ -static const unsigned int MAX_BLOCK_SIZE = 1000000; +/** Bitcoin Ocho, we multiply by 8 for Ocho */ +static const unsigned int MAX_BLOCK_SIZE = 1000000*8; /** The maximum allowed number of signature check operations in a block (network rule) */ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
Add more Ochoness to Bitcoin.
mit
goku1997/bitcoin,goku1997/bitcoin,goku1997/bitcoin,goku1997/bitcoin,goku1997/bitcoin,goku1997/bitcoin
9cea98e320bfc37a6df373245f916b15c68a7f01
#import <CareKit/CareKit.h> @interface CMHMutedEventUpdater : NSObject - (_Nonnull instancetype)initWithCarePlanStore:(OCKCarePlanStore *_Nonnull)store event:(OCKCarePlanEvent *_Nonnull)event result:(OCKCarePlanEventResult *_Nullable)result state:(OCKCarePlanEventState)state; - (NSError *_Nullable)performUpdate; @end
#import <CareKit/CareKit.h> @interface CMHMutedEventUpdater : NSObject - (instancetype)initWithCarePlanStore:(OCKCarePlanStore *)store event:(OCKCarePlanEvent *)event result:(OCKCarePlanEventResult *)result state:(OCKCarePlanEventState)state; - (NSError *_Nullable)performUpdate; @end
--- +++ @@ -2,10 +2,10 @@ @interface CMHMutedEventUpdater : NSObject -- (instancetype)initWithCarePlanStore:(OCKCarePlanStore *)store - event:(OCKCarePlanEvent *)event - result:(OCKCarePlanEventResult *)result - state:(OCKCarePlanEventState)state; +- (_Nonnull instancetype)initWithCarePlanStore:(OCKCarePlanStore *_Nonnull)store + event:(OCKCarePlanEvent *_Nonnull)event + result:(OCKCarePlanEventResult *_Nullable)result + state:(OCKCarePlanEventState)state; - (NSError *_Nullable)performUpdate;
Add Nullability annotations to the event updater class
mit
cloudmine/CMHealthSDK,cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK-iOS
fd1cb2861f5037415d2899b4dfff0c60fcdb040d
#pragma once #include <fstream> #include <string> #include <cerrno> #include <clocale> #include <vector> #include <iostream> #include <stdlib.h> #ifdef __APPLE__ #include <stdlib.h> #else #include <malloc.h> #endif #include <memory.h> #define _USE_MATH_DEFINES #include <math.h> #include <cairo.h> #include <gtkmm.h> #include <gtkmm/application.h> #include <gtkmm/window.h> #include "../litehtml/include/litehtml.h" #include <ft2build.h> #include FT_FREETYPE_H #include <fontconfig/fontconfig.h> #include <cairo-ft.h> #include <gdk/gdk.h> #include <cairomm/context.h> #include <curl/curl.h> #include <Poco/URI.h> extern std::string urljoin(const std::string &base, const std::string &relative);
#pragma once #include <fstream> #include <string> #include <cerrno> #include <clocale> #include <vector> #include <iostream> #include <stdlib.h> #include <malloc.h> #include <memory.h> #define _USE_MATH_DEFINES #include <math.h> #include <cairo.h> #include <gtkmm.h> #include <gtkmm/application.h> #include <gtkmm/window.h> #include "../litehtml/include/litehtml.h" #include <ft2build.h> #include FT_FREETYPE_H #include <fontconfig/fontconfig.h> #include <cairo-ft.h> #include <gdk/gdk.h> #include <cairomm/context.h> #include <curl/curl.h> #include <Poco/URI.h> extern std::string urljoin(const std::string &base, const std::string &relative);
--- +++ @@ -7,7 +7,11 @@ #include <vector> #include <iostream> #include <stdlib.h> +#ifdef __APPLE__ +#include <stdlib.h> +#else #include <malloc.h> +#endif #include <memory.h> #define _USE_MATH_DEFINES #include <math.h>
Make including malloc on MacOS compatible
bsd-3-clause
litehtml/litebrowser-linux
f43a8742653c7bbd4f05440152b05f19a9300d17
//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // // Copyright (C) 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer // to the file deal.II/doc/license.html for the text and // further information on this license. // //--------------------------------------------------------------------------- #ifndef __deal2__std_cxx1x_shared_ptr_h #define __deal2__std_cxx1x_shared_ptr_h #include <base/config.h> #ifdef DEAL_II_CAN_USE_CXX1X # include <memory> #else #include <boost/shared_ptr.hpp> #include <boost/scoped_ptr.hpp> DEAL_II_NAMESPACE_OPEN namespace std_cxx1x { using boost::shared_ptr; using boost::enable_shared_from_this; // boost doesn't have boost::unique_ptr, // but its scoped_ptr comes close so // re-implement unique_ptr using scoped_ptr template<class T> class unique_ptr : public boost::scoped_ptr<T> { public: explicit unique_ptr(T * p = 0) : boost::scoped_ptr<T> (p) {} }; } DEAL_II_NAMESPACE_CLOSE #endif #endif
//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // // Copyright (C) 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer // to the file deal.II/doc/license.html for the text and // further information on this license. // //--------------------------------------------------------------------------- #ifndef __deal2__std_cxx1x_shared_ptr_h #define __deal2__std_cxx1x_shared_ptr_h #include <base/config.h> #ifdef DEAL_II_CAN_USE_CXX1X # include <memory> #else #include <boost/shared_ptr.hpp> DEAL_II_NAMESPACE_OPEN namespace std_cxx1x { using boost::shared_ptr; using boost::enable_shared_from_this; } DEAL_II_NAMESPACE_CLOSE #endif #endif
--- +++ @@ -23,12 +23,26 @@ #else #include <boost/shared_ptr.hpp> +#include <boost/scoped_ptr.hpp> DEAL_II_NAMESPACE_OPEN namespace std_cxx1x { using boost::shared_ptr; using boost::enable_shared_from_this; + + // boost doesn't have boost::unique_ptr, + // but its scoped_ptr comes close so + // re-implement unique_ptr using scoped_ptr + template<class T> class unique_ptr : public boost::scoped_ptr<T> + { + public: + explicit unique_ptr(T * p = 0) + : + boost::scoped_ptr<T> (p) + {} + }; + } DEAL_II_NAMESPACE_CLOSE
Implement the equivalent of std::unique_ptr using boost::scoped_ptr. git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@19195 0785d39b-7218-0410-832d-ea1e28bc413d
lgpl-2.1
sriharisundar/dealii,YongYang86/dealii,sriharisundar/dealii,kalj/dealii,sriharisundar/dealii,YongYang86/dealii,sriharisundar/dealii,flow123d/dealii,flow123d/dealii,johntfoster/dealii,ibkim11/dealii,gpitton/dealii,pesser/dealii,ibkim11/dealii,spco/dealii,jperryhouts/dealii,shakirbsm/dealii,ibkim11/dealii,JaeryunYim/dealii,danshapero/dealii,lue/dealii,YongYang86/dealii,mac-a/dealii,andreamola/dealii,ESeNonFossiIo/dealii,danshapero/dealii,flow123d/dealii,EGP-CIG-REU/dealii,sairajat/dealii,mac-a/dealii,lue/dealii,lpolster/dealii,johntfoster/dealii,YongYang86/dealii,kalj/dealii,nicolacavallini/dealii,pesser/dealii,johntfoster/dealii,sairajat/dealii,kalj/dealii,johntfoster/dealii,maieneuro/dealii,flow123d/dealii,maieneuro/dealii,danshapero/dealii,JaeryunYim/dealii,shakirbsm/dealii,rrgrove6/dealii,nicolacavallini/dealii,shakirbsm/dealii,msteigemann/dealii,JaeryunYim/dealii,andreamola/dealii,mtezzele/dealii,andreamola/dealii,angelrca/dealii,adamkosik/dealii,YongYang86/dealii,lpolster/dealii,mac-a/dealii,angelrca/dealii,danshapero/dealii,msteigemann/dealii,flow123d/dealii,pesser/dealii,Arezou-gh/dealii,msteigemann/dealii,mac-a/dealii,lue/dealii,jperryhouts/dealii,ESeNonFossiIo/dealii,sairajat/dealii,shakirbsm/dealii,andreamola/dealii,msteigemann/dealii,lpolster/dealii,gpitton/dealii,andreamola/dealii,EGP-CIG-REU/dealii,danshapero/dealii,adamkosik/dealii,gpitton/dealii,msteigemann/dealii,EGP-CIG-REU/dealii,lue/dealii,Arezou-gh/dealii,rrgrove6/dealii,andreamola/dealii,natashasharma/dealii,mtezzele/dealii,YongYang86/dealii,rrgrove6/dealii,naliboff/dealii,spco/dealii,sairajat/dealii,johntfoster/dealii,naliboff/dealii,natashasharma/dealii,danshapero/dealii,gpitton/dealii,msteigemann/dealii,JaeryunYim/dealii,lpolster/dealii,flow123d/dealii,jperryhouts/dealii,ESeNonFossiIo/dealii,rrgrove6/dealii,JaeryunYim/dealii,sriharisundar/dealii,angelrca/dealii,maieneuro/dealii,kalj/dealii,danshapero/dealii,jperryhouts/dealii,angelrca/dealii,Arezou-gh/dealii,nicolacavallini/dealii,pesser/dealii,natashasharma/dealii,mac-a/dealii,Arezou-gh/dealii,natashasharma/dealii,adamkosik/dealii,ESeNonFossiIo/dealii,maieneuro/dealii,mtezzele/dealii,natashasharma/dealii,mtezzele/dealii,JaeryunYim/dealii,ESeNonFossiIo/dealii,naliboff/dealii,kalj/dealii,ibkim11/dealii,maieneuro/dealii,andreamola/dealii,rrgrove6/dealii,spco/dealii,kalj/dealii,sairajat/dealii,nicolacavallini/dealii,lpolster/dealii,mac-a/dealii,shakirbsm/dealii,pesser/dealii,naliboff/dealii,kalj/dealii,angelrca/dealii,Arezou-gh/dealii,mac-a/dealii,adamkosik/dealii,lue/dealii,natashasharma/dealii,rrgrove6/dealii,YongYang86/dealii,nicolacavallini/dealii,gpitton/dealii,msteigemann/dealii,shakirbsm/dealii,adamkosik/dealii,gpitton/dealii,maieneuro/dealii,jperryhouts/dealii,rrgrove6/dealii,flow123d/dealii,nicolacavallini/dealii,lpolster/dealii,mtezzele/dealii,johntfoster/dealii,spco/dealii,ibkim11/dealii,nicolacavallini/dealii,jperryhouts/dealii,EGP-CIG-REU/dealii,spco/dealii,EGP-CIG-REU/dealii,shakirbsm/dealii,EGP-CIG-REU/dealii,jperryhouts/dealii,lue/dealii,JaeryunYim/dealii,angelrca/dealii,naliboff/dealii,sairajat/dealii,mtezzele/dealii,ibkim11/dealii,pesser/dealii,spco/dealii,naliboff/dealii,johntfoster/dealii,adamkosik/dealii,adamkosik/dealii,maieneuro/dealii,sairajat/dealii,spco/dealii,Arezou-gh/dealii,ESeNonFossiIo/dealii,Arezou-gh/dealii,mtezzele/dealii,lpolster/dealii,lue/dealii,gpitton/dealii,pesser/dealii,naliboff/dealii,sriharisundar/dealii,natashasharma/dealii,sriharisundar/dealii,angelrca/dealii,ibkim11/dealii,ESeNonFossiIo/dealii,EGP-CIG-REU/dealii
0c831cc87a2effc6791e946858afaf5156d0edfc
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #ifndef _BITS_UCLIBC_ERRNO_H #define _BITS_UCLIBC_ERRNO_H 1 #ifdef IS_IN_rtld # undef errno # define errno _dl_errno extern int _dl_errno; // attribute_hidden; #elif defined __UCLIBC_HAS_THREADS__ # include <tls.h> # if defined USE___THREAD && USE___THREAD # undef errno # ifndef NOT_IN_libc # define errno __libc_errno # else # define errno errno # endif extern __thread int errno attribute_tls_model_ie; # endif /* USE___THREAD */ #endif /* IS_IN_rtld */ #define __set_errno(val) (errno = (val)) #ifndef __ASSEMBLER__ extern int *__errno_location (void) __THROW __attribute__ ((__const__)) # ifdef IS_IN_rtld attribute_hidden # endif ; # if defined __UCLIBC_HAS_THREADS__ # include <tls.h> # if defined USE___THREAD && USE___THREAD libc_hidden_proto(__errno_location) # endif # endif #endif /* !__ASSEMBLER__ */ #endif
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #ifndef _BITS_UCLIBC_ERRNO_H #define _BITS_UCLIBC_ERRNO_H 1 #ifdef IS_IN_rtld # undef errno # define errno _dl_errno extern int _dl_errno; // attribute_hidden; #elif defined __UCLIBC_HAS_THREADS__ # include <tls.h> # if defined USE___THREAD && USE___THREAD # undef errno # ifndef NOT_IN_libc # define errno __libc_errno # else # define errno errno # endif extern __thread int errno __attribute_tls_model_ie; # endif /* USE___THREAD */ #endif /* IS_IN_rtld */ #define __set_errno(val) (errno = (val)) #ifndef __ASSEMBLER__ extern int *__errno_location (void) __THROW __attribute__ ((__const__)) # ifdef IS_IN_rtld attribute_hidden # endif ; # if defined __UCLIBC_HAS_THREADS__ # include <tls.h> # if defined USE___THREAD && USE___THREAD libc_hidden_proto(__errno_location) # endif # endif #endif /* !__ASSEMBLER__ */ #endif
--- +++ @@ -19,7 +19,7 @@ # else # define errno errno # endif -extern __thread int errno __attribute_tls_model_ie; +extern __thread int errno attribute_tls_model_ie; # endif /* USE___THREAD */ #endif /* IS_IN_rtld */
Fix typo in macro for tls access model
lgpl-2.1
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
00dc4cb5f356873e8c0b704e2cf2467f0f0a9a71
/* Copyright (c) 2011 Google 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. */ // // GTLBatchQuery.h // #import "GTLQuery.h" @interface GTLBatchQuery : NSObject <GTLQueryProtocol> { @private NSMutableArray *queries_; NSMutableDictionary *requestIDMap_; BOOL skipAuthorization_; } // Queries included in this batch. Each query should have a unique requestID. @property (retain) NSArray *queries; // Clients may set this to YES to disallow authorization. Defaults to NO. @property (assign) BOOL shouldSkipAuthorization; + (id)batchQuery; + (id)batchQueryWithQueries:(NSArray *)array; - (void)addQuery:(GTLQuery *)query; - (GTLQuery *)queryForRequestID:(NSString *)requestID; @end
/* Copyright (c) 2011 Google 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. */ // // GTLBatchQuery.h // #import "GTLQuery.h" @interface GTLBatchQuery : NSObject <GTLQueryProtocol> { @private NSMutableArray *queries_; NSMutableDictionary *requestIDMap_; BOOL skipAuthorization_; } // Queries included in this batch. Each query should have a unique requestID. @property (retain) NSArray *queries; // Clients may set this to NO to disallow authorization. Defaults to YES. @property (assign) BOOL shouldSkipAuthorization; + (id)batchQuery; + (id)batchQueryWithQueries:(NSArray *)array; - (void)addQuery:(GTLQuery *)query; - (GTLQuery *)queryForRequestID:(NSString *)requestID; @end
--- +++ @@ -29,7 +29,7 @@ // Queries included in this batch. Each query should have a unique requestID. @property (retain) NSArray *queries; -// Clients may set this to NO to disallow authorization. Defaults to YES. +// Clients may set this to YES to disallow authorization. Defaults to NO. @property (assign) BOOL shouldSkipAuthorization; + (id)batchQuery;
Fix comment on shouldSkipAuthorization property
apache-2.0
justinhouse/google-api-objectivec-client,nanthi1990/google-api-objectivec-client,CarlosTrejo/google-api-objectivec-client,JonasGessner/google-api-objectivec-client,creationst/google-api-objectivec-client,daffodilistic/google-api-objectivec-client,clody/google-api-objectivec-client,JonasGessner/google-api-objectivec-client,johndpope/google-api-objectivec-client,TigrilloInc/google-api-objectivec-client,alimills/google-api-swift-client,SheltonWan/google-api-objectivec-client
72db37d52802027c30b38181de09413d7ceb8f17
#include <stdio.h> #include <string.h> #include "lib/proc.h" int main(int argc, char **argv) { char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); if (out != 0) { exit(1); } char *token; char *sep=" \r\n"; int next = 0; while((token = strsep(&gitbuff, sep)) != NULL) { if (token[0] == '*') { token = strsep(&gitbuff, sep); printf("(%s)", token); break; } } return 0; }
#include <stdio.h> #include "lib/proc.h" int main(int argc, char **argv) { char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); //int out = run_proc(&gitbuff, "ls", "-l", "-h", 0); if (out != 0) { fprintf(stderr, "Error running subprocess:%d\n", out); exit(1); } //printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff); char *br; br = gitbuff; putchar('('); while(*br++ != '*') {} // skip the '*' and the space after it br++; while(*br != '\n') { putchar(*br++); } putchar(')'); putchar('\n'); }
--- +++ @@ -1,35 +1,28 @@ #include <stdio.h> +#include <string.h> #include "lib/proc.h" int main(int argc, char **argv) { - char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); - //int out = run_proc(&gitbuff, "ls", "-l", "-h", 0); if (out != 0) { - fprintf(stderr, "Error running subprocess:%d\n", out); exit(1); } - //printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff); - char *br; - - br = gitbuff; - putchar('('); - - while(*br++ != '*') {} - // skip the '*' and the space after it - br++; - while(*br != '\n') + char *token; + char *sep=" \r\n"; + int next = 0; + while((token = strsep(&gitbuff, sep)) != NULL) { - putchar(*br++); - } - - putchar(')'); - putchar('\n'); + if (token[0] == '*') { + token = strsep(&gitbuff, sep); + printf("(%s)", token); + break; + } + } + return 0; } -
Use strsep to split output
bsd-3-clause
wnh/prompt_utils
37a155226210640f16018e1033d4769b2fb36909
#ifndef BF_WRAP_H #define BF_WRAP_H #include <type_traits> #include <vector> #include "object.h" namespace bf { template < typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(T const& x) { return {&x, sizeof(T)}; } template < typename T, size_t N, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(T const (&str)[N]) { return {&str, N * sizeof(T)}; } template < typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(std::vector<T> const& s) { return {s.data(), s.size()}; } inline object wrap(std::string const& str) { return {str.data(), str.size()}; } } // namespace bf #endif
#ifndef BF_WRAP_H #define BF_WRAP_H #include <type_traits> #include "object.h" namespace bf { template < typename T, typename std::enable_if<std::is_integral<T>::value>::type > object wrap(T const& x) { return {&x, sizeof(T)}; } template <typename Sequence> object wrap(Sequence const& s) { return {s.data(), s.size()}; } } // namespace bf #endif
--- +++ @@ -2,23 +2,42 @@ #define BF_WRAP_H #include <type_traits> +#include <vector> #include "object.h" namespace bf { template < typename T, - typename std::enable_if<std::is_integral<T>::value>::type + typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(T const& x) { return {&x, sizeof(T)}; } -template <typename Sequence> -object wrap(Sequence const& s) +template < + typename T, + size_t N, + typename = typename std::enable_if<std::is_arithmetic<T>::value>::type +> +object wrap(T const (&str)[N]) +{ + return {&str, N * sizeof(T)}; +} + +template < + typename T, + typename = typename std::enable_if<std::is_arithmetic<T>::value>::type +> +object wrap(std::vector<T> const& s) { return {s.data(), s.size()}; +} + +inline object wrap(std::string const& str) +{ + return {str.data(), str.size()}; } } // namespace bf
Fix SFINAE default arg and add array overload.
bsd-3-clause
mavam/libbf,nicolacdnll/libbf,nicolacdnll/libbf
acb99f7d6b709a7dc88344c36de7c4866e455035
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(CLI) SLTM(SessionOpen) SLTM(SessionClose) SLTM(ClientAddr) SLTM(Request) SLTM(URL) SLTM(Protocol) SLTM(H_Unknown) #define HTTPH(a, b) SLTM(b) #include "http_headers.h" #undef HTTPH
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(CLI) SLTM(SessionOpen) SLTM(SessionClose) SLTM(ClientAddr) SLTM(Request) SLTM(URL) SLTM(Protocol) SLTM(Headers)
--- +++ @@ -13,4 +13,7 @@ SLTM(Request) SLTM(URL) SLTM(Protocol) -SLTM(Headers) +SLTM(H_Unknown) +#define HTTPH(a, b) SLTM(b) +#include "http_headers.h" +#undef HTTPH
Use http_headers.h to define HTTP header tags for logging git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@90 d4fa192b-c00b-0410-8231-f00ffab90ce4
bsd-2-clause
varnish/Varnish-Cache,ajasty-cavium/Varnish-Cache,ssm/pkg-varnish,zhoualbeart/Varnish-Cache,franciscovg/Varnish-Cache,ajasty-cavium/Varnish-Cache,ambernetas/varnish-cache,zhoualbeart/Varnish-Cache,gauthier-delacroix/Varnish-Cache,drwilco/varnish-cache-drwilco,drwilco/varnish-cache-drwilco,ssm/pkg-varnish,feld/Varnish-Cache,mrhmouse/Varnish-Cache,ssm/pkg-varnish,wikimedia/operations-debs-varnish,ajasty-cavium/Varnish-Cache,1HLtd/Varnish-Cache,1HLtd/Varnish-Cache,gauthier-delacroix/Varnish-Cache,mrhmouse/Varnish-Cache,chrismoulton/Varnish-Cache,gquintard/Varnish-Cache,gauthier-delacroix/Varnish-Cache,feld/Varnish-Cache,alarky/varnish-cache-doc-ja,alarky/varnish-cache-doc-ja,1HLtd/Varnish-Cache,feld/Varnish-Cache,ajasty-cavium/Varnish-Cache,drwilco/varnish-cache-old,gquintard/Varnish-Cache,franciscovg/Varnish-Cache,alarky/varnish-cache-doc-ja,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,ambernetas/varnish-cache,gauthier-delacroix/Varnish-Cache,chrismoulton/Varnish-Cache,varnish/Varnish-Cache,mrhmouse/Varnish-Cache,franciscovg/Varnish-Cache,wikimedia/operations-debs-varnish,alarky/varnish-cache-doc-ja,drwilco/varnish-cache-drwilco,alarky/varnish-cache-doc-ja,zhoualbeart/Varnish-Cache,franciscovg/Varnish-Cache,drwilco/varnish-cache-old,mrhmouse/Varnish-Cache,zhoualbeart/Varnish-Cache,ajasty-cavium/Varnish-Cache,gquintard/Varnish-Cache,zhoualbeart/Varnish-Cache,ambernetas/varnish-cache,chrismoulton/Varnish-Cache,1HLtd/Varnish-Cache,varnish/Varnish-Cache,feld/Varnish-Cache,gauthier-delacroix/Varnish-Cache,feld/Varnish-Cache,ssm/pkg-varnish,gquintard/Varnish-Cache,varnish/Varnish-Cache,chrismoulton/Varnish-Cache,franciscovg/Varnish-Cache,wikimedia/operations-debs-varnish,ssm/pkg-varnish,varnish/Varnish-Cache,chrismoulton/Varnish-Cache,drwilco/varnish-cache-old,mrhmouse/Varnish-Cache
38d665c82ba3dedc51f597f519dac84546588638
#ifndef SOFAPYTHON_PYTHON_H #define SOFAPYTHON_PYTHON_H // This header simply includes Python.h, taking care of platform-specific stuff // It should be included before any standard headers: // "Since Python may define some pre-processor definitions which affect the // standard headers on some systems, you must include Python.h before any // standard headers are included." #if defined(_WIN32) # define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h # define Py_ENABLE_SHARED 1 // this flag ensure to use dll's version (needed because of MS_NO_COREDLL define). #endif #if defined(_MSC_VER) && defined(_DEBUG) // if you use Python on windows in debug build, be sure to provide a compiled version because // installation package doesn't come with debug libs. # include <Python.h> #elif defined(__APPLE__) && defined(__MACH__) # include <Python/Python.h> #else # include <Python.h> #endif #endif
#ifndef SOFAPYTHON_PYTHON_H #define SOFAPYTHON_PYTHON_H // This header simply includes Python.h, taking care of platform-specific stuff // It should be included before any standard headers: // "Since Python may define some pre-processor definitions which affect the // standard headers on some systems, you must include Python.h before any // standard headers are included." #if defined(_WIN32) # define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h #endif #if defined(_MSC_VER) && defined(_DEBUG) // undefine _DEBUG since we want to always link agains the release version of // python and pyconfig.h automatically links debug version if _DEBUG is defined. // ocarre: no we don't, in debug on Windows we cannot link with python release, if we want to build SofaPython in debug we have to compile python in debug //# undef _DEBUG # include <Python.h> //# define _DEBUG #elif defined(__APPLE__) && defined(__MACH__) # include <Python/Python.h> #else # include <Python.h> #endif #endif
--- +++ @@ -11,15 +11,13 @@ #if defined(_WIN32) # define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h +# define Py_ENABLE_SHARED 1 // this flag ensure to use dll's version (needed because of MS_NO_COREDLL define). #endif #if defined(_MSC_VER) && defined(_DEBUG) -// undefine _DEBUG since we want to always link agains the release version of -// python and pyconfig.h automatically links debug version if _DEBUG is defined. -// ocarre: no we don't, in debug on Windows we cannot link with python release, if we want to build SofaPython in debug we have to compile python in debug -//# undef _DEBUG -# include <Python.h> -//# define _DEBUG +// if you use Python on windows in debug build, be sure to provide a compiled version because +// installation package doesn't come with debug libs. +# include <Python.h> #elif defined(__APPLE__) && defined(__MACH__) # include <Python/Python.h> #else
Fix python link in release build. Former-commit-id: f2b0e4ff65df702ae4f98bed2a39dcfdc0f7e9c4
lgpl-2.1
FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,hdeling/sofa,Anatoscope/sofa,hdeling/sofa,hdeling/sofa,Anatoscope/sofa,hdeling/sofa,FabienPean/sofa,FabienPean/sofa,Anatoscope/sofa,hdeling/sofa,hdeling/sofa,Anatoscope/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,FabienPean/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,Anatoscope/sofa,hdeling/sofa
1a9f189af8076cf1f67b92567e47d7dd8e0514fa
#pragma once #include "ResourceDX11.h" namespace Mile { class MEAPI BufferDX11 : public ResourceDX11 { public: BufferDX11( RendererDX11* renderer ) : m_buffer( nullptr ), ResourceDX11( renderer ) { } ~BufferDX11( ) { SafeRelease( m_buffer ); } virtual ID3D11Resource* GetResource( ) override; D3D11_BUFFER_DESC GetDesc( ) const { return m_desc; } virtual void* Map( ) { return nullptr; } virtual bool UnMap( ) { return false; } protected: ID3D11Buffer* m_buffer; D3D11_BUFFER_DESC m_desc; }; }
#pragma once #include "ResourceDX11.h" namespace Mile { class MEAPI BufferDX11 : public ResourceDX11 { public: BufferDX11( RendererDX11* renderer ) : m_buffer( nullptr ), ResourceDX11( renderer ) { } ~BufferDX11( ) { SafeRelease( m_buffer ); } virtual ID3D11Resource* GetResource( ) override; D3D11_BUFFER_DESC GetDesc( ) const { return m_desc; } virtual void* Map( ) { return nullptr; } virtual void UnMap( ) { } protected: ID3D11Buffer* m_buffer; D3D11_BUFFER_DESC m_desc; }; }
--- +++ @@ -21,7 +21,7 @@ D3D11_BUFFER_DESC GetDesc( ) const { return m_desc; } virtual void* Map( ) { return nullptr; } - virtual void UnMap( ) { } + virtual bool UnMap( ) { return false; } protected: ID3D11Buffer* m_buffer;
Modify UnMap function return boolean value that succesfully unmaped.
mit
HoRangDev/MileEngine,HoRangDev/MileEngine
02b194c36659bfd85485aded4e52c3e587df48b0
// 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 WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #include "webkit/fileapi/file_system_file_util.h" #include "webkit/fileapi/file_system_operation_context.h" #pragma once namespace fileapi { class QuotaFileUtil : public FileSystemFileUtil { public: static QuotaFileUtil* GetInstance(); ~QuotaFileUtil() {} static const int64 kNoLimit; virtual base::PlatformFileError CopyOrMoveFile( FileSystemOperationContext* fs_context, const FilePath& src_file_path, const FilePath& dest_file_path, bool copy); // TODO(dmikurube): Charge some amount of quota for directories. virtual base::PlatformFileError Truncate( FileSystemOperationContext* fs_context, const FilePath& path, int64 length); friend struct DefaultSingletonTraits<QuotaFileUtil>; DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil); protected: QuotaFileUtil() {} }; } // namespace fileapi #endif // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_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 WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #include "webkit/fileapi/file_system_file_util.h" #include "webkit/fileapi/file_system_operation_context.h" #pragma once namespace fileapi { class QuotaFileUtil : public FileSystemFileUtil { public: static QuotaFileUtil* GetInstance(); ~QuotaFileUtil() {} static const int64 kNoLimit; base::PlatformFileError CopyOrMoveFile( FileSystemOperationContext* fs_context, const FilePath& src_file_path, const FilePath& dest_file_path, bool copy); // TODO(dmikurube): Charge some amount of quota for directories. base::PlatformFileError Truncate( FileSystemOperationContext* fs_context, const FilePath& path, int64 length); friend struct DefaultSingletonTraits<QuotaFileUtil>; DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil); protected: QuotaFileUtil() {} }; } // namespace fileapi #endif // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_
--- +++ @@ -18,7 +18,7 @@ static const int64 kNoLimit; - base::PlatformFileError CopyOrMoveFile( + virtual base::PlatformFileError CopyOrMoveFile( FileSystemOperationContext* fs_context, const FilePath& src_file_path, const FilePath& dest_file_path, @@ -26,7 +26,7 @@ // TODO(dmikurube): Charge some amount of quota for directories. - base::PlatformFileError Truncate( + virtual base::PlatformFileError Truncate( FileSystemOperationContext* fs_context, const FilePath& path, int64 length);
Add virtual in QuitaFileUtil to fix the compilation error in r82441. TBR=dmikurube,kinuko BUG=none TEST=none Review URL: http://codereview.chromium.org/6882112 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@82445 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,ropik/chromium,gavinp/chromium
a981815c88aca37a8dcb42f1ce673ed838114251
// // FABAsyncOperation.h // FABOperation // // Copyright © 2016 Twitter. All rights reserved. // #import <Foundation/Foundation.h> /** * Completion block that can be called in your subclass implementation. It is up to you when you want to call it. */ typedef void(^FABAsyncOperationCompletionBlock)(NSError *__nullable error); /** * FABAsyncOperation is a subclass of NSOperation that allows for asynchronous work to be performed, for things like networking, IPC or UI-driven logic. Create your own subclasses to encapsulate custom logic. * @warning When subclassing to create your own operations, be sure to call -[finishWithError:] at some point, or program execution will hang. * @see -[finishWithError:] in FABAsyncOperation_Private.h */ @interface FABAsyncOperation : NSOperation /** * Add a callback method for consumers of your subclasses to set when the asynchronous work is marked as complete with -[finishWithError:]. */ @property (copy, nonatomic, nullable) FABAsyncOperationCompletionBlock asyncCompletion; @end
// // FABAsyncOperation.h // FABOperation // // Copyright © 2016 Twitter. All rights reserved. // #import <Foundation/Foundation.h> /** * Completion block that can be called in your subclass implementation. It is up to you when you want to call it. */ typedef void(^FABAsyncOperationCompletionBlock)(NSError *__nullable error); /** * FABAsyncOperation is a subclass of NSOperation that allows for asynchronous work to be performed, for things like networking, IPC or UI-driven logic. Create your own subclasses to encapsulate custom logic. * @warning When subclassing to create your own operations, be sure to call -[markDone] at some point, or program execution will hang. * @see -[markDone] in FABAsyncOperation_Private.h */ @interface FABAsyncOperation : NSOperation /** * Add a callback method for consumers of your subclasses to set when the asynchronous work is marked as complete with -[markDone]. */ @property (copy, nonatomic, nullable) FABAsyncOperationCompletionBlock asyncCompletion; @end
--- +++ @@ -14,13 +14,13 @@ /** * FABAsyncOperation is a subclass of NSOperation that allows for asynchronous work to be performed, for things like networking, IPC or UI-driven logic. Create your own subclasses to encapsulate custom logic. - * @warning When subclassing to create your own operations, be sure to call -[markDone] at some point, or program execution will hang. - * @see -[markDone] in FABAsyncOperation_Private.h + * @warning When subclassing to create your own operations, be sure to call -[finishWithError:] at some point, or program execution will hang. + * @see -[finishWithError:] in FABAsyncOperation_Private.h */ @interface FABAsyncOperation : NSOperation /** - * Add a callback method for consumers of your subclasses to set when the asynchronous work is marked as complete with -[markDone]. + * Add a callback method for consumers of your subclasses to set when the asynchronous work is marked as complete with -[finishWithError:]. */ @property (copy, nonatomic, nullable) FABAsyncOperationCompletionBlock asyncCompletion;
Update comments to refer to finishWithError markDone was renamed to finishWithError
mit
google-fabric/FABOperation,twitter-fabric/FABOperation,google-fabric/FABOperation,twitter-fabric/FABOperation
f687a87560979bec5f7fc58f79e47baacb70cc25
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_ #define UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "ui/aura/client/capture_client.h" namespace views { class DesktopCaptureClient : public aura::client::CaptureClient { public: DesktopCaptureClient(); virtual ~DesktopCaptureClient(); private: // Overridden from aura::client::CaptureClient: virtual void SetCapture(aura::Window* window) OVERRIDE; virtual void ReleaseCapture(aura::Window* window) OVERRIDE; virtual aura::Window* GetCaptureWindow() OVERRIDE; aura::Window* capture_window_; DISALLOW_COPY_AND_ASSIGN(DesktopCaptureClient); }; } // namespace views #endif // UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_ #define UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "ui/aura/client/capture_client.h" #include "ui/views/views_export.h" namespace views { class VIEWS_EXPORT DesktopCaptureClient : public aura::client::CaptureClient { public: DesktopCaptureClient(); virtual ~DesktopCaptureClient(); private: // Overridden from aura::client::CaptureClient: virtual void SetCapture(aura::Window* window) OVERRIDE; virtual void ReleaseCapture(aura::Window* window) OVERRIDE; virtual aura::Window* GetCaptureWindow() OVERRIDE; aura::Window* capture_window_; DISALLOW_COPY_AND_ASSIGN(DesktopCaptureClient); }; } // namespace views #endif // UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_
--- +++ @@ -8,11 +8,10 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "ui/aura/client/capture_client.h" -#include "ui/views/views_export.h" namespace views { -class VIEWS_EXPORT DesktopCaptureClient : public aura::client::CaptureClient { +class DesktopCaptureClient : public aura::client::CaptureClient { public: DesktopCaptureClient(); virtual ~DesktopCaptureClient();
Revert 155836 - Fix static build. TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10918157 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@155841 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
anirudhSK/chromium,Jonekee/chromium.src,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,ltilve/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,ltilve/chromium,littlstar/chromium.src,dushu1203/chromium.src,ondra-novak/chromium.src,Chilledheart/chromium,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,nacl-webkit/chrome_deps,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,littlstar/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,ltilve/chromium,jaruba/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,hujiajie/pa-chromium,Just-D/chromium-1,anirudhSK/chromium,markYoungH/chromium.src,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,ltilve/chromium,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,patrickm/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,markYoungH/chromium.src,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,dednal/chromium.src,hgl888/chromium-crosswalk,Chilledheart/chromium,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,hujiajie/pa-chromium,patrickm/chromium.src,nacl-webkit/chrome_deps,M4sse/chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,patrickm/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,jaruba/chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,dednal/chromium.src,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,anirudhSK/chromium,Jonekee/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,ondra-novak/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dednal/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,hujiajie/pa-chromium,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,dednal/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,ltilve/chromium,patrickm/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,markYoungH/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,Just-D/chromium-1,nacl-webkit/chrome_deps,Jonekee/chromium.src,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,jaruba/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,hgl888/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,M4sse/chromium.src,Chilledheart/chromium,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,dednal/chromium.src,patrickm/chromium.src,zcbenz/cefode-chromium,dushu1203/chromium.src,zcbenz/cefode-chromium,dushu1203/chromium.src,dushu1203/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,M4sse/chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,mogoweb/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,M4sse/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,anirudhSK/chromium,zcbenz/cefode-chromium,ChromiumWebApps/chromium,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,axinging/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,dushu1203/chromium.src,zcbenz/cefode-chromium,patrickm/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,hujiajie/pa-chromium,ondra-novak/chromium.src,dushu1203/chromium.src
8e4c186215c3d086a734dc0aec7f119b8a88c0a9
// vim: sw=4 ts=4 et : #include "config.h" #include "itmmorgue.h" // Parser for win_ section conf_t win_conf(char *key) { conf_t rc; // TODO implement real parser if (key == strstr(key, "area_y")) rc.ival = 3; if (key == strstr(key, "area_x")) rc.ival = 2; if (key == strstr(key, "area_max_y")) rc.ival = 10; if (key == strstr(key, "area_max_x")) rc.ival = 45; if (key == strstr(key, "area_state")) rc.ival = 2; return rc; } // Prefixes for config sections/subsections with parser pointers struct conf_prefix { char *prefix; conf_t (*parser)(char *); } pr_global[] = { { "win_", win_conf } }; // Entry point to get all config values conf_t conf(char *key) { conf_t rc; for (size_t i = 0; i < sizeof(pr_global) / sizeof(struct conf_prefix); i++) { if (key == strstr(key, pr_global[i].prefix)) { rc = win_conf(key + strlen(pr_global[i].prefix)); break; } } return rc; }
// vim: sw=4 ts=4 et : #include "config.h" // Parser for win_ section conf_t win_conf(char *key) { conf_t rc; rc.ival = 0; (void)key; return rc; } // Prefixes for config sections/subsections with parser pointers struct conf_prefix { char *prefix; conf_t (*parser)(char *); } pr_global[] = { { "win_", win_conf } }; // Entry point to get all config values conf_t conf(char *key) { conf_t rc; for (size_t i = 0; i < sizeof(pr_global); i++) { if (strstr(key, pr_global[i].prefix) == 0) { rc = win_conf(key + strlen(pr_global[i].prefix)); break; } } return rc; }
--- +++ @@ -1,13 +1,18 @@ // vim: sw=4 ts=4 et : #include "config.h" +#include "itmmorgue.h" // Parser for win_ section conf_t win_conf(char *key) { conf_t rc; - rc.ival = 0; + // TODO implement real parser + if (key == strstr(key, "area_y")) rc.ival = 3; + if (key == strstr(key, "area_x")) rc.ival = 2; + if (key == strstr(key, "area_max_y")) rc.ival = 10; + if (key == strstr(key, "area_max_x")) rc.ival = 45; + if (key == strstr(key, "area_state")) rc.ival = 2; - (void)key; return rc; } @@ -23,8 +28,10 @@ conf_t conf(char *key) { conf_t rc; - for (size_t i = 0; i < sizeof(pr_global); i++) { - if (strstr(key, pr_global[i].prefix) == 0) { + for (size_t i = 0; + i < sizeof(pr_global) / sizeof(struct conf_prefix); + i++) { + if (key == strstr(key, pr_global[i].prefix)) { rc = win_conf(key + strlen(pr_global[i].prefix)); break; }
Fix the first (sic!) Segmentation fault
mit
zhmylove/itmmorgue,zhmylove/itmmorgue,zhmylove/itmmorgue,zhmylove/itmmorgue
f470ac421f6695e415da643e03b903a679ea828e
#ifndef __SETTINGS_H_ #define __SETTINGS_H_ #include <Arduino.h> #include "Device.h" // This section is for devices and their configuration //Kit: #define HAS_STD_LIGHTS (1) #define LIGHTS_PIN 5 #define HAS_STD_CAPE (1) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_PILOT (1) #define HAS_STD_CAMERAMOUNT (1) #define CAMERAMOUNT_PIN 3 #define CAPE_VOLTAGE_PIN 0 #define CAPE_CURRENT_PIN 3 //After Market: #define HAS_STD_CALIBRATIONLASERS (0) #define CALIBRATIONLASERS_PIN 6 #define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define MIDPOINT 1500 #define LOGGING (1) class Settings : public Device { public: static int smoothingIncriment; //How aggressive the throttle changes static int deadZone_min; static int deadZone_max; static int capability_bitarray; Settings():Device(){}; void device_setup(); void device_loop(Command cmd); }; #endif
#ifndef __SETTINGS_H_ #define __SETTINGS_H_ #include <Arduino.h> #include "Device.h" // This section is for devices and their configuration //Kit: #define HAS_STD_LIGHTS (1) #define LIGHTS_PIN 5 #define HAS_STD_CAPE (1) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_PILOT (1) #define HAS_STD_CAMERAMOUNT (1) #define CAMERAMOUNT_PIN 3 #define CAPE_VOLTAGE_PIN 0 #define CAPE_CURRENT_PIN 3 //After Market: #define HAS_STD_CALIBRATIONLASERS (0) #define CALIBRATIONLASERS_PIN 6 #define HAS_POLOLU_MINIMUV (1) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define MIDPOINT 1500 #define LOGGING (1) class Settings : public Device { public: static int smoothingIncriment; //How aggressive the throttle changes static int deadZone_min; static int deadZone_max; static int capability_bitarray; Settings():Device(){}; void device_setup(); void device_loop(Command cmd); }; #endif
--- +++ @@ -19,7 +19,7 @@ //After Market: #define HAS_STD_CALIBRATIONLASERS (0) #define CALIBRATIONLASERS_PIN 6 -#define HAS_POLOLU_MINIMUV (1) +#define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76
Reset default settings to stock kit configuration
mit
codewithpassion/openrov-software,codewithpassion/openrov-software,codewithpassion/openrov-software,codewithpassion/openrov-software
c1a36603d5e603828cdae9068987cc58e625fc3b
// Copyright 2018 Google LLC // // 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 RIEGELI_BASE_ERRNO_MAPPING_H_ #define RIEGELI_BASE_ERRNO_MAPPING_H_ #include "absl/strings/string_view.h" #include "riegeli/base/status.h" namespace riegeli { // Converts errno value to Status. Status ErrnoToCanonicalStatus(int error_number, absl::string_view message); } // namespace riegeli #endif // RIEGELI_BASE_ERRNO_MAPPING_H_
// Copyright 2018 Google LLC // // 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 RIEGELI_BASE_STR_ERROR_H_ #define RIEGELI_BASE_STR_ERROR_H_ #include "absl/strings/string_view.h" #include "riegeli/base/status.h" namespace riegeli { // Converts errno value to Status. Status ErrnoToCanonicalStatus(int error_number, absl::string_view message); } // namespace riegeli #endif // RIEGELI_BASE_STR_ERROR_H_
--- +++ @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef RIEGELI_BASE_STR_ERROR_H_ -#define RIEGELI_BASE_STR_ERROR_H_ +#ifndef RIEGELI_BASE_ERRNO_MAPPING_H_ +#define RIEGELI_BASE_ERRNO_MAPPING_H_ #include "absl/strings/string_view.h" #include "riegeli/base/status.h" @@ -25,4 +25,4 @@ } // namespace riegeli -#endif // RIEGELI_BASE_STR_ERROR_H_ +#endif // RIEGELI_BASE_ERRNO_MAPPING_H_
Fix include guard to match the current filename. PiperOrigin-RevId: 256006893
apache-2.0
google/riegeli,google/riegeli,google/riegeli,google/riegeli
4571ac8b500390e3b70370369386d9cec35ea536
/* * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ /* * @file cynara-creds-commons.h * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> * @author Radoslaw Bartosiak <r.bartosiak@samsung.com> * @author Aleksander Zdyb <a.zdyb@partner.samsung.com> * @version 1.0 * @brief This file contains common APIs for Cynara credentials helper. */ #ifndef CYNARA_CREDS_COMMONS_H #define CYNARA_CREDS_COMMONS_H enum cynara_client_creds { CLIENT_METHOD_SMACK, CLIENT_METHOD_PID }; enum cynara_user_creds { USER_METHOD_UID, USER_METHOD_GID }; #ifdef __cplusplus extern "C" { #endif /* empty initial file */ #ifdef __cplusplus } #endif #endif /* CYNARA_CREDS_COMMONS_H */
/* * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ /* * @file cynara-creds-commons.h * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> * @version 1.0 * @brief This file contains common APIs for Cynara credentials helper. */ #ifndef CYNARA_CREDS_COMMONS_H #define CYNARA_CREDS_COMMONS_H #ifdef __cplusplus extern "C" { #endif /* empty initial file */ #ifdef __cplusplus } #endif #endif /* CYNARA_CREDS_COMMONS_H */
--- +++ @@ -16,6 +16,8 @@ /* * @file cynara-creds-commons.h * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> + * @author Radoslaw Bartosiak <r.bartosiak@samsung.com> + * @author Aleksander Zdyb <a.zdyb@partner.samsung.com> * @version 1.0 * @brief This file contains common APIs for Cynara credentials helper. */ @@ -23,6 +25,16 @@ #ifndef CYNARA_CREDS_COMMONS_H #define CYNARA_CREDS_COMMONS_H + +enum cynara_client_creds { + CLIENT_METHOD_SMACK, + CLIENT_METHOD_PID +}; + +enum cynara_user_creds { + USER_METHOD_UID, + USER_METHOD_GID +}; #ifdef __cplusplus extern "C" {
Add enums for credentials acquire methods Change-Id: I5719a7622a78ae6d1ca86a7dcce986c69abb3e23
apache-2.0
Samsung/cynara,Samsung/cynara,pohly/cynara,pohly/cynara,pohly/cynara,Samsung/cynara
7558b9540b6c51b9822c63bbbdf42da282b1a7c1
struct test { int a[3]; char b[2]; long c; }; int sum(struct test *t) { int sum = 0; sum += t->a[0] + t->a[1] + t->a[2]; sum += t->b[0] + t->b[1]; sum += t->c; return sum; } int main() { struct test t1 = { .a = { 1, 2, 3 }, .b = { 'a', 'c' }, .c = -1 }; struct test t2 = t1; t2.b[0] = 32; t2.a[0] = 12; t2.a[2] = 1; return (sum(&t1) + sum(&t2)) % 256; }
struct test { int a[3]; char b[2]; long c; }; int sum(struct test *t) { int sum = 0; sum += t->a[0] + t->a[1] + t->a[2]; sum += t->b[0] + t->b[1] + t->b[2]; sum += t->c; return sum; } int main() { struct test t1 = { .a = { 1, 2, 3 }, .b = { 'a', 'c' }, .c = -1 }; struct test t2 = t1; t2.b[0] = 32; t2.a[0] = 12; t2.a[2] = 1; return (sum(&t1) + sum(&t2)) % 256; }
--- +++ @@ -7,7 +7,7 @@ int sum(struct test *t) { int sum = 0; sum += t->a[0] + t->a[1] + t->a[2]; - sum += t->b[0] + t->b[1] + t->b[2]; + sum += t->b[0] + t->b[1]; sum += t->c; return sum; }
Fix overflow in test case
bsd-3-clause
lxp/sulong,crbb/sulong,PrinzKatharina/sulong,crbb/sulong,lxp/sulong,lxp/sulong,crbb/sulong,PrinzKatharina/sulong,lxp/sulong,PrinzKatharina/sulong,crbb/sulong,PrinzKatharina/sulong
555ea52bfbef491555015a27c5d4d6bdcca14d07
#ifndef AL_EVENT_H #define AL_EVENT_H #include "AL/al.h" #include "AL/alc.h" struct EffectState; enum { /* End event thread processing. */ EventType_KillThread = 0, /* User event types. */ EventType_SourceStateChange = 1<<0, EventType_BufferCompleted = 1<<1, EventType_Error = 1<<2, EventType_Performance = 1<<3, EventType_Deprecated = 1<<4, EventType_Disconnected = 1<<5, /* Internal events. */ EventType_ReleaseEffectState = 65536, }; struct AsyncEvent { unsigned int EnumType{0u}; union { char dummy; struct { ALuint id; ALenum state; } srcstate; struct { ALuint id; ALsizei count; } bufcomp; struct { ALenum type; ALuint id; ALuint param; ALchar msg[232]; } user; EffectState *mEffectState; } u{}; AsyncEvent() noexcept = default; constexpr AsyncEvent(unsigned int type) noexcept : EnumType{type} { } }; void StartEventThrd(ALCcontext *ctx); void StopEventThrd(ALCcontext *ctx); #endif
#ifndef AL_EVENT_H #define AL_EVENT_H #include "AL/al.h" #include "AL/alc.h" struct EffectState; enum { /* End event thread processing. */ EventType_KillThread = 0, /* User event types. */ EventType_SourceStateChange = 1<<0, EventType_BufferCompleted = 1<<1, EventType_Error = 1<<2, EventType_Performance = 1<<3, EventType_Deprecated = 1<<4, EventType_Disconnected = 1<<5, /* Internal events. */ EventType_ReleaseEffectState = 65536, }; struct AsyncEvent { unsigned int EnumType{0u}; union { char dummy; struct { ALuint id; ALenum state; } srcstate; struct { ALuint id; ALsizei count; } bufcomp; struct { ALenum type; ALuint id; ALuint param; ALchar msg[1008]; } user; EffectState *mEffectState; } u{}; AsyncEvent() noexcept = default; constexpr AsyncEvent(unsigned int type) noexcept : EnumType{type} { } }; void StartEventThrd(ALCcontext *ctx); void StopEventThrd(ALCcontext *ctx); #endif
--- +++ @@ -39,7 +39,7 @@ ALenum type; ALuint id; ALuint param; - ALchar msg[1008]; + ALchar msg[232]; } user; EffectState *mEffectState; } u{};
Reduce the AsyncEvent struct size The "user" message length is significantly reduced to fit the struct in 256 bytes, rather than 1KB.
lgpl-2.1
aaronmjacobs/openal-soft,aaronmjacobs/openal-soft
4917024c9485d5ed3362ddcb1a0d0f8ee45dfedc
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // version: $Id$ // author: Timur Pocheptsov <Timur.Pocheptsov@cern.ch> //------------------------------------------------------------------------------ #ifndef CLING_DISPLAY_H #define CLING_DISPLAY_H #include <string> namespace llvm { class raw_ostream; } namespace cling { class Interpreter; void DisplayClasses(llvm::raw_ostream &stream, const Interpreter *interpreter, bool verbose); void DisplayClass(llvm::raw_ostream &stream, const Interpreter *interpreter, const char *className, bool verbose); void DisplayGlobals(llvm::raw_ostream &stream, const Interpreter *interpreter); void DisplayGlobal(llvm::raw_ostream &stream, const Interpreter *interpreter, const std::string &name); } #endif
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // version: $Id$ // author: Timur Pocheptsov <Timur.Pocheptsov@cern.ch> //------------------------------------------------------------------------------ #ifndef CLING_DISPLAY_H #define CLING_DISPLAY_H #include <string> namespace llvm { class raw_ostream; } namespace cling { void DisplayClasses(llvm::raw_ostream &stream, const class Interpreter *interpreter, bool verbose); void DisplayClass(llvm::raw_ostream &stream, const Interpreter *interpreter, const char *className, bool verbose); void DisplayGlobals(llvm::raw_ostream &stream, const Interpreter *interpreter); void DisplayGlobal(llvm::raw_ostream &stream, const Interpreter *interpreter, const std::string &name); } #endif
--- +++ @@ -14,9 +14,10 @@ } namespace cling { +class Interpreter; void DisplayClasses(llvm::raw_ostream &stream, - const class Interpreter *interpreter, bool verbose); + const Interpreter *interpreter, bool verbose); void DisplayClass(llvm::raw_ostream &stream, const Interpreter *interpreter, const char *className, bool verbose);
Fix fwd decl for windows. git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@47814 27541ba8-7e3a-0410-8455-c3a389f83636
lgpl-2.1
bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT
8ae331ba0b6f64564519e9e5618ec035bb54038f
#import <Foundation/Foundation.h> #import "OCDSpec/Protocols/DescriptionRunner.h" #import "OCDSpec/OCDSpecDescription.h" #import "OCDSpec/OCDSpecSharedResults.h" #import "OCDSpec/Abstract/AbstractDescriptionRunner.h" @interface OCDSpecDescriptionRunner : NSObject { Class *classes; int classCount; id specProtocol; id baseClass; int successes; int failures; } @property(nonatomic, assign) id specProtocol; @property(nonatomic, assign) id baseClass; @property(readonly) int successes; @property(readonly) int failures; -(void) runAllDescriptions; @end #define CONTEXT(classname) \ void descriptionOf##classname();\ @interface TestRunner##classname : AbstractDescriptionRunner \ @end\ @implementation TestRunner##classname\ +(int) getFailures \ { \ return [[OCDSpecSharedResults sharedResults].failures intValue];\ } \ +(int)getSuccesses \ { \ return [[OCDSpecSharedResults sharedResults].successes intValue];\ } \ +(void) run \ { \ descriptionOf##classname(); \ } \ @end \ void descriptionOf##classname()
#import <Foundation/Foundation.h> #import "OCDSpec/Protocols/DescriptionRunner.h" #import "OCDSpec/OCDSpecDescription.h" #import "OCDSpec/OCDSpecSharedResults.h" #import "OCDSpec/AbstractDescriptionRunner.h" @interface OCDSpecDescriptionRunner : NSObject { Class *classes; int classCount; id specProtocol; id baseClass; int successes; int failures; } @property(nonatomic, assign) id specProtocol; @property(nonatomic, assign) id baseClass; @property(readonly) int successes; @property(readonly) int failures; -(void) runAllDescriptions; @end #define CONTEXT(classname) \ void descriptionOf##classname();\ @interface TestRunner##classname : AbstractDescriptionRunner \ @end\ @implementation TestRunner##classname\ +(int) getFailures \ { \ return [[OCDSpecSharedResults sharedResults].failures intValue];\ } \ +(int)getSuccesses \ { \ return [[OCDSpecSharedResults sharedResults].successes intValue];\ } \ +(void) run \ { \ descriptionOf##classname(); \ } \ @end \ void descriptionOf##classname()
--- +++ @@ -2,7 +2,7 @@ #import "OCDSpec/Protocols/DescriptionRunner.h" #import "OCDSpec/OCDSpecDescription.h" #import "OCDSpec/OCDSpecSharedResults.h" -#import "OCDSpec/AbstractDescriptionRunner.h" +#import "OCDSpec/Abstract/AbstractDescriptionRunner.h" @interface OCDSpecDescriptionRunner : NSObject {
Correct the project for the move
mit
paytonrules/OCDSpec,paytonrules/OCDSpec
75338467e66fd3c862a0a48363c3f4681f30180a
#ifndef _GL_H_ #define _GL_H_ #if defined __APPLE__ #include <OpenGLES/ES2/gl.h> #include <OpenGLES/ES2/glext.h> #elif defined GL_ES #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include <importgl.h> #else //#define GL_GLEXT_PROTOTYPES #ifdef WIN32 #include <GL/glew.h> #include <windows.h> #endif #ifdef __ANDROID__ #include <importgl.h> #else #include <GL/gl.h> #ifdef _WIN32 #include "../system/win32/glext.h" #else #include <GL/glext.h> #endif #endif #endif #endif
#ifndef _GL_H_ #define _GL_H_ #if defined __APPLE__ #include <OpenGLES/ES3/gl.h> #include <OpenGLES/ES3/glext.h> #elif defined GL_ES #include <GLES3/gl3.h> #include <EGL/egl.h> #include <EGL/eglext.h> #else #define GL_GLEXT_PROTOTYPES #ifdef WIN32 #include <GL/glew.h> #include <windows.h> #endif #ifdef __ANDROID__ #include <GLES3/gl3.h> #include <GLES3/gl3ext.h> #else #include <GL/gl.h> #ifdef _WIN32 #include "../system/win32/glext.h" #else #include <GL/glext.h> #endif #endif #endif #endif
--- +++ @@ -2,14 +2,16 @@ #define _GL_H_ #if defined __APPLE__ -#include <OpenGLES/ES3/gl.h> -#include <OpenGLES/ES3/glext.h> +#include <OpenGLES/ES2/gl.h> +#include <OpenGLES/ES2/glext.h> #elif defined GL_ES -#include <GLES3/gl3.h> +#include <GLES2/gl2.h> +#include <GLES2/gl2ext.h> #include <EGL/egl.h> #include <EGL/eglext.h> +#include <importgl.h> #else -#define GL_GLEXT_PROTOTYPES +//#define GL_GLEXT_PROTOTYPES #ifdef WIN32 #include <GL/glew.h> @@ -17,8 +19,7 @@ #endif #ifdef __ANDROID__ -#include <GLES3/gl3.h> -#include <GLES3/gl3ext.h> +#include <importgl.h> #else #include <GL/gl.h>
Remove gl includes from __ANDROID__
mit
Sometrik/framework,Sometrik/framework,Sometrik/framework
954ca58264801b7a4cac4b3bc53d0bd01feaca92
#ifndef READLINE_FALLBACK_H #define READLINE_FALLBACK_H #include <stdio.h> #include <string.h> char* readline(const char * prompt) { char *result = malloc(1024); printf("%s", prompt); fgets(result, 1023, stdin); result[strlen(result)-1] = 0; return result; } #endif /* READLINE_FALLBACK_H */
#ifndef READLINE_FALLBACK_H #define READLINE_FALLBACK_H #include <stdio.h> #include <string.h> char* readline(const char * prompt) { char *result = malloc(1); size_t n = 0; printf("%s", prompt); getline(&result, &n, stdin); result[strlen(result)-1] = 0; return result; } #endif /* READLINE_FALLBACK_H */
--- +++ @@ -5,10 +5,9 @@ #include <string.h> char* readline(const char * prompt) { - char *result = malloc(1); - size_t n = 0; + char *result = malloc(1024); printf("%s", prompt); - getline(&result, &n, stdin); + fgets(result, 1023, stdin); result[strlen(result)-1] = 0; return result; }
Use fgets(3) instead of getline(3) because whilst getline(3) is POSIX, it is not in the C89 or later standards
isc
lucasad/base-conv
5d02ce6786c9b7bd1f434826c4929b4233b5ae58
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifdef __cplusplus extern "C" { #endif #ifndef HTMLLEX_H #define HTMLLEX_H #include <agxbuf.h> extern int initHTMLlexer(char *, agxbuf *, int); extern int htmllex(void); extern int htmllineno(void); extern int clearHTMLlexer(void); void htmlerror(const char *); #endif #ifdef __cplusplus } #endif
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifdef __cplusplus extern "C" { #endif #ifndef HTMLLEX_H #define HTMLLEX_H #include <agxbuf.h> extern int initHTMLlexer(char *, agxbuf *); extern int htmllex(void); extern int htmllineno(void); extern int clearHTMLlexer(void); void htmlerror(const char *); #endif #ifdef __cplusplus } #endif
--- +++ @@ -23,7 +23,7 @@ #include <agxbuf.h> - extern int initHTMLlexer(char *, agxbuf *); + extern int initHTMLlexer(char *, agxbuf *, int); extern int htmllex(void); extern int htmllineno(void); extern int clearHTMLlexer(void);
Add support for charset attribute and Latin1 encoding.
epl-1.0
kbrock/graphviz,pixelglow/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,kbrock/graphviz,tkelman/graphviz,MjAbuz/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,tkelman/graphviz,tkelman/graphviz,ellson/graphviz,jho1965us/graphviz,MjAbuz/graphviz,pixelglow/graphviz,pixelglow/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,MjAbuz/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz,jho1965us/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,ellson/graphviz,jho1965us/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,kbrock/graphviz,ellson/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,jho1965us/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,BMJHayward/graphviz,kbrock/graphviz,jho1965us/graphviz,MjAbuz/graphviz,kbrock/graphviz,pixelglow/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,jho1965us/graphviz,BMJHayward/graphviz,pixelglow/graphviz,tkelman/graphviz,tkelman/graphviz,tkelman/graphviz,jho1965us/graphviz,kbrock/graphviz,pixelglow/graphviz,pixelglow/graphviz,tkelman/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,kbrock/graphviz,ellson/graphviz,BMJHayward/graphviz,jho1965us/graphviz,MjAbuz/graphviz,kbrock/graphviz,pixelglow/graphviz,tkelman/graphviz,pixelglow/graphviz
ccac208ec5892857a5847a12b098d2358e023f7c
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessageUnknown, WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, WMFWKScriptMessageArticleState }; @interface WKScriptMessage (WMFScriptMessage) + (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name; + (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type; @end
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, WMFWKScriptMessageArticleState, WMFWKScriptMessageUnknown }; @interface WKScriptMessage (WMFScriptMessage) + (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name; + (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type; @end
--- +++ @@ -1,6 +1,7 @@ #import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { + WMFWKScriptMessageUnknown, WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, @@ -9,8 +10,7 @@ WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, - WMFWKScriptMessageArticleState, - WMFWKScriptMessageUnknown + WMFWKScriptMessageArticleState }; @interface WKScriptMessage (WMFScriptMessage)
Move unknown enum entry to top.
mit
montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios
78604e09580cac8f6e3adcb79e250adad46b04f7
//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.h ------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #define LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #include "TargetHandler.h" #include "lld/Core/Reference.h" namespace lld { namespace elf { template<typename ELFT> class MipsTargetLayout; class MipsRelocationHandler : public TargetRelocationHandler { public: virtual Reference::Addend readAddend(Reference::KindValue kind, const uint8_t *content) const = 0; }; template <class ELFT> std::unique_ptr<TargetRelocationHandler> createMipsRelocationHandler(MipsLinkingContext &ctx, MipsTargetLayout<ELFT> &layout); } // elf } // lld #endif
//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.h ------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #define LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #include "TargetHandler.h" #include "lld/Core/Reference.h" namespace lld { namespace elf { template<typename ELFT> class MipsTargetLayout; class MipsRelocationHandler : public TargetRelocationHandler { public: virtual Reference::Addend readAddend(Reference::KindValue kind, const uint8_t *content) const = 0; }; template <class ELFT> std::unique_ptr<TargetRelocationHandler> createMipsRelocationHandler(MipsLinkingContext &ctx, MipsTargetLayout<ELFT> &layout); } // elf } // lld #endif
--- +++ @@ -25,7 +25,8 @@ template <class ELFT> std::unique_ptr<TargetRelocationHandler> -createMipsRelocationHandler(MipsLinkingContext &ctx, MipsTargetLayout<ELFT> &layout); +createMipsRelocationHandler(MipsLinkingContext &ctx, + MipsTargetLayout<ELFT> &layout); } // elf } // lld
[Mips] Reformat the code with clang-format git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@234153 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/lld,llvm-mirror/lld
da66946ecd7257482a58d6eee247012d9e5250e9
// (C) Copyright 2017, Google 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. // Portability include to match the Google test environment. #ifndef TESSERACT_UNITTEST_INCLUDE_GUNIT_H_ #define TESSERACT_UNITTEST_INCLUDE_GUNIT_H_ #include "gtest/gtest.h" #include "errcode.h" // for ASSERT_HOST #include "fileio.h" // for tesseract::File const char* FLAGS_test_tmpdir = "."; class file: public tesseract::File { }; #define CHECK(test) ASSERT_HOST(test) #endif // TESSERACT_UNITTEST_INCLUDE_GUNIT_H_
// (C) Copyright 2017, Google 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. // Portability include to match the Google test environment. #ifndef TESSERACT_UNITTEST_INCLUDE_GUNIT_H_ #define TESSERACT_UNITTEST_INCLUDE_GUNIT_H_ #include "gtest/gtest.h" #endif // TESSERACT_UNITTEST_INCLUDE_GUNIT_H_
--- +++ @@ -9,9 +9,19 @@ // See the License for the specific language governing permissions and // limitations under the License. // Portability include to match the Google test environment. + #ifndef TESSERACT_UNITTEST_INCLUDE_GUNIT_H_ #define TESSERACT_UNITTEST_INCLUDE_GUNIT_H_ #include "gtest/gtest.h" +#include "errcode.h" // for ASSERT_HOST +#include "fileio.h" // for tesseract::File + +const char* FLAGS_test_tmpdir = "."; + +class file: public tesseract::File { +}; + +#define CHECK(test) ASSERT_HOST(test) #endif // TESSERACT_UNITTEST_INCLUDE_GUNIT_H_
Add more portability hacks for Google test environment Signed-off-by: Stefan Weil <8d4c780fcfdc41841e5070f4c43da8958ba6aec0@weilnetz.de>
apache-2.0
UB-Mannheim/tesseract,stweil/tesseract,jbarlow83/tesseract,jbarlow83/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,amitdo/tesseract,stweil/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,amitdo/tesseract,amitdo/tesseract,jbarlow83/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,jbarlow83/tesseract,stweil/tesseract,amitdo/tesseract,amitdo/tesseract,stweil/tesseract,jbarlow83/tesseract,tesseract-ocr/tesseract,stweil/tesseract
f0337c2d1afb2774e6e58b2084f769d3436e5b1e
//********************************************************************* //* C_Base64 - a simple base64 encoder and decoder. //* //* Copyright (c) 1999, Bob Withers - bwit@pobox.com //* //* This code may be freely used for any purpose, either personal //* or commercial, provided the authors copyright notice remains //* intact. //********************************************************************* #ifndef Base64_H #define Base64_H #include <string> using std::string; // comment if your compiler doesn't use namespaces class Base64 { public: static string encode(const string & data); static string decode(const string & data); static string encodeFromArray(const char * data, size_t len); private: static const string Base64Table; static const string::size_type DecodeTable[]; }; #endif
//********************************************************************* //* C_Base64 - a simple base64 encoder and decoder. //* //* Copyright (c) 1999, Bob Withers - bwit@pobox.com //* //* This code may be freely used for any purpose, either personal //* or commercial, provided the authors copyright notice remains //* intact. //********************************************************************* #ifndef Base64_H #define Base64_H #include <string> using std::string; // comment if your compiler doesn't use namespaces class Base64 { public: static string encode(const string & data); static string decode(const string & data); static string encodeFromArray(const char * data, size_t len); private: static const string Base64::Base64Table; static const string::size_type Base64::DecodeTable[]; }; #endif
--- +++ @@ -22,8 +22,8 @@ static string decode(const string & data); static string encodeFromArray(const char * data, size_t len); private: - static const string Base64::Base64Table; - static const string::size_type Base64::DecodeTable[]; + static const string Base64Table; + static const string::size_type DecodeTable[]; }; #endif
Make it build with gcc 4.1 svn path=/branches/kopete/0.12/kopete/; revision=518337
lgpl-2.1
josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete
cb094452ae663fbc04e8f7c01f3864dee30bf98f
#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; }
#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; }
--- +++ @@ -8,7 +8,7 @@ #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, - int nShowCmd) + int nCmdShow) { LPWSTR *szArgList; int argCount;
Rename WinMain argument nShowCmd "nCmdShow"
mit
dbohdan/messagebox,dbohdan/messagebox
6f5644a98919e0583f134876de768497a769f5fe
#include "e.h" EINTERN int e_log_dom = -1; static const char *_names[] = { "CRI", "ERR", "WRN", "INF", "DBG", }; static void _e_log_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc EINA_UNUSED, int line, const char *fmt, void *data EINA_UNUSED, va_list args) { const char *color; color = eina_log_level_color_get(level); fprintf(stdout, "%s%s<" EINA_COLOR_RESET "%s%s>" EINA_COLOR_RESET "%s:%d" EINA_COLOR_RESET " ", color, _names[level > EINA_LOG_LEVEL_DBG ? EINA_LOG_LEVEL_DBG : level], d->domain_str, color, file, line); vfprintf(stdout, fmt, args); putc('\n', stdout); } EINTERN int e_log_init(void) { e_log_dom = eina_log_domain_register("e", EINA_COLOR_WHITE); eina_log_print_cb_set(_e_log_cb, NULL); return e_log_dom != -1; } EINTERN int e_log_shutdown(void) { eina_log_domain_unregister(e_log_dom); e_log_dom = -1; return 0; }
#include "e.h" EINTERN int e_log_dom = -1; EINTERN int e_log_init(void) { e_log_dom = eina_log_domain_register("e", EINA_COLOR_WHITE); return e_log_dom != -1; } EINTERN int e_log_shutdown(void) { eina_log_domain_unregister(e_log_dom); e_log_dom = -1; return 0; }
--- +++ @@ -1,11 +1,34 @@ #include "e.h" EINTERN int e_log_dom = -1; + +static const char *_names[] = { + "CRI", + "ERR", + "WRN", + "INF", + "DBG", +}; + +static void +_e_log_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc EINA_UNUSED, int line, const char *fmt, void *data EINA_UNUSED, va_list args) +{ + const char *color; + + color = eina_log_level_color_get(level); + fprintf(stdout, + "%s%s<" EINA_COLOR_RESET "%s%s>" EINA_COLOR_RESET "%s:%d" EINA_COLOR_RESET " ", + color, _names[level > EINA_LOG_LEVEL_DBG ? EINA_LOG_LEVEL_DBG : level], + d->domain_str, color, file, line); + vfprintf(stdout, fmt, args); + putc('\n', stdout); +} EINTERN int e_log_init(void) { e_log_dom = eina_log_domain_register("e", EINA_COLOR_WHITE); + eina_log_print_cb_set(_e_log_cb, NULL); return e_log_dom != -1; }
Revert "e logs - the custom e log func breaks eina backtraces, so don't use it" This reverts commit 2df04042269f3b5604c719844eac372fa5fcddd2. let's not do this in all cases
bsd-2-clause
tasn/enlightenment,rvandegrift/e,rvandegrift/e,rvandegrift/e,tasn/enlightenment,tasn/enlightenment
6a8cbb53dad28508f0fbb893ce37defbbec11a49
/* * AVR32 endian-conversion functions. */ #ifndef __ASM_AVR32_BYTEORDER_H #define __ASM_AVR32_BYTEORDER_H #include <asm/types.h> #include <linux/compiler.h> #ifdef __CHECKER__ extern unsigned long __builtin_bswap_32(unsigned long x); extern unsigned short __builtin_bswap_16(unsigned short x); #endif /* * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends * the result. */ #if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2) #define __arch__swab32(x) __builtin_bswap_32(x) #define __arch__swab16(x) __builtin_bswap_16(x) #endif #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) # define __BYTEORDER_HAS_U64__ # define __SWAB_64_THRU_32__ #endif #include <linux/byteorder/big_endian.h> #endif /* __ASM_AVR32_BYTEORDER_H */
/* * AVR32 endian-conversion functions. */ #ifndef __ASM_AVR32_BYTEORDER_H #define __ASM_AVR32_BYTEORDER_H #include <asm/types.h> #include <linux/compiler.h> #ifdef __CHECKER__ extern unsigned long __builtin_bswap_32(unsigned long x); extern unsigned short __builtin_bswap_16(unsigned short x); #endif #define __arch__swab32(x) __builtin_bswap_32(x) #define __arch__swab16(x) __builtin_bswap_16(x) #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) # define __BYTEORDER_HAS_U64__ # define __SWAB_64_THRU_32__ #endif #include <linux/byteorder/big_endian.h> #endif /* __ASM_AVR32_BYTEORDER_H */
--- +++ @@ -12,8 +12,14 @@ extern unsigned short __builtin_bswap_16(unsigned short x); #endif +/* + * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends + * the result. + */ +#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2) #define __arch__swab32(x) __builtin_bswap_32(x) #define __arch__swab16(x) __builtin_bswap_16(x) +#endif #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) # define __BYTEORDER_HAS_U64__
avr32: Work around byteswap bug in gcc < 4.2 gcc versions earlier than 4.2 sign-extends the result of le16_to_cpu() and friends when we implement __arch__swabX() using __builtin_bswap_X(). Disable our arch-specific optimizations when those gcc versions are being used. Signed-off-by: Haavard Skinnemoen <de7418319212d7eab32260a76732c1f83e514852@atmel.com>
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
bafe68034e3ef5e9f512bd0468001caf34981c41
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=aarch64-apple-darwin -S -o - %s | FileCheck %s // REQUIRES: aarch64-registered-target float fma_test1(float a, float b, float c) { // CHECK: fmadd float x = a * b; float y = x + c; return y; }
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s // REQUIRES: powerpc-registered-target float fma_test1(float a, float b, float c) { // CHECK: fmadds float x = a * b; float y = x + c; return y; }
--- +++ @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s -// REQUIRES: powerpc-registered-target +// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=aarch64-apple-darwin -S -o - %s | FileCheck %s +// REQUIRES: aarch64-registered-target float fma_test1(float a, float b, float c) { -// CHECK: fmadds +// CHECK: fmadd float x = a * b; float y = x + c; return y;
Change -ffp-contract=fast test to run on Aarch64 (I don't have powerpc enabled in my build and I am changing how -ffp-contract=fast works.) git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@298468 91177308-0d34-0410-b5e6-96231b3b80d8
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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
fa33394bb70481412493fcf40d53ebdb2e738058
// Copyright (c) 2010 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 PPAPI_C_PPB_FIND_H_ #define PPAPI_C_PPB_FIND_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_stdint.h" #define PPB_FIND_INTERFACE "PPB_Find;1" typedef struct _ppb_Find { // Updates the number of find results for the current search term. If // there are no matches 0 should be passed in. Only when the plugin has // finished searching should it pass in the final count with finalResult set // to true. void (*NumberOfFindResultsChanged)(PP_Instance instance, int32_t total, bool final_result); // Updates the index of the currently selected search item. void (*SelectedFindResultChanged)(PP_Instance instance, int32_t index); } PPB_Find; #endif // PPAPI_C_PPB_FIND_H_
// Copyright (c) 2010 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 PPAPI_C_PPB_FIND_H_ #define PPAPI_C_PPB_FIND_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_stdint.h" #define PPB_FIND_INTERFACE "PPB_Find;1" typedef struct _ppb_Find { // Updates the number of find results for the current search term. If // there are no matches 0 should be passed in. Only when the plugin has // finished searching should it pass in the final count with finalResult set // to true. void NumberOfFindResultsChanged(PP_Instance instance, int32_t total, bool final_result); // Updates the index of the currently selected search item. void SelectedFindResultChanged(PP_Instance instance, int32_t index); } PPB_Find; #endif // PPAPI_C_PPB_FIND_H_
--- +++ @@ -15,13 +15,13 @@ // there are no matches 0 should be passed in. Only when the plugin has // finished searching should it pass in the final count with finalResult set // to true. - void NumberOfFindResultsChanged(PP_Instance instance, - int32_t total, - bool final_result); + void (*NumberOfFindResultsChanged)(PP_Instance instance, + int32_t total, + bool final_result); // Updates the index of the currently selected search item. - void SelectedFindResultChanged(PP_Instance instance, - int32_t index); + void (*SelectedFindResultChanged)(PP_Instance instance, + int32_t index); } PPB_Find;
Structure member should be function pointer BUG=none TEST=compiles Review URL: http://codereview.chromium.org/2972004
bsd-3-clause
tiaolong/ppapi,lag945/ppapi,nanox/ppapi,CharlesHuimin/ppapi,c1soju96/ppapi,qwop/ppapi,nanox/ppapi,siweilvxing/ppapi,siweilvxing/ppapi,xinghaizhou/ppapi,xiaozihui/ppapi,whitewolfm/ppapi,dingdayong/ppapi,xinghaizhou/ppapi,ruder/ppapi,fubaydullaev/ppapi,xuesongzhu/ppapi,xinghaizhou/ppapi,rise-worlds/ppapi,cacpssl/ppapi,thdtjsdn/ppapi,xiaozihui/ppapi,phisixersai/ppapi,chenfeng8742/ppapi,JustRight/ppapi,lag945/ppapi,xinghaizhou/ppapi,c1soju96/ppapi,HAfsari/ppapi,siweilvxing/ppapi,tonyjoule/ppapi,gwobay/ppapi,huochetou999/ppapi,stefanie924/ppapi,huochetou999/ppapi,YachaoLiu/ppapi,lag945/ppapi,ruder/ppapi,xiaozihui/ppapi,Xelemsta/ppapi,huochetou999/ppapi,cacpssl/ppapi,YachaoLiu/ppapi,thdtjsdn/ppapi,huqingyu/ppapi,dralves/ppapi,dingdayong/ppapi,nanox/ppapi,HAfsari/ppapi,fubaydullaev/ppapi,phisixersai/ppapi,xuesongzhu/ppapi,gwobay/ppapi,JustRight/ppapi,siweilvxing/ppapi,chenfeng8742/ppapi,fubaydullaev/ppapi,YachaoLiu/ppapi,lag945/ppapi,tonyjoule/ppapi,huqingyu/ppapi,huqingyu/ppapi,fubaydullaev/ppapi,qwop/ppapi,chenfeng8742/ppapi,Xelemsta/ppapi,cacpssl/ppapi,dingdayong/ppapi,rise-worlds/ppapi,gwobay/ppapi,dralves/ppapi,thdtjsdn/ppapi,tonyjoule/ppapi,ruder/ppapi,CharlesHuimin/ppapi,YachaoLiu/ppapi,tonyjoule/ppapi,CharlesHuimin/ppapi,JustRight/ppapi,dingdayong/ppapi,CharlesHuimin/ppapi,tiaolong/ppapi,c1soju96/ppapi,gwobay/ppapi,JustRight/ppapi,tonyjoule/ppapi,chenfeng8742/ppapi,xiaozihui/ppapi,rise-worlds/ppapi,xinghaizhou/ppapi,qwop/ppapi,whitewolfm/ppapi,CharlesHuimin/ppapi,phisixersai/ppapi,fubaydullaev/ppapi,tiaolong/ppapi,qwop/ppapi,xuesongzhu/ppapi,YachaoLiu/ppapi,thdtjsdn/ppapi,huochetou999/ppapi,lag945/ppapi,phisixersai/ppapi,HAfsari/ppapi,siweilvxing/ppapi,xuesongzhu/ppapi,dralves/ppapi,stefanie924/ppapi,tiaolong/ppapi,rise-worlds/ppapi,JustRight/ppapi,Xelemsta/ppapi,nanox/ppapi,phisixersai/ppapi,whitewolfm/ppapi,nanox/ppapi,dralves/ppapi,HAfsari/ppapi,qwop/ppapi,HAfsari/ppapi,gwobay/ppapi,stefanie924/ppapi,huochetou999/ppapi,chenfeng8742/ppapi,Xelemsta/ppapi,xuesongzhu/ppapi,cacpssl/ppapi,whitewolfm/ppapi,Xelemsta/ppapi,huqingyu/ppapi,huqingyu/ppapi,ruder/ppapi,ruder/ppapi,rise-worlds/ppapi,tiaolong/ppapi,whitewolfm/ppapi,dingdayong/ppapi,c1soju96/ppapi,c1soju96/ppapi,stefanie924/ppapi,thdtjsdn/ppapi,xiaozihui/ppapi,cacpssl/ppapi,stefanie924/ppapi,dralves/ppapi
c49e05ca04116a78b2a960f3a05dce6319582a8f
// Copyright (c) 2010 Timur Iskhodzhanov and others. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_COMMON_H_ #define BASE_COMMON_H_ #include <assert.h> // Use CHECK instead of assert. // TODO(timurrrr): print stack trace when hitting a CHECK while preserving // "abort trap" feature on both Windows and POSIX. #define CHECK(x) assert(x) #ifdef _DEBUG #define DCHECK(x) CHECK(x) #else #define DCHECK(x) do { } while (0 && (x)) #endif // Use this macro to disable copy constructor and operator= for CLASS_NAME. See // http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Copy_Constructors#Copy_Constructors #define DISALLOW_COPY_AND_ASSIGN(CLASS_NAME) \ CLASS_NAME(const CLASS_NAME &); \ void operator=(const CLASS_NAME &); #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) typedef unsigned char uchar; typedef unsigned char byte; typedef unsigned short ushort; typedef unsigned int uint; const uint MAX_UINT = 0xFFFFFFFF; // TODO(timurrrr): add 64-bit and ptr type values when necessary. #endif // BASE_COMMON_H_
// Copyright (c) 2010 Timur Iskhodzhanov and others. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_COMMON_H_ #define BASE_COMMON_H_ #include <assert.h> // Use CHECK instead of assert. // TODO(timurrrr): print stack trace when hitting a CHECK while preserving // "abort trap" feature on both Windows and POSIX. #define CHECK(x) assert(x) #ifdef _DEBUG #define DCHECK(x) do { } while (0 && (x)) #else #define DCHECK(x) CHECK(x) #endif // Use this macro to disable copy constructor and operator= for CLASS_NAME. See // http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Copy_Constructors#Copy_Constructors #define DISALLOW_COPY_AND_ASSIGN(CLASS_NAME) \ CLASS_NAME(const CLASS_NAME &); \ void operator=(const CLASS_NAME &); #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) typedef unsigned char uchar; typedef unsigned char byte; typedef unsigned short ushort; typedef unsigned int uint; const uint MAX_UINT = 0xFFFFFFFF; // TODO(timurrrr): add 64-bit and ptr type values when necessary. #endif // BASE_COMMON_H_
--- +++ @@ -12,9 +12,9 @@ #define CHECK(x) assert(x) #ifdef _DEBUG +#define DCHECK(x) CHECK(x) +#else #define DCHECK(x) do { } while (0 && (x)) -#else -#define DCHECK(x) CHECK(x) #endif // Use this macro to disable copy constructor and operator= for CLASS_NAME. See
Fix a stupid mistake in DCHECK definition
bsd-3-clause
denfromufa/mipt-course,denfromufa/mipt-course,denfromufa/mipt-course,denfromufa/mipt-course
3132fa5c86cfa9e9a35666829dd6117e84234b5c
#include "stdio.h" #include "stdbool.h" bool checkPythagoreanTriplet(int a, int b, int c); bool checkPythagoreanTriplet(int a, int b, int c) { if ((a * a) + (b * b) == (c * c)) { return true; } else { return false; } } int main(int argc, char const *argv[]) { int i; int j; int k; for (i = 1; i < 1000; i++) { for (j = i; j < (1000 - i); j++) { for (k = j; k < (1000 - j); k++) { if (checkPythagoreanTriplet(i, j, k) && (i + j + k) == 1000) { printf("%d %d %d\n", i, j, k); printf("%d\n", (i * j * k)); break; } } } } return 0; }
#include "stdio.h" #include "stdbool.h" bool checkPythagoreanTriplet (int a, int b, int c); bool checkPythagoreanTriplet (int a, int b, int c) { if((a*a) + (b*b) == (c*c)) { return true; } else { return false; } } int main(int argc, char const *argv[]) { int i; int j; int k; for(i=1; i < 1000; i++) { for(j=i; j < (1000 - i); j++) { for(k=j; k < (1000 - j); k++){ if(checkPythagoreanTriplet(i,j,k) && (i + j + k) == 1000) { printf("%d %d %d\n", i, j, k); printf("%d\n", (i*j*k)); break; } } } } return 0; }
--- +++ @@ -1,31 +1,40 @@ #include "stdio.h" #include "stdbool.h" -bool checkPythagoreanTriplet (int a, int b, int c); +bool checkPythagoreanTriplet(int a, int b, int c); -bool checkPythagoreanTriplet (int a, int b, int c) { - if((a*a) + (b*b) == (c*c)) { - return true; - } else { - return false; +bool checkPythagoreanTriplet(int a, int b, int c) +{ + if ((a * a) + (b * b) == (c * c)) + { + return true; + } + else + { + return false; } } -int main(int argc, char const *argv[]) { - int i; - int j; - int k; - - for(i=1; i < 1000; i++) { - for(j=i; j < (1000 - i); j++) { - for(k=j; k < (1000 - j); k++){ - if(checkPythagoreanTriplet(i,j,k) && (i + j + k) == 1000) { - printf("%d %d %d\n", i, j, k); - printf("%d\n", (i*j*k)); - break; +int main(int argc, char const *argv[]) +{ + int i; + int j; + int k; + + for (i = 1; i < 1000; i++) + { + for (j = i; j < (1000 - i); j++) + { + for (k = j; k < (1000 - j); k++) + { + if (checkPythagoreanTriplet(i, j, k) && (i + j + k) == 1000) + { + printf("%d %d %d\n", i, j, k); + printf("%d\n", (i * j * k)); + break; } } } } - return 0; + return 0; }
Update format for Problem 9
mit
goparakeets21/Project_Euler
6506bf4e205944a671ddcc148a88273ddce92409
#include <pthread.h> #include "racemacros.h" int g; int *g1; int *g2; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex); access(*g1); pthread_mutex_lock(&mutex); return NULL; } int main(void) { g1 = g2 = &g; create_threads(t); pthread_mutex_lock(&mutex); assert_racefree(*g2); pthread_mutex_lock(&mutex); join_threads(t); return 0; }
#include <pthread.h> #include "racemacros.h" int g; int *g1; int *g2; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex); access(*g1); pthread_mutex_lock(&mutex); return NULL; } int main(void) { g1 = g2 = &g; create_threads(t); assert_racefree(*g2); // UNKNOWN join_threads(t); return 0; }
--- +++ @@ -18,9 +18,9 @@ g1 = g2 = &g; create_threads(t); - - assert_racefree(*g2); // UNKNOWN - + pthread_mutex_lock(&mutex); + assert_racefree(*g2); + pthread_mutex_lock(&mutex); join_threads(t); return 0; }
Fix 28/36 to actually be race free It was the same as 28/37.
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
15585314e9802d0c9d341fb9a6b396fd6520e8d4
// Copyright 2016, Jeffrey E. Bedard #include "temperature.h" #include "config.h" #include "font.h" #include "util.h" #include <stdio.h> static uint16_t get_offset(const uint16_t fw, const uint16_t offset, const uint8_t len) { return fw * len + offset + XSTATUS_CONST_WIDE_PAD + XSTATUS_CONST_PAD; } // Returns x offset for next item uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset) { const uint8_t v = xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE)/1000; uint8_t sz = 4; char buf[sz]; const struct JBDim f = xstatus_get_font_size(); sz = snprintf(buf, sz, "%dC", v); xcb_image_text_8(xc, sz, xstatus_get_window(xc), xstatus_get_gc(xc), offset + XSTATUS_CONST_WIDE_PAD, f.h, buf); return get_offset(f.w, offset, sz); }
// Copyright 2016, Jeffrey E. Bedard #include "temperature.h" #include "config.h" #include "font.h" #include "util.h" #include <stdio.h> #include <string.h> // Returns x offset for next item uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset) { const uint8_t v = xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE)/1000; uint8_t sz = 4; char buf[sz]; const struct JBDim f = xstatus_get_font_size(); sz = snprintf(buf, sz, "%dC", v); xcb_image_text_8(xc, sz, xstatus_get_window(xc), xstatus_get_gc(xc), offset + XSTATUS_CONST_WIDE_PAD, f.h, buf); return f.w * strlen(buf) + offset + XSTATUS_CONST_WIDE_PAD + XSTATUS_CONST_PAD; }
--- +++ @@ -4,7 +4,12 @@ #include "font.h" #include "util.h" #include <stdio.h> -#include <string.h> +static uint16_t get_offset(const uint16_t fw, const uint16_t offset, + const uint8_t len) +{ + return fw * len + offset + XSTATUS_CONST_WIDE_PAD + + XSTATUS_CONST_PAD; +} // Returns x offset for next item uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset) { @@ -16,6 +21,5 @@ sz = snprintf(buf, sz, "%dC", v); xcb_image_text_8(xc, sz, xstatus_get_window(xc), xstatus_get_gc(xc), offset + XSTATUS_CONST_WIDE_PAD, f.h, buf); - return f.w * strlen(buf) + offset + XSTATUS_CONST_WIDE_PAD - + XSTATUS_CONST_PAD; + return get_offset(f.w, offset, sz); }
Split out get_offset(). Eliminated unnecessary call to strlen().
mit
jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus
3a999bf6de5a6c4963f448c5498cd2c9c488d1a0
#include <glib.h> #if !GLIB_CHECK_VERSION (2, 40, 0) # define g_assert_true(expr) g_assert ((expr)) # define g_assert_false(expr) g_assert (!(expr)) # define g_assert_null(expr) g_assert ((expr) == NULL) # define g_assert_nonnull(expr) g_assert ((expr) != NULL) #endif #define graphene_assert_fuzzy_equals(n1,n2,epsilon) \ G_STMT_START { \ typeof ((n1)) __n1 = (n1); \ typeof ((n2)) __n2 = (n2); \ typeof ((epsilon)) __epsilon = (epsilon); \ if (__n1 > __n2) { \ if ((__n1 - __n2) < __epsilon) ; else { \ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ #n1 " == " #n2 " (+/- " #epsilon ")", \ __n1, "==", __n2, 'f'); \ } \ } else { \ if ((__n2 - __n1) < __epsilon) ; else { \ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ #n1 " == " #n2 " (+/- " #epsilon ")", \ __n1, "==", __n2, 'f'); \ } \ } \ } G_STMT_END
#include <glib.h> #if !GLIB_CHECK_VERSION (2, 40, 0) # define g_assert_true(expr) g_assert ((expr)) # define g_assert_false(expr) g_assert (!(expr)) # define g_assert_null(expr) g_assert ((expr) == NULL) # define g_assert_nonnull(expr) g_assert ((expr) != NULL) #endif
--- +++ @@ -6,3 +6,23 @@ # define g_assert_null(expr) g_assert ((expr) == NULL) # define g_assert_nonnull(expr) g_assert ((expr) != NULL) #endif + +#define graphene_assert_fuzzy_equals(n1,n2,epsilon) \ + G_STMT_START { \ + typeof ((n1)) __n1 = (n1); \ + typeof ((n2)) __n2 = (n2); \ + typeof ((epsilon)) __epsilon = (epsilon); \ + if (__n1 > __n2) { \ + if ((__n1 - __n2) < __epsilon) ; else { \ + g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + #n1 " == " #n2 " (+/- " #epsilon ")", \ + __n1, "==", __n2, 'f'); \ + } \ + } else { \ + if ((__n2 - __n1) < __epsilon) ; else { \ + g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + #n1 " == " #n2 " (+/- " #epsilon ")", \ + __n1, "==", __n2, 'f'); \ + } \ + } \ + } G_STMT_END
tests: Add a fuzzy comparison macro We use something like this in the matrix test suite, but it's useful for other types.
mit
criptych/graphene,criptych/graphene,criptych/graphene,ebassi/graphene,ebassi/graphene,criptych/graphene
1efe7fa345f5ab9fb75ecf6f7109c2f1fd9ec4a0
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); else if (mailbox_sync(mailbox, 0, 0, NULL) < 0) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
--- +++ @@ -18,6 +18,8 @@ if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); + else if (mailbox_sync(mailbox, 0, 0, NULL) < 0) + client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage);
CLOSE: Synchronize the mailbox after expunging messages to actually get them expunged. --HG-- branch : HEAD
mit
jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jkerihuel/dovecot
486d2738965d5e62c08e42a29cc635e6e9be7477
#define WIKIGLYPH_X @"\ue95e" #define WIKIGLYPH_FLAG @"\ue963" #define WIKIGLYPH_USER_SMILE @"\ue964" #define WIKIGLYPH_USER_SLEEP @"\ue965" #define WIKIGLYPH_CC @"\ue969" #define WIKIGLYPH_PUBLIC_DOMAIN @"\ue96c"
#define WIKIGLYPH_FORWARD @"\ue954" #define WIKIGLYPH_BACKWARD @"\ue955" #define WIKIGLYPH_DOWN @"\ue956" #define WIKIGLYPH_X @"\ue95e" #define WIKIGLYPH_FLAG @"\ue963" #define WIKIGLYPH_USER_SMILE @"\ue964" #define WIKIGLYPH_USER_SLEEP @"\ue965" #define WIKIGLYPH_CC @"\ue969" #define WIKIGLYPH_CITE @"\ue96b" #define WIKIGLYPH_PUBLIC_DOMAIN @"\ue96c"
--- +++ @@ -1,10 +1,6 @@ -#define WIKIGLYPH_FORWARD @"\ue954" -#define WIKIGLYPH_BACKWARD @"\ue955" -#define WIKIGLYPH_DOWN @"\ue956" #define WIKIGLYPH_X @"\ue95e" #define WIKIGLYPH_FLAG @"\ue963" #define WIKIGLYPH_USER_SMILE @"\ue964" #define WIKIGLYPH_USER_SLEEP @"\ue965" #define WIKIGLYPH_CC @"\ue969" -#define WIKIGLYPH_CITE @"\ue96b" #define WIKIGLYPH_PUBLIC_DOMAIN @"\ue96c"
Remove unused glyph font defines.
mit
wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios
cca85848f87ed67700301736f1bbd03e6298f65d
#pragma once #include <ionScene/CSimpleMesh.h> #include "SVolume.h" struct SMarchingCubesPoint { f32 Value = 0; vec3f Gradient; SMarchingCubesPoint() {} SMarchingCubesPoint(f32 const & value) : Value(value) {} }; typedef SVolume<SMarchingCubesPoint> SMarchingCubesVolume; void CalculateGradient(SMarchingCubesVolume & Volume); ion::Scene::CSimpleMesh * MarchingCubes(SMarchingCubesVolume & Volume);
#pragma once #include <ionScene/CSimpleMesh.h> #include "SVolume.h" struct SMarchingCubesPoint { f32 Value; vec3f Gradient; SMarchingCubesPoint() {} SMarchingCubesPoint(f32 const & value) : Value(value) {} }; typedef SVolume<SMarchingCubesPoint> SMarchingCubesVolume; void CalculateGradient(SMarchingCubesVolume & Volume); ion::Scene::CSimpleMesh * MarchingCubes(SMarchingCubesVolume & Volume);
--- +++ @@ -7,7 +7,7 @@ struct SMarchingCubesPoint { - f32 Value; + f32 Value = 0; vec3f Gradient; SMarchingCubesPoint()
[ionScience] Fix marching cubes unitialized variable
mit
iondune/ionEngine,iondune/ionEngine
217b2661c14b7940bb273f4b793b3c6d41f7425c
/* $OpenBSD: vmparam.h,v 1.4 2009/10/14 20:18:26 miod Exp $ */ /* public domain */ #ifndef _SGI_VMPARAM_H_ #define _SGI_VMPARAM_H_ #define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */ /* * On Origin and Octane families, DMA to 32-bit PCI devices is restricted. * * Systems with physical memory after the 2GB boundary needs to ensure * memory which may used for DMA transfers is allocated from the low * memory range. * * Other systems, like the O2, do not have such a restriction, but can not * have more than 2GB of physical memory, so this doesn't affect them. */ #define VM_NFREELIST 2 #define VM_FREELIST_DMA32 1 /* memory suitable for 32-bit DMA */ #include <mips64/vmparam.h> #endif /* _SGI_VMPARAM_H_ */
/* $OpenBSD: vmparam.h,v 1.3 2009/05/08 18:42:04 miod Exp $ */ #ifndef _SGI_VMPARAM_H_ #define _SGI_VMPARAM_H_ #define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */ #define VM_NFREELIST 2 #define VM_FREELIST_DMA32 1 /* memory under 2GB suitable for DMA */ #include <mips64/vmparam.h> #endif /* _SGI_VMPARAM_H_ */
--- +++ @@ -1,12 +1,23 @@ -/* $OpenBSD: vmparam.h,v 1.3 2009/05/08 18:42:04 miod Exp $ */ - +/* $OpenBSD: vmparam.h,v 1.4 2009/10/14 20:18:26 miod Exp $ */ +/* public domain */ #ifndef _SGI_VMPARAM_H_ #define _SGI_VMPARAM_H_ #define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */ +/* + * On Origin and Octane families, DMA to 32-bit PCI devices is restricted. + * + * Systems with physical memory after the 2GB boundary needs to ensure + * memory which may used for DMA transfers is allocated from the low + * memory range. + * + * Other systems, like the O2, do not have such a restriction, but can not + * have more than 2GB of physical memory, so this doesn't affect them. + */ + #define VM_NFREELIST 2 -#define VM_FREELIST_DMA32 1 /* memory under 2GB suitable for DMA */ +#define VM_FREELIST_DMA32 1 /* memory suitable for 32-bit DMA */ #include <mips64/vmparam.h>
Add some comments to explain why the DMA32 physseg is really 2**31 bytes long. Prompted by deraadt@ long ago.
isc
orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars
1f561bba70d0746f0b474f39fad689ae7d678517
/* * main.c * * Created: 4/3/2014 8:36:43 AM * Author: razius */ #include <avr/io.h> #include <avr/interrupt.h> uint8_t SECONDS = 0x00; int main(void){ // Clear Timer on Compare Match (CTC) Mode with OCRnA as top. TCCR1A |= _BV(WGM12); // clk / (2 * prescaler * (1 + OCRnA)) OCR1AH = 0x7A; OCR1AL = 0x12; // Setup Timer 0 pre-scaler to clk/256 TCCR1B |= _BV(CS12); // Enable Timer/Counter4 overflow interrupt. TIMSK1 = _BV(TOIE1); // Setup PH3 to output DDRH = 0xFF; // Enable MCU interrupt (set I-flag) sei(); while (1) { PORTH = ~SECONDS; } return 0; } ISR(TIMER1_OVF_vect){ // Setup PH3 to output // DDRH |= _BV(DDH3); // PORTH = PORTH << 1; if (SECONDS < 60) { SECONDS++; } else { SECONDS = 0x00; } }
/* * main.c * * Created: 4/3/2014 8:36:43 AM * Author: razius */ #include <avr/io.h> #include <avr/interrupt.h> int main(void){ // Clear Timer on Compare Match (CTC) Mode with OCRnA as top. TCCR4B |= _BV(WGM42); // Toggle OCnA on compare match TCCR4A |= _BV(COM4A0); // clk / (2 * prescaler * (1 + OCRnA)) OCR4AH = 0x7A; OCR4AL = 0x12; // Setup Timer 0 pre-scaler to clk/256 TCCR4B |= _BV(CS42); // Setup PH3 to output DDRH |= _BV(DDH3); // Enable MCU interrupt (set I-flag) sei(); while (1) { } return 0; }
--- +++ @@ -8,28 +8,43 @@ #include <avr/io.h> #include <avr/interrupt.h> +uint8_t SECONDS = 0x00; + int main(void){ // Clear Timer on Compare Match (CTC) Mode with OCRnA as top. - TCCR4B |= _BV(WGM42); - - // Toggle OCnA on compare match - TCCR4A |= _BV(COM4A0); + TCCR1A |= _BV(WGM12); // clk / (2 * prescaler * (1 + OCRnA)) - OCR4AH = 0x7A; - OCR4AL = 0x12; + OCR1AH = 0x7A; + OCR1AL = 0x12; // Setup Timer 0 pre-scaler to clk/256 - TCCR4B |= _BV(CS42); + TCCR1B |= _BV(CS12); + + // Enable Timer/Counter4 overflow interrupt. + TIMSK1 = _BV(TOIE1); // Setup PH3 to output - DDRH |= _BV(DDH3); + DDRH = 0xFF; // Enable MCU interrupt (set I-flag) sei(); while (1) { + PORTH = ~SECONDS; } return 0; } + +ISR(TIMER1_OVF_vect){ + // Setup PH3 to output + // DDRH |= _BV(DDH3); + // PORTH = PORTH << 1; + if (SECONDS < 60) { + SECONDS++; + } + else { + SECONDS = 0x00; + } +}
Increment seconds and show them using LED's.
mit
razius/nixie-clock,razius/nixie-clock
3423a5f810efdc0125b4a25e74ecb5c6a4b31e5f
/* $FreeBSD$ */ /* Derived from: Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */ #include <stddef.h> #include <sys/param.h> #include <sys/assym.h> #include <svr4/svr4_signal.h> #include <svr4/svr4_ucontext.h> /* XXX: This bit sucks rocks, but gets rid of compiler errors. Maybe I should * fix the include files instead... */ #define SVR4_MACHDEP_JUST_REGS #include <i386/svr4/svr4_machdep.h> ASSYM(SVR4_SIGF_HANDLER, offsetof(struct svr4_sigframe, sf_handler)); ASSYM(SVR4_SIGF_UC, offsetof(struct svr4_sigframe, sf_uc)); ASSYM(SVR4_UC_FS, offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])); ASSYM(SVR4_UC_GS, offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])); ASSYM(SVR4_UC_EFLAGS, offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL]));
/* $FreeBSD$ */ /* Derived from: Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */ #include <sys/assym.h> #include <sys/param.h> struct proc; #include <svr4/svr4.h> #include <svr4/svr4_signal.h> #include <svr4/svr4_ucontext.h> /* XXX: This bit sucks rocks, but gets rid of compiler errors. Maybe I should * fix the include files instead... */ #define SVR4_MACHDEP_JUST_REGS #include <i386/svr4/svr4_machdep.h> ASSYM(SVR4_SIGF_HANDLER, offsetof(struct svr4_sigframe, sf_handler)); ASSYM(SVR4_SIGF_UC, offsetof(struct svr4_sigframe, sf_uc)); ASSYM(SVR4_UC_FS, offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])); ASSYM(SVR4_UC_GS, offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])); ASSYM(SVR4_UC_EFLAGS, offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL]));
--- +++ @@ -1,12 +1,11 @@ /* $FreeBSD$ */ /* Derived from: Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */ +#include <stddef.h> + +#include <sys/param.h> #include <sys/assym.h> -#include <sys/param.h> -struct proc; - -#include <svr4/svr4.h> #include <svr4/svr4_signal.h> #include <svr4/svr4_ucontext.h>
Include <stddef.h> here so that <sys/assym.h> can be unpolluted. Include <sys/param.h> before <sys/assym.h> in case any of the magic in the former is ever needed in the latter. Removed an unused forward declaration and an unused include.
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
8e2cc0f4fff1a414b4ea5a0d27d1a6eb8ba303ef
/** * @file * @brief A convenience header * * A header which includes all headers needed for a front-end */ #ifdef __cplusplus extern "C" { #endif #include "boot-loader.h" #include "drives.h" #include "install.h" #include "lickdir.h" #include "llist.h" #include "menu.h" #include "system-info.h" #include "utils.h" #ifdef __cplusplus } #endif
/** * @file * @brief A convenience header * * A header which includes all headers needed for a front-end */ #include "boot-loader.h" #include "drives.h" #include "install.h" #include "lickdir.h" #include "llist.h" #include "menu.h" #include "system-info.h" #include "utils.h"
--- +++ @@ -4,6 +4,10 @@ * * A header which includes all headers needed for a front-end */ + +#ifdef __cplusplus +extern "C" { +#endif #include "boot-loader.h" #include "drives.h" @@ -13,3 +17,7 @@ #include "menu.h" #include "system-info.h" #include "utils.h" + +#ifdef __cplusplus +} +#endif
Add `extern "C"' to convenience headers
mit
noryb009/lick,noryb009/lick,noryb009/lick
e5fc7d47e00c9d375a320b97e19790715c6e8104
// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm -O2 -o - %s | FileCheck %s // Under Windows 64, int and long are 32-bits. Make sure pointer math doesn't // cause any sign extensions. // CHECK: [[P:%.*]] = add i64 %param, -8 // CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*\*]] // CHECK-NEXT: {{%.*}} = getelementptr inbounds [[R]] [[Q]], i64 0, i32 0 #define CR(Record, TYPE, Field) \ ((TYPE *) ((unsigned char *) (Record) - (unsigned char *) &(((TYPE *) 0)->Field))) typedef struct _LIST_ENTRY { struct _LIST_ENTRY *ForwardLink; struct _LIST_ENTRY *BackLink; } LIST_ENTRY; typedef struct { unsigned long long Signature; LIST_ENTRY Link; } MEMORY_MAP; int test(unsigned long long param) { LIST_ENTRY *Link; MEMORY_MAP *Entry; Link = (LIST_ENTRY *) param; Entry = CR (Link, MEMORY_MAP, Link); return (int) Entry->Signature; }
// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm -O2 -o - %s | FileCheck %s // Under Windows 64, int and long are 32-bits. Make sure pointer math doesn't // cause any sign extensions. // CHECK: [[P:%.*]] = add i64 %param, -8 // CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*]] // CHECK-NEXT: {{%.*}} = getelementptr inbounds [[R]] [[Q]], i64 0, i32 0 #define CR(Record, TYPE, Field) \ ((TYPE *) ((unsigned char *) (Record) - (unsigned char *) &(((TYPE *) 0)->Field))) typedef struct _LIST_ENTRY { struct _LIST_ENTRY *ForwardLink; struct _LIST_ENTRY *BackLink; } LIST_ENTRY; typedef struct { unsigned long long Signature; LIST_ENTRY Link; } MEMORY_MAP; int test(unsigned long long param) { LIST_ENTRY *Link; MEMORY_MAP *Entry; Link = (LIST_ENTRY *) param; Entry = CR (Link, MEMORY_MAP, Link); return (int) Entry->Signature; }
--- +++ @@ -4,7 +4,7 @@ // cause any sign extensions. // CHECK: [[P:%.*]] = add i64 %param, -8 -// CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*]] +// CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*\*]] // CHECK-NEXT: {{%.*}} = getelementptr inbounds [[R]] [[Q]], i64 0, i32 0 #define CR(Record, TYPE, Field) \
Tweak regex not to accidentally match a trailing \r. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@113966 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
bf3a60b17fa0a12bc7a548e9c659f45684742258
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release namespace dev { namespace evmjit { struct Voider { void operator=(std::ostream const&) {} }; } } #define DLOG(CHANNEL) true ? (void)0 : ::dev::evmjit::Voider{} = std::cerr #endif
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release #define DLOG(CHANNEL) true ? std::cerr : std::cerr #endif
--- +++ @@ -20,5 +20,21 @@ #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release - #define DLOG(CHANNEL) true ? std::cerr : std::cerr + +namespace dev +{ +namespace evmjit +{ + +struct Voider +{ + void operator=(std::ostream const&) {} +}; + +} +} + + +#define DLOG(CHANNEL) true ? (void)0 : ::dev::evmjit::Voider{} = std::cerr + #endif
Reimplement no-op version of DLOG to avoid C++ compiler warning
mit
ethcore/evmjit,debris/evmjit,debris/evmjit,ethcore/evmjit
8bbaaabf9f3db24f387ba1f7bf7374c6ea73f8d3
#ifndef SCC_SEMANTIC_HEADER #define SCC_SEMANTIC_HEADER #include <stdio.h> #include <stdbool.h> #include "syntax.h" #include "symboltable.h" bool semantic_analysis(Syntax * top_level); #endif
#ifndef SCC_SEMANTIC_HEADER #define SCC_SEMANTIC_HEADER #include <stdio.h> #include "syntax.h" #include "symboltable.h" int semantic_analysis(Syntax * top_level); #endif
--- +++ @@ -2,9 +2,10 @@ #define SCC_SEMANTIC_HEADER #include <stdio.h> +#include <stdbool.h> #include "syntax.h" #include "symboltable.h" -int semantic_analysis(Syntax * top_level); +bool semantic_analysis(Syntax * top_level); #endif
Change the return type to bool.
mit
RyanWangGit/scc
22a40259343115f241456b6914e86c32ab1e3e46
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _PLATSUPPORT_PIT_H #define _PLATSUPPORT_PIT_H #include <autoconf.h> #include <platsupport/timer.h> #include <platsupport/io.h> #ifdef CONFIG_IRQ_PIC #define PIT_INTERRUPT 0 #else #define PIT_INTERRUPT 2 #endif /* * Get the pit interface. This may only be called once. * * @param io_port_ops io port operations. This is all the pit requires. * @return initialised interface, NULL on error. */ pstimer_t * pit_get_timer(ps_io_port_ops_t *io_port_ops); #endif /* _PLATSUPPORT_PIT_H */
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _PLATSUPPORT_PIT_H #define _PLATSUPPORT_PIT_H #include <platsupport/timer.h> #include <platsupport/io.h> #define PIT_INTERRUPT 0 /* * Get the pit interface. This may only be called once. * * @param io_port_ops io port operations. This is all the pit requires. * @return initialised interface, NULL on error. */ pstimer_t * pit_get_timer(ps_io_port_ops_t *io_port_ops); #endif /* _PLATSUPPORT_PIT_H */
--- +++ @@ -10,10 +10,15 @@ #ifndef _PLATSUPPORT_PIT_H #define _PLATSUPPORT_PIT_H +#include <autoconf.h> #include <platsupport/timer.h> #include <platsupport/io.h> +#ifdef CONFIG_IRQ_PIC #define PIT_INTERRUPT 0 +#else +#define PIT_INTERRUPT 2 +#endif /* * Get the pit interface. This may only be called once.
libplatsupport: Define PIT interrupt more correctly if using the IOAPIC The definition is not really correct as you cannot really talk about interrupts by a single number. But this does provide the path of least resistance for legacy code using the PIT when the IOAPIC is enabled
bsd-2-clause
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
196992d9be7b1dcbb706a1c229ff3786d7c4935b
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "bmp.h" const int image_width = 512; const int image_height = 512; const int image_size = 512*512; const int color_depth = 255; int main(int argc, char** argv){ if(argc != 3){ printf("Useage: %s image n_threads\n", argv[0]); exit(-1); } int n_threads = atoi(argv[2]); unsigned char* image = read_bmp(argv[1]); unsigned char* output_image = malloc(sizeof(unsigned char) * image_size); int* histogram = (int*)calloc(sizeof(int), color_depth); #pragma omp parallel for for(int i = 0; i < image_size; i++){ histogram[image[i]]++; } float* transfer_function = (float*)calloc(sizeof(float), color_depth); #pragma omp parallel for for(int i = 0; i < color_depth; i++){ for(int j = 0; j < i+1; j++){ transfer_function[i] += color_depth*((float)histogram[j])/(image_size); } } for(int i = 0; i < image_size; i++){ output_image[i] = transfer_function[image[i]]; } write_bmp(output_image, image_width, image_height); }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "bmp.h" const int image_width = 512; const int image_height = 512; const int image_size = 512*512; const int color_depth = 255; int main(int argc, char** argv){ if(argc != 3){ printf("Useage: %s image n_threads\n", argv[0]); exit(-1); } int n_threads = atoi(argv[2]); unsigned char* image = read_bmp(argv[1]); unsigned char* output_image = malloc(sizeof(unsigned char) * image_size); int* histogram = (int*)calloc(sizeof(int), color_depth); for(int i = 0; i < image_size; i++){ histogram[image[i]]++; } float* transfer_function = (float*)calloc(sizeof(float), color_depth); for(int i = 0; i < color_depth; i++){ for(int j = 0; j < i+1; j++){ transfer_function[i] += color_depth*((float)histogram[j])/(image_size); } } for(int i = 0; i < image_size; i++){ output_image[i] = transfer_function[image[i]]; } write_bmp(output_image, image_width, image_height); }
--- +++ @@ -21,12 +21,14 @@ int* histogram = (int*)calloc(sizeof(int), color_depth); + #pragma omp parallel for for(int i = 0; i < image_size; i++){ histogram[image[i]]++; } float* transfer_function = (float*)calloc(sizeof(float), color_depth); + #pragma omp parallel for for(int i = 0; i < color_depth; i++){ for(int j = 0; j < i+1; j++){ transfer_function[i] += color_depth*((float)histogram[j])/(image_size);
Add paralellism with race conditions to omp
apache-2.0
Raane/Parallel-Computing,Raane/Parallel-Computing
a2af1d8bff1b3729048f95c8c266ef8f2fb4c861
// Copyright 2015 SimpleThings, 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. // Linux implementation of OS Abstraction Layer for Canopy #include <canopy_os.h> #include <assert.h> #include <stdarg.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> void * canopy_os_alloc(size_t size) { return malloc(size); } void * canopy_os_calloc(int count, size_t size) { return calloc(count, size); } void canopy_os_free(void *ptr) { free(ptr); } void canopy_os_log(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); }
// Copyright 2015 SimpleThings, 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. // Linux implementation of OS Abstraction Layer for Canopy #include <canopy_os.h> #include <assert.h> #include <stdarg.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> void canopy_os_assert(int condition) { assert(condition); } void * canopy_os_alloc(size_t size) { return malloc(size); } void * canopy_os_calloc(int count, size_t size) { return calloc(count, size); } void canopy_os_free(void *ptr) { free(ptr); } void canopy_os_log(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); }
--- +++ @@ -23,11 +23,6 @@ #include <stdlib.h> -void canopy_os_assert(int condition) { - assert(condition); -} - - void * canopy_os_alloc(size_t size) { return malloc(size); }
Remove canopy_os_assert implementation because linux implementation now just expands to assert macro in header file
apache-2.0
canopy-project/canopy_os_linux
eada73f748007102da090de2f6ac65691a9ea9a8
#ifndef CHC_NARROWPHASE_H #define CHC_NARROWPHASE_H #include "chrono_parallel/ChParallelDefines.h" #include "chrono_parallel/ChDataManager.h" namespace chrono { namespace collision { struct ConvexShape { shape_type type; //type of shape real3 A; //location real3 B; //dimensions real3 C; //extra quaternion R; //rotation real3* convex; // pointer to convex data; real margin; ConvexShape():margin(0.04){} }; } // end namespace collision } // end namespace chrono #endif
#ifndef CHC_NARROWPHASE_H #define CHC_NARROWPHASE_H #include "chrono_parallel/ChParallelDefines.h" #include "chrono_parallel/ChDataManager.h" namespace chrono { namespace collision { struct ConvexShape { shape_type type; //type of shape real3 A; //location real3 B; //dimensions real3 C; //extra quaternion R; //rotation real3* convex; // pointer to convex data; }; } // end namespace collision } // end namespace chrono #endif
--- +++ @@ -14,6 +14,8 @@ real3 C; //extra quaternion R; //rotation real3* convex; // pointer to convex data; + real margin; + ConvexShape():margin(0.04){} }; } // end namespace collision
Add a collision margin to each shape Margins are one way to improve stability of contacts. Only the GJK solver will use these initially
bsd-3-clause
jcmadsen/chrono,PedroTrujilloV/chrono,jcmadsen/chrono,Milad-Rakhsha/chrono,hsu/chrono,dariomangoni/chrono,hsu/chrono,projectchrono/chrono,andrewseidl/chrono,projectchrono/chrono,hsu/chrono,projectchrono/chrono,tjolsen/chrono,dariomangoni/chrono,armanpazouki/chrono,rserban/chrono,dariomangoni/chrono,Milad-Rakhsha/chrono,tjolsen/chrono,andrewseidl/chrono,jcmadsen/chrono,Bryan-Peterson/chrono,rserban/chrono,Milad-Rakhsha/chrono,hsu/chrono,projectchrono/chrono,andrewseidl/chrono,jcmadsen/chrono,rserban/chrono,rserban/chrono,PedroTrujilloV/chrono,amelmquist/chrono,amelmquist/chrono,Milad-Rakhsha/chrono,andrewseidl/chrono,hsu/chrono,Milad-Rakhsha/chrono,rserban/chrono,PedroTrujilloV/chrono,jcmadsen/chrono,amelmquist/chrono,Milad-Rakhsha/chrono,PedroTrujilloV/chrono,rserban/chrono,armanpazouki/chrono,andrewseidl/chrono,tjolsen/chrono,amelmquist/chrono,dariomangoni/chrono,armanpazouki/chrono,jcmadsen/chrono,projectchrono/chrono,armanpazouki/chrono,dariomangoni/chrono,Bryan-Peterson/chrono,armanpazouki/chrono,projectchrono/chrono,rserban/chrono,Bryan-Peterson/chrono,tjolsen/chrono,tjolsen/chrono,dariomangoni/chrono,amelmquist/chrono,Bryan-Peterson/chrono,Bryan-Peterson/chrono,PedroTrujilloV/chrono,amelmquist/chrono,armanpazouki/chrono,jcmadsen/chrono
443637f6a485f7c9f5e1c4cf393b5fd22a718c69
#ifndef HELPER_H #define HELPER_H /*Helper function for calculating ABSOLUTE maximum of two floats Will return maximum absolute value (ignores sign) */ float helpFindMaxAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs > bAbs) { return aAbs; } else { return bAbs; } } //Helper function for calculating ABSOLUTE minimum of two floats //Will return minimum absolute value (ignores sign) float helpFindMinAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs < bAbs) { return aAbs; } else { return bAbs; } } //Returns sign of int int helpFindSign(int x) { if (x > 0.0) { return 1; } else if (x < 0.0) { return -1; } else { return 0; } } int helpRoundFloat(float x) { if (x > 0) { return (int)(x+0.5); } else { return (int)(x-0.5); } } #endif
#ifndef HELPER_H #define HELPER_H /*Helper function for calculating ABSOLUTE maximum of two floats Will return maximum absolute value (ignores sign) */ float helpFindMaxAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs > bAbs) { return aAbs; } else { return bAbs; } } //Helper function for calculating ABSOLUTE minimum of two floats //Will return minimum absolute value (ignores sign) float helpFindMinAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs < bAbs) { return aAbs; } else { return bAbs; } } //Returns sign of float int helpFindSign(float x) { if (x > 0.0) { return 1; } else if (x < 0.0) { return -1; } else { return 0; } } int helpRoundFloat(float x) { if (x > 0) { return (int)(x+0.5); } else { return (int)(x-0.5); } } #endif
--- +++ @@ -25,8 +25,8 @@ } } -//Returns sign of float -int helpFindSign(float x) { +//Returns sign of int +int helpFindSign(int x) { if (x > 0.0) { return 1; } else if (x < 0.0) {
Fix helpFindSign (floats don't have signs....)
mit
RMRobotics/FTC_5421_2014-2015,RMRobotics/FTC_5421_2014-2015
f49f7674b9ec11b777b0954ea9fa0fe73a7ad4be
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<p>Fun little boxes:</p>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Local mass: <input type=\"text\" name=\"localmass\" value=\"" + mixed_sprint(obj->query_local_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change local mass\" />\n"; buffer += "</form>\n"; return oinfobox("Configuration", 2, buffer); }
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<p>Fun little boxes:</p>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj->query_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change mass\" />\n"; buffer += "</form>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Local mass: <input type=\"text\" name=\"localmass\" value=\"" + mixed_sprint(obj->query_local_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change local mass\" />\n"; buffer += "</form>\n"; return oinfobox("Configuration", 2, buffer); }
--- +++ @@ -8,11 +8,6 @@ buffer = "<p>Fun little boxes:</p>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; - buffer += "Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj->query_mass()) + "\"/>\n"; - buffer += "<input type=\"submit\" value=\"change mass\" />\n"; - buffer += "</form>\n"; - - buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Local mass: <input type=\"text\" name=\"localmass\" value=\"" + mixed_sprint(obj->query_local_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change local mass\" />\n"; buffer += "</form>\n";
Remove http form for mass, only manipulate local mass
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
b701d2ce0e96280713b84192aed48fb87d609d94
#include <pthread.h> #include <assert.h> int g = 0; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&C); pthread_mutex_lock(&B); g = 5; pthread_mutex_unlock(&B); pthread_mutex_lock(&B); g = 0; pthread_mutex_unlock(&B); pthread_mutex_unlock(&C); pthread_mutex_unlock(&A); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); pthread_mutex_lock(&B); assert(g == 0); pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); pthread_mutex_lock(&B); pthread_mutex_lock(&C); assert(g == 0); pthread_mutex_unlock(&C); pthread_mutex_unlock(&B); pthread_join(id, NULL); return 0; }
#include <pthread.h> #include <assert.h> int g = 0; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&C); pthread_mutex_lock(&B); g = 5; pthread_mutex_unlock(&B); pthread_mutex_lock(&B); g = 0; pthread_mutex_unlock(&B); pthread_mutex_unlock(&C); pthread_mutex_unlock(&A); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&B); pthread_mutex_unlock(&B); pthread_mutex_lock(&A); pthread_mutex_lock(&B); assert(g == 0); pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); pthread_mutex_lock(&B); pthread_mutex_lock(&C); assert(g == 0); pthread_mutex_unlock(&C); pthread_mutex_unlock(&B); pthread_join(id, NULL); return 0; }
--- +++ @@ -24,9 +24,6 @@ pthread_t id; pthread_create(&id, NULL, t_fun, NULL); - pthread_mutex_lock(&B); - pthread_mutex_unlock(&B); - pthread_mutex_lock(&A); pthread_mutex_lock(&B); assert(g == 0);
Remove now somehow unnecessary empty mutex B section from 13/32
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
dfeaa08d905e605519683cb85d25976264941d61
// RUN: %ocheck 3 %s -g // test debug emission too g() { return 3; } main() { if(0){ int i; f(); // shouldn't hit a linker error here - dead code a: i = 2; return g(i); } goto a; }
// RUN: %ocheck 3 %s g() { return 3; } main() { if(0){ f(); // shouldn't hit a linker error here - dead code a: return g(); } goto a; }
--- +++ @@ -1,4 +1,5 @@ -// RUN: %ocheck 3 %s +// RUN: %ocheck 3 %s -g +// test debug emission too g() { @@ -8,9 +9,11 @@ main() { if(0){ + int i; f(); // shouldn't hit a linker error here - dead code a: - return g(); + i = 2; + return g(i); } goto a;
Test debug label emission with local variables
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
60f560824bf9fb6ec9148f5b36eae83827b5de42
// RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-### " %clang -target x86_64-apple-darwin %s -O2 b -O3 2>&1 | FileCheck %s // RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-msse" %clang -target x86_64-apple-darwin -Werror %s -c -### 2>&1 | FileCheck %s -check-prefix=RM-WERROR // CHECK: "-cc1" // CHECK-NOT: "-Oignore" // CHECK: "-Omagic" // CHECK-NOT: "-Oignore" // RM-WERROR: ### QA_OVERRIDE_GCC3_OPTIONS: x-Werror +-msse // RM-WERROR-NEXT: ### Deleting argument -Werror // RM-WERROR-NEXT: ### Adding argument -msse at end // RM-WERROR-NOT: "-Werror"
// RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-### " %clang -target x86_64-apple-darwin %s -O2 b -O3 2>&1 | FileCheck %s // RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-mfoo" %clang -target x86_64-apple-darwin -Werror %s -c -### 2>&1 | FileCheck %s -check-prefix=RM-WERROR // CHECK: "-cc1" // CHECK-NOT: "-Oignore" // CHECK: "-Omagic" // CHECK-NOT: "-Oignore" // RM-WERROR: ### QA_OVERRIDE_GCC3_OPTIONS: x-Werror +-mfoo // RM-WERROR-NEXT: ### Deleting argument -Werror // RM-WERROR-NEXT: ### Adding argument -mfoo at end // RM-WERROR: warning: argument unused during compilation: '-mfoo' // RM-WERROR-NOT: "-Werror"
--- +++ @@ -1,13 +1,12 @@ // RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-### " %clang -target x86_64-apple-darwin %s -O2 b -O3 2>&1 | FileCheck %s -// RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-mfoo" %clang -target x86_64-apple-darwin -Werror %s -c -### 2>&1 | FileCheck %s -check-prefix=RM-WERROR +// RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-msse" %clang -target x86_64-apple-darwin -Werror %s -c -### 2>&1 | FileCheck %s -check-prefix=RM-WERROR // CHECK: "-cc1" // CHECK-NOT: "-Oignore" // CHECK: "-Omagic" // CHECK-NOT: "-Oignore" -// RM-WERROR: ### QA_OVERRIDE_GCC3_OPTIONS: x-Werror +-mfoo +// RM-WERROR: ### QA_OVERRIDE_GCC3_OPTIONS: x-Werror +-msse // RM-WERROR-NEXT: ### Deleting argument -Werror -// RM-WERROR-NEXT: ### Adding argument -mfoo at end -// RM-WERROR: warning: argument unused during compilation: '-mfoo' +// RM-WERROR-NEXT: ### Adding argument -msse at end // RM-WERROR-NOT: "-Werror"
Use a valid option (-msse) for testing QA_OVERRIDE_GCC3_OPTIONS. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@191300 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
ba9175808084f22081a755314f966fa26026a8d7
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // // This file is part of the LibreOffice project. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #import "MLOViewController.h" #import "MLOTestingTileSubviewControllerProtocol.h" // The size of the actual pixel tile static const CGFloat CONTEXT_WIDTH_DEFAULT = 450; static const CGFloat CONTEXT_HEIGHT_DEFAULT = 450; // In our "decatwips" static const CGFloat TILE_POS_X_DEFAULT = 0; static const CGFloat TILE_POS_Y_DEFAULT = 0; // "Tile" size here means the decatwip size of the part of the document // rendered into the pixel tile static const CGFloat TILE_WIDTH_DEFAULT = 500; static const CGFloat TILE_HEIGHT_DEFAULT = 500; @interface MLOTestingTileParametersViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol> @property CGFloat contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight; -(void)renderTile; @end
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // // This file is part of the LibreOffice project. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #import "MLOViewController.h" #import "MLOTestingTileSubviewControllerProtocol.h" static const CGFloat CONTEXT_WIDTH_DEFAULT = 450; static const CGFloat CONTEXT_HEIGHT_DEFAULT = 450; static const CGFloat TILE_POS_X_DEFAULT = 400; static const CGFloat TILE_POS_Y_DEFAULT = 420; static const CGFloat TILE_WIDTH_DEFAULT = 250; static const CGFloat TILE_HEIGHT_DEFAULT = 250; @interface MLOTestingTileParametersViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol> @property CGFloat contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight; -(void)renderTile; @end
--- +++ @@ -9,12 +9,18 @@ #import "MLOViewController.h" #import "MLOTestingTileSubviewControllerProtocol.h" +// The size of the actual pixel tile static const CGFloat CONTEXT_WIDTH_DEFAULT = 450; static const CGFloat CONTEXT_HEIGHT_DEFAULT = 450; -static const CGFloat TILE_POS_X_DEFAULT = 400; -static const CGFloat TILE_POS_Y_DEFAULT = 420; -static const CGFloat TILE_WIDTH_DEFAULT = 250; -static const CGFloat TILE_HEIGHT_DEFAULT = 250; + +// In our "decatwips" +static const CGFloat TILE_POS_X_DEFAULT = 0; +static const CGFloat TILE_POS_Y_DEFAULT = 0; + +// "Tile" size here means the decatwip size of the part of the document +// rendered into the pixel tile +static const CGFloat TILE_WIDTH_DEFAULT = 500; +static const CGFloat TILE_HEIGHT_DEFAULT = 500; @interface MLOTestingTileParametersViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol> @property CGFloat contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight;
Adjust parameter defaults to give pleasant result Change-Id: Ifee900344547ef25b2041d25c13fcbc50428485e
mpl-2.0
JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core
e56b0c0f248ae779a0abd9e1d5aa7f7420a03f64
/*- * Copyright (c) 2008-2016 Varnish Software AS * All rights reserved. * * Author: Guillaume Quintard <guillaume.quintard@gmail.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "vqueue.h" #define ITER_DONE(iter) (iter->buf == iter->end ? hpk_done : hpk_more) struct dynhdr { struct hpk_hdr header; VTAILQ_ENTRY(dynhdr) list; }; VTAILQ_HEAD(dynamic_table,dynhdr); struct hpk_iter { struct hpk_ctx *ctx; char *orig; char *buf; char *end; }; const struct txt * tbl_get_key(const struct hpk_ctx *ctx, uint32_t index); const struct txt * tbl_get_value(const struct hpk_ctx *ctx, uint32_t index); void push_header (struct hpk_ctx *ctx, const struct hpk_hdr *h);
#include "vqueue.h" #define ITER_DONE(iter) (iter->buf == iter->end ? hpk_done : hpk_more) struct dynhdr { struct hpk_hdr header; VTAILQ_ENTRY(dynhdr) list; }; VTAILQ_HEAD(dynamic_table,dynhdr); struct hpk_iter { struct hpk_ctx *ctx; char *orig; char *buf; char *end; }; const struct txt * tbl_get_key(const struct hpk_ctx *ctx, uint32_t index); const struct txt * tbl_get_value(const struct hpk_ctx *ctx, uint32_t index); void push_header (struct hpk_ctx *ctx, const struct hpk_hdr *h);
--- +++ @@ -1,3 +1,31 @@ +/*- + * Copyright (c) 2008-2016 Varnish Software AS + * All rights reserved. + * + * Author: Guillaume Quintard <guillaume.quintard@gmail.com> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + #include "vqueue.h" #define ITER_DONE(iter) (iter->buf == iter->end ? hpk_done : hpk_more)
Add a copyright to this file
bsd-2-clause
gquintard/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache
a98d2b55c79a9959efd814bd9a316415ebc8dac8
#ifndef UTIL_STRING_H #define UTIL_STRING_H #include "util/common.h" #ifndef strndup // This is sometimes a macro char* strndup(const char* start, size_t len); #endif char* strnrstr(const char* restrict s1, const char* restrict s2, size_t len); #endif
#ifndef UTIL_STRING_H #define UTIL_STRING_H #include "util/common.h" char* strndup(const char* start, size_t len); char* strnrstr(const char* restrict s1, const char* restrict s2, size_t len); #endif
--- +++ @@ -3,7 +3,11 @@ #include "util/common.h" +#ifndef strndup +// This is sometimes a macro char* strndup(const char* start, size_t len); +#endif + char* strnrstr(const char* restrict s1, const char* restrict s2, size_t len); #endif
Util: Fix build with strndup on some platforms
mpl-2.0
mgba-emu/mgba,mgba-emu/mgba,libretro/mgba,nattthebear/mgba,MerryMage/mgba,AdmiralCurtiss/mgba,Iniquitatis/mgba,fr500/mgba,libretro/mgba,Anty-Lemon/mgba,matthewbauer/mgba,iracigt/mgba,cassos/mgba,askotx/mgba,nattthebear/mgba,fr500/mgba,sergiobenrocha2/mgba,sergiobenrocha2/mgba,Anty-Lemon/mgba,jeremyherbert/mgba,MerryMage/mgba,Touched/mgba,fr500/mgba,cassos/mgba,Touched/mgba,Iniquitatis/mgba,AdmiralCurtiss/mgba,iracigt/mgba,Touched/mgba,libretro/mgba,zerofalcon/mgba,sergiobenrocha2/mgba,jeremyherbert/mgba,Iniquitatis/mgba,mgba-emu/mgba,iracigt/mgba,cassos/mgba,fr500/mgba,askotx/mgba,sergiobenrocha2/mgba,askotx/mgba,Anty-Lemon/mgba,sergiobenrocha2/mgba,libretro/mgba,jeremyherbert/mgba,Anty-Lemon/mgba,zerofalcon/mgba,askotx/mgba,Iniquitatis/mgba,iracigt/mgba,libretro/mgba,bentley/mgba,AdmiralCurtiss/mgba,matthewbauer/mgba,bentley/mgba,zerofalcon/mgba,mgba-emu/mgba,jeremyherbert/mgba,MerryMage/mgba
938c9e965d14e6867f165b3be3391b0c15484bf5
//===- llvm/Transforms/Utils/IntegerDivision.h ------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains an implementation of 32bit integer division for targets // that don't have native support. It's largely derived from compiler-rt's // implementation of __udivsi3, but hand-tuned for targets that prefer less // control flow. // //===----------------------------------------------------------------------===// #ifndef TRANSFORMS_UTILS_INTEGERDIVISION_H #define TRANSFORMS_UTILS_INTEGERDIVISION_H namespace llvm { class BinaryOperator; } namespace llvm { /// Generate code to divide two integers, replacing Div with the generated /// code. This currently generates code similarly to compiler-rt's /// implementations, but future work includes generating more specialized code /// when more information about the operands are known. Currently only /// implements 32bit scalar division, but future work is removing this /// limitation. /// /// @brief Replace Div with generated code. bool expandDivision(BinaryOperator* Div); } // End llvm namespace #endif
//===- llvm/Transforms/Utils/IntegerDivision.h ------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains an implementation of 32bit integer division for targets // that don't have native support. It's largely derived from compiler-rt's // implementation of __udivsi3, but hand-tuned for targets that prefer less // control flow. // //===----------------------------------------------------------------------===// #ifndef TRANSFORMS_UTILS_INTEGERDIVISION_H #define TRANSFORMS_UTILS_INTEGERDIVISION_H namespace llvm { class BinaryOperator; } namespace llvm { bool expandDivision(BinaryOperator* Div); } // End llvm namespace #endif
--- +++ @@ -23,6 +23,14 @@ namespace llvm { + /// Generate code to divide two integers, replacing Div with the generated + /// code. This currently generates code similarly to compiler-rt's + /// implementations, but future work includes generating more specialized code + /// when more information about the operands are known. Currently only + /// implements 32bit scalar division, but future work is removing this + /// limitation. + /// + /// @brief Replace Div with generated code. bool expandDivision(BinaryOperator* Div); } // End llvm namespace
Document the interface for integer expansion, using doxygen-style comments git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@164231 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm
16514de50a7936950845a3851cae8ce571e0c2c2
// Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Helper function for bit twiddling #ifndef WOFF2_PORT_H_ #define WOFF2_PORT_H_ #include <assert.h> namespace woff2 { typedef unsigned int uint32; inline int Log2Floor(uint32 n) { #if defined(__GNUC__) return n == 0 ? -1 : 31 ^ __builtin_clz(n); #else if (n == 0) return -1; int log = 0; uint32 value = n; for (int i = 4; i >= 0; --i) { int shift = (1 << i); uint32 x = value >> shift; if (x != 0) { value = x; log += shift; } } assert(value == 1); return log; #endif } } // namespace woff2 #endif // WOFF2_PORT_H_
// Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Helper function for bit twiddling #ifndef WOFF2_PORT_H_ #define WOFF2_PORT_H_ namespace woff2 { typedef unsigned int uint32; inline int Log2Floor(uint32 n) { #if defined(__GNUC__) return n == 0 ? -1 : 31 ^ __builtin_clz(n); #else if (n == 0) return -1; int log = 0; uint32 value = n; for (int i = 4; i >= 0; --i) { int shift = (1 << i); uint32 x = value >> shift; if (x != 0) { value = x; log += shift; } } assert(value == 1); return log; #endif } } // namespace woff2 #endif // WOFF2_PORT_H_
--- +++ @@ -16,6 +16,8 @@ #ifndef WOFF2_PORT_H_ #define WOFF2_PORT_H_ + +#include <assert.h> namespace woff2 {
Include assert.h explicitly to fix windows build Fixes the error: C3861: 'assert': identifier not found
mit
nfroidure/ttf2woff2,nfroidure/ttf2woff2,nfroidure/ttf2woff2,nfroidure/ttf2woff2
42afa0c5d2e3cfac5535d218027c05eb742b1383
#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(); } }
#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(); } }
--- +++ @@ -11,12 +11,6 @@ { namespace Utils { - -struct FileCloser -{ - void operator()(FILE* fp) { fclose(fp); } -}; -typedef std::unique_ptr<FILE, FileCloser> FilePtr; struct EVPKeyDeleter {
Move file closer out from public.
mit
madf/jwtxx,madf/jwtxx,RealImage/jwtxx,RealImage/jwtxx
8573926253391f103e73c7b4ec77a6e61b662186
/* Include this file in your project * if you don't want to build libmypaint as a separate library * Note that still need to do -I./path/to/libmypaint/sources * for the includes here to succeed. */ #include "helpers.c" #include "brushmodes.c" #include "fifo.c" #include "operationqueue.c" #include "rng-double.c" #include "utils.c" #include "tilemap.c" #include "mypaint.c" #include "mypaint-brush.c" #include "mypaint-brush-settings.c" #include "mypaint-fixed-tiled-surface.c" #include "mypaint-surface.c" #include "mypaint-tiled-surface.c" #include "mypaint-rectangle.c" #include "mypaint-mapping.c"
/* Include this file in your project * if you don't want to build libmypaint as a separate library * Note that still need to do -I./path/to/libmypaint/sources * for the includes here to succeed. */ #include "mapping.c" #include "helpers.c" #include "brushmodes.c" #include "fifo.c" #include "operationqueue.c" #include "rng-double.c" #include "utils.c" #include "tilemap.c" #include "mypaint.c" #include "mypaint-brush.c" #include "mypaint-brush-settings.c" #include "mypaint-fixed-tiled-surface.c" #include "mypaint-surface.c" #include "mypaint-tiled-surface.c" #include "mypaint-rectangle.c"
--- +++ @@ -3,7 +3,6 @@ * Note that still need to do -I./path/to/libmypaint/sources * for the includes here to succeed. */ -#include "mapping.c" #include "helpers.c" #include "brushmodes.c" #include "fifo.c" @@ -19,3 +18,4 @@ #include "mypaint-surface.c" #include "mypaint-tiled-surface.c" #include "mypaint-rectangle.c" +#include "mypaint-mapping.c"
Remove a lingering ref to mapping.c
isc
achadwick/libmypaint,achadwick/libmypaint,achadwick/libmypaint,achadwick/libmypaint
81de6e841c6775e619b94c12be49969be9d68968
/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Common types */ #ifndef BROTLI_DEC_TYPES_H_ #define BROTLI_DEC_TYPES_H_ #include <stddef.h> /* for size_t */ #ifndef _MSC_VER #include <inttypes.h> #if defined(__cplusplus) || !defined(__STRICT_ANSI__) \ || __STDC_VERSION__ >= 199901L #define BROTLI_INLINE inline #else #define BROTLI_INLINE #endif #else typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned long long int uint64_t; typedef long long int int64_t; #define BROTLI_INLINE __forceinline #endif /* _MSC_VER */ #endif /* BROTLI_DEC_TYPES_H_ */
/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Common types */ #ifndef BROTLI_DEC_TYPES_H_ #define BROTLI_DEC_TYPES_H_ #include <stddef.h> /* for size_t */ #ifndef _MSC_VER #include <inttypes.h> #ifdef __STRICT_ANSI__ #define BROTLI_INLINE #else /* __STRICT_ANSI__ */ #define BROTLI_INLINE inline #endif #else typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned long long int uint64_t; typedef long long int int64_t; #define BROTLI_INLINE __forceinline #endif /* _MSC_VER */ #endif /* BROTLI_DEC_TYPES_H_ */
--- +++ @@ -22,10 +22,11 @@ #ifndef _MSC_VER #include <inttypes.h> -#ifdef __STRICT_ANSI__ +#if defined(__cplusplus) || !defined(__STRICT_ANSI__) \ + || __STDC_VERSION__ >= 199901L +#define BROTLI_INLINE inline +#else #define BROTLI_INLINE -#else /* __STRICT_ANSI__ */ -#define BROTLI_INLINE inline #endif #else typedef signed char int8_t;
Allow use of inline keyword in c++/c99 mode.
apache-2.0
luzhongtong/brotli,koolhazz/brotli,yonchev/brotli,Bulat-Ziganshin/brotli,google/brotli,rgordeev/brotli,daltonmaag/brotli,BuildAPE/brotli,emil-io/brotli,yonchev/brotli,PritiKumr/brotli,andrebellafronte/brotli,iamjbn/brotli,anthrotype/brotli,ya7lelkom/brotli,silky/brotli,archiveds/brotli,google/brotli,chinanjjohn2012/brotli,shadowkun/brotli,smourier/brotli,lvandeve/brotli,mark2007081021/brotli,dwdm/brotli,nicksay/brotli,archiveds/brotli,nicksay/brotli,samtechie/brotli,QuantumFractal/brotli,kaushik94/brotli,anthrotype/brotli,anthrotype/brotli,Abhikos/brotli,lzq8272587/brotli,samtechie/brotli,jqk6/brotli,abhishekgahlot/brotli,anthrotype/brotli,stamhe/brotli,yiliaofan/brotli,Mojang/brotli,WenyuDeng/brotli,ebiggers/brotli,bunnyblue/brotli,mcanthony/brotli,WenyuDeng/brotli,lvandeve/brotli,zofuthan/brotli,ruo91/brotli,s0ne0me/brotli,caidongyun/brotli,agordon/brotli,iamjbn/brotli,yonchev/brotli,archiveds/brotli,szabadka/brotli,emil-io/brotli,nicksay/brotli,fllsouto/brotli,rajathkumarmp/brotli,lzq8272587/brotli,daltonmaag/brotli,smourier/brotli,letup/brotli,jacklicn/brotli,google/brotli,thurday/brotli,andrebellafronte/brotli,rasata/brotli,mark2007081021/brotli,PritiKumr/brotli,rafaelbc/brotli,s0ne0me/brotli,google/brotli,datachand/brotli,silky/brotli,Bulat-Ziganshin/brotli,rasata/brotli,emil-io/brotli,merckhung/brotli,fllsouto/brotli,fllsouto/brotli,IIoTeP9HuY/brotli,shadowkun/brotli,shaunstanislaus/brotli,szabadka/brotli,rajat1994/brotli,CedarLogic/brotli,shadowkun/brotli,windhorn/brotli,hemel-cse/brotli,matsprea/brotli,QuantumFractal/brotli,fouzelddin/brotli,Endika/brotli,madhudskumar/brotli,minhlongdo/brotli,caidongyun/brotli,WenyuDeng/brotli,IIoTeP9HuY/brotli,cosmicwomp/brotli,chinanjjohn2012/brotli,Merterm/brotli,minhlongdo/brotli,thurday/brotli,dragon788/brotli,johnnycastilho/brotli,jacklicn/brotli,yiliaofan/brotli,PritiKumr/brotli,zhaohuaw/brotli,eric-seekas/brotli,PritiKumr/brotli,mk525/Code,rgordeev/brotli,shaunstanislaus/brotli,stamhe/brotli,sonivaibhv/brotli,CedarLogic/brotli,google/brotli,bunnyblue/brotli,chrislucas/brotli,cosmicwomp/brotli,IIoTeP9HuY/brotli,ya7lelkom/brotli,Abhikos/brotli,shadowkun/brotli,gk23/brotli,zofuthan/brotli,dwdm/brotli,google/brotli,shilpi230/brotli,FarhanHaque/brotli,noname007/brotli,Merterm/brotli,matsprea/brotli,dwdm/brotli,leo237/brotli,W3SS/brotli,Bulat-Ziganshin/brotli,Mojang/brotli,abhishekgahlot/brotli,hcxiong/brotli,bunnyblue/brotli,WenyuDeng/brotli,W3SS/brotli,CedarLogic/brotli,iamjbn/brotli,tml/brotli,koolhazz/brotli,datachand/brotli,karpinski/brotli,caidongyun/brotli,emil-io/brotli,mcanthony/brotli,shaunstanislaus/brotli,josl/brotli,johnnycastilho/brotli,fxfactorial/brotli,smourier/brotli,lukw00/brotli,letup/brotli,google/brotli,rajat1994/brotli,kaushik94/brotli,Endika/brotli,agordon/brotli,kasper93/brotli,luzhongtong/brotli,hemel-cse/brotli,tml/brotli,erichub/brotli,mcanthony/brotli,szabadka/brotli,BuildAPE/brotli,dragon788/brotli,josl/brotli,minhlongdo/brotli,nicksay/brotli,erichub/brotli,panaroma/brotli,kasper93/brotli,CedarLogic/brotli,hemel-cse/brotli,agordon/brotli,rayning0/brotli,minhlongdo/brotli,BuildAPE/brotli,sajith4u/brotli,tml/brotli,nicksay/brotli,QuantumFractal/brotli,szabadka/brotli,luzhongtong/brotli,windhorn/brotli,Mojang/brotli,datachand/brotli,datachand/brotli,rajathkumarmp/brotli,kaushik94/brotli,eric-seekas/brotli,stamhe/brotli,yonchev/brotli,yiliaofan/brotli,Endika/brotli,matsprea/brotli,madhudskumar/brotli,dragon788/brotli,google/brotli,fxfactorial/brotli,merckhung/brotli,gk23/brotli,hcxiong/brotli,gk23/brotli,erichub/brotli,mark2007081021/brotli,johnnycastilho/brotli,rasata/brotli,samtechie/brotli,sajith4u/brotli,ruo91/brotli,karpinski/brotli,madhudskumar/brotli,yiliaofan/brotli,IIoTeP9HuY/brotli,iamjbn/brotli,W3SS/brotli,matsprea/brotli,smourier/brotli,fxfactorial/brotli,koolhazz/brotli,FarhanHaque/brotli,fxfactorial/brotli,rgordeev/brotli,caidongyun/brotli,mcanthony/brotli,silky/brotli,FarhanHaque/brotli,hcxiong/brotli,panaroma/brotli,hcxiong/brotli,rajathkumarmp/brotli,panaroma/brotli,mk525/Code,abhishekgahlot/brotli,Endika/brotli,luzhongtong/brotli,ya7lelkom/brotli,Merterm/brotli,lvandeve/brotli,letup/brotli,ya7lelkom/brotli,jacklicn/brotli,rasata/brotli,QuantumFractal/brotli,jqk6/brotli,hemel-cse/brotli,nicksay/brotli,zofuthan/brotli,carlhuting/brotli,lzq8272587/brotli,rafaelbc/brotli,leo237/brotli,lukw00/brotli,rayning0/brotli,leo237/brotli,kaushik94/brotli,Merterm/brotli,panaroma/brotli,rafaelbc/brotli,zofuthan/brotli,smourier/brotli,bunnyblue/brotli,silky/brotli,erichub/brotli,archiveds/brotli,chrislucas/brotli,karpinski/brotli,carlhuting/brotli,jqk6/brotli,Mojang/brotli,Abhikos/brotli,andrebellafronte/brotli,king-jw/brotli,merckhung/brotli,daltonmaag/brotli,chinanjjohn2012/brotli,eric-seekas/brotli,cosmicwomp/brotli,abhishekgahlot/brotli,sonivaibhv/brotli,letup/brotli,eric-seekas/brotli,noname007/brotli,rayning0/brotli,kasper93/brotli,lzq8272587/brotli,carlhuting/brotli,ebiggers/brotli,leo237/brotli,andrebellafronte/brotli,dwdm/brotli,shilpi230/brotli,fouzelddin/brotli,rajathkumarmp/brotli,lvandeve/brotli,rgordeev/brotli,madhudskumar/brotli,rafaelbc/brotli,shilpi230/brotli,johnnycastilho/brotli,noname007/brotli,rajat1994/brotli,lukw00/brotli,mk525/Code,fouzelddin/brotli,shilpi230/brotli,thurday/brotli,ruo91/brotli,noname007/brotli,Bulat-Ziganshin/brotli,sajith4u/brotli,nicksay/brotli,king-jw/brotli,fouzelddin/brotli,thurday/brotli,ebiggers/brotli,fllsouto/brotli,sajith4u/brotli,tml/brotli,carlhuting/brotli,ruo91/brotli,mark2007081021/brotli,FarhanHaque/brotli,josl/brotli,zhaohuaw/brotli,BuildAPE/brotli,cosmicwomp/brotli,kasper93/brotli,jqk6/brotli,stamhe/brotli,merckhung/brotli,windhorn/brotli,mk525/Code,gk23/brotli,chinanjjohn2012/brotli,s0ne0me/brotli,zhaohuaw/brotli,Abhikos/brotli,rayning0/brotli,daltonmaag/brotli,chrislucas/brotli,chrislucas/brotli,shaunstanislaus/brotli,koolhazz/brotli,samtechie/brotli,s0ne0me/brotli,sonivaibhv/brotli,karpinski/brotli,sonivaibhv/brotli,agordon/brotli,ebiggers/brotli,rajat1994/brotli,jacklicn/brotli,josl/brotli,king-jw/brotli,zhaohuaw/brotli,king-jw/brotli,windhorn/brotli,lukw00/brotli,W3SS/brotli,dragon788/brotli,anthrotype/brotli
dd6237b0e8aa8b3d80f05e9fa4a225fd80d2d84c
#include <gmp.h> #include "m-array.h" #include "m-algo.h" ARRAY_DEF(mpz, mpz_t, M_CLASSIC_OPLIST(mpz)) ALGO_DEF(array_mpz, ARRAY_OPLIST(mpz, M_CLASSIC_OPLIST(mpz))) static inline void my_mpz_inc(mpz_t *d, const mpz_t a){ mpz_add(*d, *d, a); } static inline void my_mpz_sqr(mpz_t *d, const mpz_t a){ mpz_mul(*d, a, a); } int main(void) { mpz_t z; mpz_init_set_ui(z, 1); array_mpz_t a; array_mpz_init(a); array_mpz_push_back(a, z); for(size_t i = 2 ; i < 1000; i++) { mpz_mul_ui(z, z, i); array_mpz_push_back(a, z); } /* z = sum (a[i]^2) */ array_mpz_map_reduce (&z, a, my_mpz_inc, my_mpz_sqr); gmp_printf ("Z=%Zd\n", z); array_mpz_clear(a); mpz_clear(z); }
#include <gmp.h> #include "m-array.h" #include "m-algo.h" ARRAY_DEF(mpz, mpz_t, M_CLASSIC_OPLIST(mpz)) ALGO_DEF(array_mpz, ARRAY_OPLIST(mpz, M_CLASSIC_OPLIST(mpz))) static inline void my_mpz_inc(mpz_t d, const mpz_t a){ mpz_add(d, d, a); } static inline void my_mpz_sqr(mpz_t d, const mpz_t a){ mpz_mul(d, a, a); } int main(void) { mpz_t z; mpz_init_set_ui(z, 1); array_mpz_t a; array_mpz_init(a); array_mpz_push_back(a, z); for(size_t i = 2 ; i < 1000; i++) { mpz_mul_ui(z, z, i); array_mpz_push_back(a, z); } /* z = sum (a[i]^2) */ array_mpz_map_reduce (&z, a, my_mpz_inc, my_mpz_sqr); gmp_printf ("Z=%Zd\n", z); array_mpz_clear(a); mpz_clear(z); }
--- +++ @@ -6,11 +6,11 @@ ARRAY_DEF(mpz, mpz_t, M_CLASSIC_OPLIST(mpz)) ALGO_DEF(array_mpz, ARRAY_OPLIST(mpz, M_CLASSIC_OPLIST(mpz))) -static inline void my_mpz_inc(mpz_t d, const mpz_t a){ - mpz_add(d, d, a); +static inline void my_mpz_inc(mpz_t *d, const mpz_t a){ + mpz_add(*d, *d, a); } -static inline void my_mpz_sqr(mpz_t d, const mpz_t a){ - mpz_mul(d, a, a); +static inline void my_mpz_sqr(mpz_t *d, const mpz_t a){ + mpz_mul(*d, a, a); } int main(void)
Update example with new constraints on map/reduce prototype.
bsd-2-clause
P-p-H-d/mlib,P-p-H-d/mlib
1abf575c1cf36df59d0673c0e5d8b326f4526a8b
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some log library? enum class ReturnCode { Stop = 0, Return = 1, Suicide = 2, BadJumpDestination = 101, OutOfGas = 102, StackTooSmall = 103, BadInstruction = 104, LLVMConfigError = 201, LLVMCompileError = 202, LLVMLinkError = 203, }; /// Representation of 256-bit value binary compatible with LLVM i256 // TODO: Replace with h256 struct i256 { uint64_t a = 0; uint64_t b = 0; uint64_t c = 0; uint64_t d = 0; }; static_assert(sizeof(i256) == 32, "Wrong i265 size"); #define UNTESTED assert(false) } } }
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some log library? enum class ReturnCode { Stop = 0, Return = 1, Suicide = 2, BadJumpDestination = 101, OutOfGas = 102, StackTooSmall = 103, BadInstruction = 104, LLVMConfigError = 201, LLVMCompileError = 202, LLVMLinkError = 203, }; /// Representation of 256-bit value binary compatible with LLVM i256 // TODO: Replace with h256 struct i256 { uint64_t a; uint64_t b; uint64_t c; uint64_t d; }; static_assert(sizeof(i256) == 32, "Wrong i265 size"); #define UNTESTED assert(false) } } }
--- +++ @@ -37,10 +37,10 @@ // TODO: Replace with h256 struct i256 { - uint64_t a; - uint64_t b; - uint64_t c; - uint64_t d; + uint64_t a = 0; + uint64_t b = 0; + uint64_t c = 0; + uint64_t d = 0; }; static_assert(sizeof(i256) == 32, "Wrong i265 size");
Fix some GCC initialization warnings
mit
expanse-project/cpp-expanse,vaporry/cpp-ethereum,yann300/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,d-das/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,vaporry/evmjit,LefterisJP/cpp-ethereum,anthony-cros/cpp-ethereum,subtly/cpp-ethereum-micro,anthony-cros/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,expanse-org/cpp-expanse,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,smartbitcoin/cpp-ethereum,vaporry/webthree-umbrella,karek314/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,xeddmc/cpp-ethereum,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,gluk256/cpp-ethereum,eco/cpp-ethereum,eco/cpp-ethereum,expanse-org/cpp-expanse,arkpar/webthree-umbrella,d-das/cpp-ethereum,programonauta/webthree-umbrella,eco/cpp-ethereum,d-das/cpp-ethereum,gluk256/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,anthony-cros/cpp-ethereum,d-das/cpp-ethereum,subtly/cpp-ethereum-micro,expanse-org/cpp-expanse,subtly/cpp-ethereum-micro,johnpeter66/ethminer,d-das/cpp-ethereum,karek314/cpp-ethereum,smartbitcoin/cpp-ethereum,xeddmc/cpp-ethereum,johnpeter66/ethminer,PaulGrey30/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,LefterisJP/cpp-ethereum,expanse-project/cpp-expanse,subtly/cpp-ethereum-micro,expanse-project/cpp-expanse,vaporry/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,anthony-cros/cpp-ethereum,vaporry/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,expanse-project/cpp-expanse,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,xeddmc/cpp-ethereum,expanse-project/cpp-expanse,yann300/cpp-ethereum,eco/cpp-ethereum,smartbitcoin/cpp-ethereum,yann300/cpp-ethereum,yann300/cpp-ethereum,expanse-org/cpp-expanse,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,vaporry/cpp-ethereum,karek314/cpp-ethereum,subtly/cpp-ethereum-micro,smartbitcoin/cpp-ethereum,subtly/cpp-ethereum-micro,d-das/cpp-ethereum,vaporry/cpp-ethereum,smartbitcoin/cpp-ethereum,smartbitcoin/cpp-ethereum,ethers/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,LefterisJP/webthree-umbrella,PaulGrey30/go-get--u-github.com-tools-godep,Sorceror32/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,LefterisJP/webthree-umbrella,expanse-org/cpp-expanse,gluk256/cpp-ethereum,joeldo/cpp-ethereum,gluk256/cpp-ethereum,eco/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,programonauta/webthree-umbrella,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,ethers/cpp-ethereum,gluk256/cpp-ethereum,xeddmc/cpp-ethereum,expanse-org/cpp-expanse,ethers/cpp-ethereum,karek314/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,LefterisJP/cpp-ethereum,LefterisJP/cpp-ethereum,ethers/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,chfast/webthree-umbrella,anthony-cros/cpp-ethereum,vaporry/evmjit,anthony-cros/cpp-ethereum,expanse-project/cpp-expanse,johnpeter66/ethminer,gluk256/cpp-ethereum,yann300/cpp-ethereum,yann300/cpp-ethereum,ethers/cpp-ethereum,eco/cpp-ethereum,vaporry/cpp-ethereum
961166443c193be490106684f3c29e894d21dcfd
/** * This file is part of the librailcan library. * * Copyright (C) 2015 Reinder Feenstra <reinderfeenstra@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA */ #include "librailcan.h" #include <string.h> int debug_level = LIBRAILCAN_DEBUGLEVEL_NONE; int librailcan_set_debug_level( int level ) { if( level < LIBRAILCAN_DEBUGLEVEL_NONE || level > LIBRAILCAN_DEBUGLEVEL_DEBUG ) return LIBRAILCAN_STATUS_INVALID_PARAM; debug_level = level; return LIBRAILCAN_STATUS_SUCCESS; }
/** * This file is part of the librailcan library. * * Copyright (C) 2015 Reinder Feenstra <reinderfeenstra@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA */ #include "librailcan.h" #include <string.h> int debug_level = LIBRAILCAN_DEBUGLEVEL_DEBUG;//LIBRAILCAN_DEBUGLEVEL_NONE; int librailcan_set_debug_level( int level ) { if( level < LIBRAILCAN_DEBUGLEVEL_NONE || level > LIBRAILCAN_DEBUGLEVEL_DEBUG ) return LIBRAILCAN_STATUS_INVALID_PARAM; debug_level = level; return LIBRAILCAN_STATUS_SUCCESS; }
--- +++ @@ -22,7 +22,7 @@ #include "librailcan.h" #include <string.h> -int debug_level = LIBRAILCAN_DEBUGLEVEL_DEBUG;//LIBRAILCAN_DEBUGLEVEL_NONE; +int debug_level = LIBRAILCAN_DEBUGLEVEL_NONE; int librailcan_set_debug_level( int level ) {
Set default debug level to none.
lgpl-2.1
reinder/librailcan,reinder/librailcan,reinder/librailcan
bc9445a9173ec23196a3fdbfb3cfb5ea4bc1d084
// RUN: %check %s struct A { int i; }; void take(void *); int f(const void *p) { struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const) struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/ (void)a; (void)b; const char c = 5; take(&c); // CHECK: warning: implicit cast removes qualifiers (const) }
// RUN: %check %s struct A { int i; }; int f(const void *p) { struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const) struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/ (void)a; (void)b; }
--- +++ @@ -4,6 +4,8 @@ { int i; }; + +void take(void *); int f(const void *p) { @@ -12,4 +14,7 @@ (void)a; (void)b; + + const char c = 5; + take(&c); // CHECK: warning: implicit cast removes qualifiers (const) }
Add another case to qualifier-removal test
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
9d0b2a96595333aef5c4dd7ab0f15d9c663aee2a
#include "input.h" #include "command.h" TreeNode curNode; char curPlane, extra; void initializeInput() { initializeCommands(); curPlane = 0; } void handleInput(char ch, AtcsoData *data, WINDOW *msgWin) { if (!curPlane) { if (ch >= 'a' && ch <= 'z') { curPlane = ch; curNode = commands; waddch(msgWin, ch); waddch(msgWin, ':'); wrefresh(msgWin); } } else if (ch == '\n') { if (curNode.func) { (*curNode.func)(data, curPlane, extra); curPlane = 0; werase(msgWin); wrefresh(msgWin); } } else { extra = ch; if (ch >= '0' && ch <= '9') ch = '#'; for (int i = 0; i < curNode.nChildren; ++i) { if (curNode.children[i].hotkey == ch) { curNode = curNode.children[i]; waddch(msgWin, ' '); if (ch == '#') { wprintw(msgWin, curNode.str, extra); } else { waddstr(msgWin, curNode.str); } wrefresh(msgWin); break; } } } }
#include "input.h" #include "command.h" TreeNode curNode; char curPlane, extra; void initializeInput() { initializeCommands(); curPlane = 0; } void handleInput(char ch, AtcsoData *data, WINDOW *msgWin) { if (!curPlane) { if (ch >= 'a' && ch <= 'z') { curPlane = ch; curNode = commands; waddch(msgWin, ch); waddch(msgWin, ':'); wrefresh(msgWin); } } else if (ch == '\n') { if (curNode.func) { (*curNode.func)(data, curPlane, extra); curPlane = 0; werase(msgWin); wrefresh(msgWin); } } else { extra = '\0'; if (ch >= '0' && ch <= '9') { extra = ch; ch = '#'; } for (int i = 0; i < curNode.nChildren; ++i) { if (curNode.children[i].hotkey == ch) { curNode = curNode.children[i]; waddch(msgWin, ' '); if (extra) { wprintw(msgWin, curNode.str, extra); } else { waddstr(msgWin, curNode.str); } wrefresh(msgWin); break; } } } }
--- +++ @@ -26,17 +26,14 @@ wrefresh(msgWin); } } else { - extra = '\0'; - if (ch >= '0' && ch <= '9') { - extra = ch; - ch = '#'; - } + extra = ch; + if (ch >= '0' && ch <= '9') ch = '#'; for (int i = 0; i < curNode.nChildren; ++i) { if (curNode.children[i].hotkey == ch) { curNode = curNode.children[i]; waddch(msgWin, ' '); - if (extra) { + if (ch == '#') { wprintw(msgWin, curNode.str, extra); } else { waddstr(msgWin, curNode.str);
Fix bizarre bug in "altitude [climb|descend]" Climb was descending, and descend was climbing. Turns out it's because they were trying to climb/descend... newline amount. O_o
mit
KeyboardFire/atcso
f8f561cce68c06ccf63d1ba9e3503c230daf0f8b
#ifndef __KMS_URI_END_POINT_STATE_H__ #define __KMS_URI_END_POINT_STATE_H__ G_BEGIN_DECLS typedef enum { KMS_URI_END_POINT_STATE_STOP, KMS_URI_END_POINT_STATE_START, KMS_URI_END_POINT_STATE_PAUSE } KmsUriEndPointState; G_END_DECLS #endif /* __KMS_URI_END_POINT_STATE__ */
#ifndef __KMS_URI_END_POINT_STATE_H__ #define __KMS_URI_END_POINT_STATE_H__ G_BEGIN_DECLS typedef enum { KMS_URI_END_POINT_STATE_STOP, KMS_URI_END_POINT_STATE_START, KMS_URI_END_POINT_STATE_PLAY } KmsUriEndPointState; G_END_DECLS #endif /* __KMS_URI_END_POINT_STATE__ */
--- +++ @@ -7,7 +7,7 @@ { KMS_URI_END_POINT_STATE_STOP, KMS_URI_END_POINT_STATE_START, - KMS_URI_END_POINT_STATE_PLAY + KMS_URI_END_POINT_STATE_PAUSE } KmsUriEndPointState; G_END_DECLS
Fix state definition for UriEndPointElement Change-Id: I72aff01136f3f13536e409040e42ad1a6dffcd4d
apache-2.0
Kurento/kms-elements,shelsonjava/kms-elements,TribeMedia/kms-elements,Kurento/kms-elements,shelsonjava/kms-elements,shelsonjava/kms-elements,TribeMedia/kms-elements,TribeMedia/kms-elements,Kurento/kms-elements
3f75051b71f0187e6045ecd2c4e84a6e4424dc04
/* * Copyright (c) 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * be found in the LICENSE file. */ #include <stdlib.h> #include <stdio.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" #include "native_client/src/trusted/service_runtime/nacl_signal.h" void NaClAbort(void) { NaClExit(-SIGABRT); } void NaClExit(int err_code) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit(err_code); #else /* If the process is scheduled for termination, wait for it.*/ if (TerminateProcess(GetCurrentProcess(), err_code)) { while(1); } /* Otherwise use the standard C process exit to bybass destructors. */ ExitProcess(err_code); #endif }
/* * Copyright 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ #include <stdlib.h> #include <stdio.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" #include "native_client/src/trusted/service_runtime/nacl_signal.h" void NaClAbort(void) { NaClExit(-SIGABRT); } void NaClExit(int err_code) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit(err_code); #else /* If the process is scheduled for termination, wait for it.*/ if (TerminateProcess(GetCurrentProcess(), err_code)) { printf("Terminate passed, but returned.\n"); while(1); } printf("Terminate failed with %d.\n", GetLastError()); /* Otherwise use the standard C process exit to bybass destructors. */ ExitProcess(err_code); #endif }
--- +++ @@ -1,6 +1,6 @@ /* - * Copyright 2011 The Native Client Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can + * Copyright (c) 2011 The Native Client Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be * be found in the LICENSE file. */ @@ -23,10 +23,8 @@ #else /* If the process is scheduled for termination, wait for it.*/ if (TerminateProcess(GetCurrentProcess(), err_code)) { - printf("Terminate passed, but returned.\n"); while(1); } - printf("Terminate failed with %d.\n", GetLastError()); /* Otherwise use the standard C process exit to bybass destructors. */ ExitProcess(err_code);
Remove printfs in exit path Due to failures in Win7Atom I added printfs for debugging. This CL removes the printfs which should not be in the shipping code. TEST= all BUG= nacl1561 Review URL: http://codereview.chromium.org/6825057 git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@4846 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
bsd-3-clause
nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client
8b013deb4e9cd4130ece436909878b7ec7d90a60
#define JOIN_(a, b) a ## b #define JOIN(a, b) JOIN_(a, b) #define SYMBL(x) JOIN(__USER_LABEL_PREFIX__, x) #if defined(__linux__) # define SECTION_NAME_TEXT .text # define SECTION_NAME_BSS .bss .section .note.GNU-stack,"",@progbits #elif defined(__DARWIN__) # define SECTION_NAME_TEXT __TEXT,__text # define SECTION_NAME_BSS __BSS,__bss #else # error unknown target #endif
#define JOIN_(a, b) a ## b #define JOIN(a, b) JOIN_(a, b) #define SYMBL(x) JOIN(__USER_LABEL_PREFIX__, x) #if defined(__linux__) # define SECTION_NAME_TEXT .text # define SECTION_NAME_BSS .bss #elif defined(__DARWIN__) # define SECTION_NAME_TEXT __TEXT,__text # define SECTION_NAME_BSS __BSS,__bss #else # error unknown target #endif
--- +++ @@ -6,6 +6,9 @@ #if defined(__linux__) # define SECTION_NAME_TEXT .text # define SECTION_NAME_BSS .bss + +.section .note.GNU-stack,"",@progbits + #elif defined(__DARWIN__) # define SECTION_NAME_TEXT __TEXT,__text # define SECTION_NAME_BSS __BSS,__bss
Enable noexecstack for local-lib builds
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
0286596dd6eee2b3573722716af45395314e4246
/* trace.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Tracing support for runops_cores.c. * Data Structure and Algorithms: * History: * Notes: * References: */ #ifndef PARROT_TRACE_H_GUARD #define PARROT_TRACE_H_GUARD #include "parrot/parrot.h" void trace_op_dump(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, opcode_t *pc); void trace_op_b0(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op_b1(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, opcode_t *pc); #endif /* * Local variables: * c-indentation-style: bsd * c-basic-offset: 4 * indent-tabs-mode: nil * End: * * vim: expandtab shiftwidth=4: */
/* trace.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Tracing support for runops_cores.c. * Data Structure and Algorithms: * History: * Notes: * References: */ #ifndef PARROT_TRACE_H_GUARD #define PARROT_TRACE_H_GUARD #include "parrot/parrot.h" void trace_op_dump(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, opcode_t *pc); void trace_op_b0(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op_b1(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, code_t *pc); #endif /* * Local variables: * c-indentation-style: bsd * c-basic-offset: 4 * indent-tabs-mode: nil * End: * * vim: expandtab shiftwidth=4: */
--- +++ @@ -25,7 +25,7 @@ opcode_t *pc); void trace_op_b1(struct Parrot_Interp *interpreter, opcode_t *code_start, - opcode_t *code_end, code_t *pc); + opcode_t *code_end, opcode_t *pc); #endif
Fix a typo in the argument type. Patch from <daniel.ritz@gmx.ch> git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@1106 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
artistic-2.0
ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot
b62006060ff1b9079f7d4a6771b6079a34399c83
// // BBAAPIErrors.h // BBAAPI // // Created by Owen Worley on 11/08/2014. // Copyright (c) 2014 Blinkbox Books. All rights reserved. // NS_ENUM(NSInteger, BBAAPIError) { /** * Used when needed parameter is not supplied to the method * or when object is supplied but it has wrong type or * for example one of it's needed properties is not set */ BBAAPIWrongUsage = 700, /** * Error returned when for any reason API call cannot connect to the server */ BBAAPIErrorCouldNotConnect = 701, /** * Returned when call cannot be authenticated, or when server returns 401 */ BBAAPIErrorUnauthorised = 702, /** * Used when server cannot find a resource and returns 404 */ BBAAPIErrorNotFound = 703, /** * Used when server returns 500 */ BBAAPIServerError = 704, /** * Used when server returns 403 */ BBAAPIErrorForbidden = 705, /** * Used when we cannot decode or read data returned from the server */ BBAAPIUnreadableData = 706, /** * Used when the server returns a 400 (Bad Request) */ BBAAPIErrorBadRequest = 707, /** * Used when the server returns a 409 (Conflict) */ BBAAPIErrorConflict = 708, };
// // BBAAPIErrors.h // BBAAPI // // Created by Owen Worley on 11/08/2014. // Copyright (c) 2014 Blinkbox Books. All rights reserved. // NS_ENUM(NSInteger, BBAAPIError) { /** * Used when needed parameter is not supplied to the method * or when object is supplied but it has wrong type or * for example one of it's needed properties is not set */ BBAAPIWrongUsage = 700, /** * Error returned when for any reason API call cannot connect to the server */ BBAAPIErrorCouldNotConnect = 701, /** * Returned when call cannot be authenticated, or when server returns 401 */ BBAAPIErrorUnauthorised = 702, /** * Used when server cannot find a resource and returns 404 */ BBAAPIErrorNotFound = 703, /** * Used when server returns 500 */ BBAAPIServerError = 704, /** * Used when server returns 403 */ BBAAPIErrorForbidden = 705, /** * Used when we cannot decode or read data returned from the server */ BBAAPIUnreadableData = 706, /** * Used when the server returns a 400 (Bad Request) */ BBAAPIBadRequest = 707, };
--- +++ @@ -40,6 +40,10 @@ /** * Used when the server returns a 400 (Bad Request) */ - BBAAPIBadRequest = 707, + BBAAPIErrorBadRequest = 707, + /** + * Used when the server returns a 409 (Conflict) + */ + BBAAPIErrorConflict = 708, };
Add BBAAPIError code for 409 conflict
mit
blinkboxbooks/blinkbox-network.objc,blinkboxbooks/blinkbox-network.objc
ee1c651b874656b27267266797d6fb693764c621
/* * getarguments.c -- Get the argument vector ready to go. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include <h/mh.h> #include <h/utils.h> char ** getarguments (char *invo_name, int argc, char **argv, int check_context) { char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL; int n = 0; /* * Check if profile/context specifies any arguments */ if (check_context && (cp = context_find (invo_name))) { cp = mh_xstrdup(cp); /* make copy */ ap = brkstring (cp, " ", "\n"); /* split string */ /* Count number of arguments split */ bp = ap; while (*bp++) n++; } arguments = (char **) mh_xmalloc ((argc + n) * sizeof(*arguments)); bp = arguments; /* Copy any arguments from profile/context */ if (ap != NULL && n > 0) { while (*ap) *bp++ = *ap++; } /* Copy arguments from command line */ argv++; while (*argv) *bp++ = *argv++; /* Now NULL terminate the array */ *bp = NULL; return arguments; }
/* * getarguments.c -- Get the argument vector ready to go. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include <h/mh.h> #include <h/utils.h> char ** getarguments (char *invo_name, int argc, char **argv, int check_context) { char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL; int n = 0; /* * Check if profile/context specifies any arguments */ if (check_context && (cp = context_find (invo_name))) { cp = getcpy (cp); /* make copy */ ap = brkstring (cp, " ", "\n"); /* split string */ /* Count number of arguments split */ bp = ap; while (*bp++) n++; } arguments = (char **) mh_xmalloc ((argc + n) * sizeof(*arguments)); bp = arguments; /* Copy any arguments from profile/context */ if (ap != NULL && n > 0) { while (*ap) *bp++ = *ap++; } /* Copy arguments from command line */ argv++; while (*argv) *bp++ = *argv++; /* Now NULL terminate the array */ *bp = NULL; return arguments; }
--- +++ @@ -20,7 +20,7 @@ * Check if profile/context specifies any arguments */ if (check_context && (cp = context_find (invo_name))) { - cp = getcpy (cp); /* make copy */ + cp = mh_xstrdup(cp); /* make copy */ ap = brkstring (cp, " ", "\n"); /* split string */ /* Count number of arguments split */
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
bsd-3-clause
mcr/nmh,mcr/nmh
92dd7b914b878f2172b4d436e9643c4a0d24683b
/* * BDSup2Sub++ (C) 2012 Adam T. * Based on code from BDSup2Sub by Copyright 2009 Volker Oth (0xdeadbeef) * and Copyright 2012 Miklos Juhasz (mjuhasz) * * * 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 PALETTEINFO_H #define PALETTEINFO_H class PaletteInfo { public: PaletteInfo(); PaletteInfo(const PaletteInfo* other); PaletteInfo(const PaletteInfo& other); int paletteOffset() { return offset; } void setPaletteOffset(int paletteOffset) { offset = paletteOffset; } int paletteSize() { return size; } void setPaletteSize(int paletteSize) { size = paletteSize; } private: int offset = -1; int size = -1; }; #endif // PALETTEINFO_H
/* * BDSup2Sub++ (C) 2012 Adam T. * Based on code from BDSup2Sub by Copyright 2009 Volker Oth (0xdeadbeef) * and Copyright 2012 Miklos Juhasz (mjuhasz) * * * 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 PALETTEINFO_H #define PALETTEINFO_H class PaletteInfo { public: PaletteInfo(); PaletteInfo(const PaletteInfo* other); PaletteInfo(const PaletteInfo& other); int paletteOffset() { return offset; } void setPaletteOffset(int paletteOffset) { offset = paletteOffset; } int paletteSize() { return size; } void setPaletteSize(int paletteSize) { size = paletteSize; } private: int offset = 0; int size = 0; }; #endif // PALETTEINFO_H
--- +++ @@ -33,8 +33,8 @@ void setPaletteSize(int paletteSize) { size = paletteSize; } private: - int offset = 0; - int size = 0; + int offset = -1; + int size = -1; }; #endif // PALETTEINFO_H
Change default values to -1.
apache-2.0
darealshinji/BDSup2SubPlusPlus,amichaelt/BDSup2SubPlusPlus,amichaelt/BDSup2SubPlusPlus,darealshinji/BDSup2SubPlusPlus
2788f282bbd2e945c1e77c94bc45b8ece5f9b4db
#include <math.h> #include <pal.h> static const float pi_2 = (float) M_PI / 2.f; /** * * Computes the inverse cosine (arc cosine) of the input vector 'a'. Input * values to acos must be in the range -1 to 1. The result values are in the * range 0 to pi. The function does not check for illegal input values. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @return None * */ void p_acos_f32(const float *a, float *c, int n) { int i; float tmp; /* acos x = pi/2 - asin x */ p_asin_f32(a, c, n); for (i = 0; i < n; i++) { tmp = pi_2 - c[i]; c[i] = tmp; } }
#include <pal.h> /** * * Computes the inverse cosine (arc cosine) of the input vector 'a'. Input * values to acos must be in the range -1 to 1. The result values are in the * range 0 to pi. The function does not check for illegal input values. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @return None * */ #include <math.h> void p_acos_f32(const float *a, float *c, int n) { int i; for (i = 0; i < n; i++) { *(c + i) = acosf(*(a + i)); } }
--- +++ @@ -1,4 +1,7 @@ +#include <math.h> #include <pal.h> + +static const float pi_2 = (float) M_PI / 2.f; /** * @@ -15,12 +18,15 @@ * @return None * */ -#include <math.h> void p_acos_f32(const float *a, float *c, int n) { int i; + float tmp; + /* acos x = pi/2 - asin x */ + p_asin_f32(a, c, n); for (i = 0; i < n; i++) { - *(c + i) = acosf(*(a + i)); + tmp = pi_2 - c[i]; + c[i] = tmp; } }
math:acos: Implement the inverse cosine function. Signed-off-by: Mansour Moufid <ac5f6b12fab5e0d4efa7215e6c2dac9d55ab77dc@gmail.com>
apache-2.0
debug-de-su-ka/pal,parallella/pal,eliteraspberries/pal,aolofsson/pal,aolofsson/pal,Adamszk/pal3,debug-de-su-ka/pal,eliteraspberries/pal,eliteraspberries/pal,parallella/pal,mateunho/pal,debug-de-su-ka/pal,mateunho/pal,mateunho/pal,debug-de-su-ka/pal,olajep/pal,8l/pal,Adamszk/pal3,8l/pal,parallella/pal,debug-de-su-ka/pal,8l/pal,eliteraspberries/pal,aolofsson/pal,parallella/pal,eliteraspberries/pal,olajep/pal,parallella/pal,mateunho/pal,olajep/pal,aolofsson/pal,8l/pal,olajep/pal,Adamszk/pal3,mateunho/pal,Adamszk/pal3
fa7c9bc2318b195aa8218e51e8f1c4b1f52ac43e
/* * copyright 2015 wink saville * * licensed under the apache license, version 2.0 (the "license"); * you may not use this file except in compliance with the license. * you may obtain a copy of the license at * * http://www.apache.org/licenses/license-2.0 * * unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "as is" basis, * without warranties or conditions of any kind, either express or implied. * see the license for the specific language governing permissions and * limitations under the license. */ #include "poweroff.h" #include "inttypes.h" void poweroff(void) { volatile uint32_t* pUnlockResetReg = (uint32_t*)0x10000020; volatile uint32_t* pResetReg = (uint32_t*)0x10000040; // If qemu is executed with -no-reboot option then // resetting the board will cause qemu to exit // and it won't be necessary to ctrl-a, x to exit. // See http://lists.nongnu.org/archive/html/qemu-discuss/2015-10/msg00057.html // For arm926ej-s you unlock the reset register // then reset the board, I'm resetting to level 6 *pUnlockResetReg = 0xA05F; *pResetReg = 0x106; }
/* * copyright 2015 wink saville * * licensed under the apache license, version 2.0 (the "license"); * you may not use this file except in compliance with the license. * you may obtain a copy of the license at * * http://www.apache.org/licenses/license-2.0 * * unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "as is" basis, * without warranties or conditions of any kind, either express or implied. * see the license for the specific language governing permissions and * limitations under the license. */ #include "poweroff.h" #include "inttypes.h" void poweroff(void) { uint32_t* pUnlockResetReg = (uint32_t*)0x10000020; uint32_t* pResetReg = (uint32_t*)0x10000040; // If qemu is executed with -no-reboot option then // resetting the board will cause qemu to exit // and it won't be necessary to ctrl-a, x to exit. // See http://lists.nongnu.org/archive/html/qemu-discuss/2015-10/msg00057.html // For arm926ej-s you unlock the reset register // then reset the board, I'm resetting to level 6 *pUnlockResetReg = 0xA05F; *pResetReg = 0x106; }
--- +++ @@ -18,8 +18,8 @@ #include "inttypes.h" void poweroff(void) { - uint32_t* pUnlockResetReg = (uint32_t*)0x10000020; - uint32_t* pResetReg = (uint32_t*)0x10000040; + volatile uint32_t* pUnlockResetReg = (uint32_t*)0x10000020; + volatile uint32_t* pResetReg = (uint32_t*)0x10000040; // If qemu is executed with -no-reboot option then // resetting the board will cause qemu to exit
Make the registers address point to volatile memory.
apache-2.0
winksaville/sadie,winksaville/sadie
619091d3ae52943e7dfd093073eb4027146e093f
#include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include <sys/param.h> #include "linenoise.h" #define HISTORY_FILE ".beaksh_history" char* findPrompt(); char* getHistoryPath(); void executeCommand(const char *text); int main() { int childPid; int child_status; char *line; char *prompt; prompt = findPrompt(); char *historyPath = getHistoryPath(); linenoiseHistoryLoad(historyPath); while((line = linenoise(prompt)) != NULL) { if (line[0] != '\0') { linenoiseHistoryAdd(line); linenoiseHistorySave(historyPath); childPid = fork(); if(childPid == 0) { executeCommand(line); } else { wait(&child_status); } } free(line); } if(historyPath) free(historyPath); return EXIT_SUCCESS; } char* findPrompt() { return "$ "; } /* Resolve dotfile path for history. Returns NULL if file can't be resolved. */ char* getHistoryPath() { char *home = getenv("HOME"); if(!home) return NULL; int home_path_len = strnlen(home, MAXPATHLEN); int history_path_len = home_path_len + strlen(HISTORY_FILE) + 1; char *result; if((result = malloc(history_path_len + 1)) == NULL) { fprintf(stderr, "Problem resolving path for history file, no history will be recorded\n"); return NULL; } strncpy(result, home, home_path_len); strncat(result, "/", 1); strncat(result, HISTORY_FILE, strlen(HISTORY_FILE)); return result; } void executeCommand(const char *text) { execlp(text, text, NULL); }
#include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include "linenoise.h" char* findPrompt(); void executeCommand(const char *text); int main() { int childPid; int child_status; char *line; char *prompt; prompt = findPrompt(); while((line = linenoise(prompt)) != NULL) { if (line[0] != '\0') { linenoiseHistoryAdd(line); childPid = fork(); if(childPid == 0) { executeCommand(line); } else { wait(&child_status); } } free(line); } return 0; } char* findPrompt() { return "$ "; } void executeCommand(const char *text) { execlp(text, text, NULL); }
--- +++ @@ -2,9 +2,13 @@ #include <unistd.h> #include <stdio.h> #include <string.h> +#include <sys/param.h> #include "linenoise.h" +#define HISTORY_FILE ".beaksh_history" + char* findPrompt(); +char* getHistoryPath(); void executeCommand(const char *text); int main() { @@ -15,9 +19,13 @@ prompt = findPrompt(); + char *historyPath = getHistoryPath(); + linenoiseHistoryLoad(historyPath); + while((line = linenoise(prompt)) != NULL) { if (line[0] != '\0') { linenoiseHistoryAdd(line); + linenoiseHistorySave(historyPath); childPid = fork(); if(childPid == 0) { executeCommand(line); @@ -27,13 +35,43 @@ } free(line); } - return 0; + + if(historyPath) + free(historyPath); + + return EXIT_SUCCESS; } char* findPrompt() { return "$ "; } +/* + Resolve dotfile path for history. Returns NULL if file can't be resolved. +*/ +char* getHistoryPath() { + char *home = getenv("HOME"); + + if(!home) + return NULL; + + int home_path_len = strnlen(home, MAXPATHLEN); + int history_path_len = home_path_len + strlen(HISTORY_FILE) + 1; + + char *result; + + if((result = malloc(history_path_len + 1)) == NULL) { + fprintf(stderr, "Problem resolving path for history file, no history will be recorded\n"); + return NULL; + } + + strncpy(result, home, home_path_len); + strncat(result, "/", 1); + strncat(result, HISTORY_FILE, strlen(HISTORY_FILE)); + + return result; +} + void executeCommand(const char *text) { execlp(text, text, NULL); }
Add persistent history to shell Closes #3.
mit
futureperfect/beaksh
f749ea43d24a3ee328ee77c6de3838f3fef11d30
// // LJSStop.h // LJSYourNextBus // // Created by Luke Stringer on 29/01/2014. // Copyright (c) 2014 Luke Stringer. All rights reserved. // #import <Foundation/Foundation.h> @interface LJSStop : NSObject <NSCopying> /** * An 8 digit stop number starting with e.g. 450 for West Yorkshire or 370 for South Yorkshire */ @property (nonatomic, copy, readonly) NSString *NaPTANCode; @property (nonatomic, copy, readonly) NSString *title; @property (nonatomic, copy, readonly) NSDate *liveDate; @property (nonatomic, copy, readonly) NSArray *services; - (BOOL)isEqualToStop:(LJSStop *)stop; @end
// // LJSStop.h // LJSYourNextBus // // Created by Luke Stringer on 29/01/2014. // Copyright (c) 2014 Luke Stringer. All rights reserved. // #import <Foundation/Foundation.h> @interface LJSStop : NSObject <NSCopying> @property (nonatomic, copy, readonly) NSString *NaPTANCode; @property (nonatomic, copy, readonly) NSString *title; @property (nonatomic, copy, readonly) NSDate *liveDate; @property (nonatomic, copy, readonly) NSArray *services; - (BOOL)isEqualToStop:(LJSStop *)stop; @end
--- +++ @@ -10,6 +10,9 @@ @interface LJSStop : NSObject <NSCopying> +/** + * An 8 digit stop number starting with e.g. 450 for West Yorkshire or 370 for South Yorkshire + */ @property (nonatomic, copy, readonly) NSString *NaPTANCode; @property (nonatomic, copy, readonly) NSString *title; @property (nonatomic, copy, readonly) NSDate *liveDate;
Comment explaining what a valid NaPTAN code is.
mit
lukestringer90/LJSYourNextBus,lukestringer90/LJSYourNextBus
99e8bd7b02314af8fc801e1e1bb3eab4a3cb8ccd
/* * Raphael Kubo da Costa - RA 072201 * * MC514 - Lab2 */ #ifndef __THREAD_TREE_H #define __THREAD_TREE_H typedef struct { size_t *interested; pthread_t *list; size_t n_elem; size_t turn; } ThreadLevel; typedef struct { size_t height; ThreadLevel **tree; } ThreadTree; ThreadTree *thread_tree_new(size_t numthreads); void thread_tree_free(ThreadTree *tree); #endif /* __THREAD_TREE_H */
/* * Raphael Kubo da Costa - RA 072201 * * MC514 - Lab2 */ #ifndef __THREAD_TREE_H #define __THREAD_TREE_H typedef struct { size_t n_elem; pthread_t *list; } ThreadLevel; typedef struct { size_t height; ThreadLevel **tree; } ThreadTree; ThreadTree *thread_tree_new(size_t numthreads); void thread_tree_free(ThreadTree *tree); #endif /* __THREAD_TREE_H */
--- +++ @@ -9,8 +9,10 @@ typedef struct { + size_t *interested; + pthread_t *list; size_t n_elem; - pthread_t *list; + size_t turn; } ThreadLevel; typedef struct
Add turn and interested fields per level
bsd-2-clause
rakuco/peterson_futex
288f2d1cfa42f8b380ef6a3e3f175a8b474f8303
/* chardata.h Interface to some helper routines used to accumulate and check text and attribute content. */ #ifndef XML_CHARDATA_H #define XML_CHARDATA_H 1 #ifndef XML_VERSION #include "expat.h" /* need XML_Char */ #endif typedef struct { int count; /* # of chars, < 0 if not set */ XML_Char data[1024]; } CharData; void CharData_Init(CharData *storage); void CharData_AppendString(CharData *storage, const char *s); void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len); int CharData_CheckString(CharData *storage, const char *s); int CharData_CheckXMLChars(CharData *storage, const XML_Char *s); #endif /* XML_CHARDATA_H */
/* chardata.h * * */ #ifndef XML_CHARDATA_H #define XML_CHARDATA_H 1 #ifndef XML_VERSION #include "expat.h" /* need XML_Char */ #endif typedef struct { int count; /* # of chars, < 0 if not set */ XML_Char data[1024]; } CharData; void CharData_Init(CharData *storage); void CharData_AppendString(CharData *storage, const char *s); void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len); int CharData_CheckString(CharData *storage, const char *s); int CharData_CheckXMLChars(CharData *storage, const XML_Char *s); #endif /* XML_CHARDATA_H */
--- +++ @@ -1,7 +1,8 @@ -/* chardata.h - * - * - */ +/* chardata.h + + Interface to some helper routines used to accumulate and check text + and attribute content. +*/ #ifndef XML_CHARDATA_H #define XML_CHARDATA_H 1
Add a small comment to tell what this is.
mit
PKRoma/expat,PKRoma/expat,PKRoma/expat,PKRoma/expat
fbfc30dffdc5f4a5e9d04f070dcbe8344f3a1c94
#ifndef SAUCE_SAUCE_EXCEPTIONS_H_ #define SAUCE_SAUCE_EXCEPTIONS_H_ #include <string> #include <stdexcept> namespace sauce { /** * Base class for all sauce exceptions. */ struct Exception: std::runtime_error { Exception(std::string message): std::runtime_error(message) {} }; /** * Raised when no binding can be found for a given interface. * * TODO sure would be nice to know who.. */ struct UnboundException: Exception { UnboundException(): Exception("Request for unbound interface.") {} }; /** * Raised when a cycle is found in the interface's dependencies. * * TODO sure would be nice to know what the cycle is.. */ struct CircularDependencyException: Exception { CircularDependencyException(): Exception("Request for unbound interface.") {} }; } #endif // ifndef SAUCE_SAUCE_EXCEPTIONS_H_
#ifndef SAUCE_SAUCE_EXCEPTIONS_H_ #define SAUCE_SAUCE_EXCEPTIONS_H_ #include <stdexcept> namespace sauce { /** * Raised when no binding can be found for a given interface. * * TODO sure would be nice to know who.. */ struct UnboundException: public std::runtime_error { UnboundException(): std::runtime_error("Request for unbound interface.") {} }; } #endif // ifndef SAUCE_SAUCE_EXCEPTIONS_H_
--- +++ @@ -1,19 +1,37 @@ #ifndef SAUCE_SAUCE_EXCEPTIONS_H_ #define SAUCE_SAUCE_EXCEPTIONS_H_ +#include <string> #include <stdexcept> namespace sauce { + +/** + * Base class for all sauce exceptions. + */ +struct Exception: std::runtime_error { + Exception(std::string message): + std::runtime_error(message) {} +}; /** * Raised when no binding can be found for a given interface. * * TODO sure would be nice to know who.. */ -struct UnboundException: - public std::runtime_error { +struct UnboundException: Exception { UnboundException(): - std::runtime_error("Request for unbound interface.") {} + Exception("Request for unbound interface.") {} +}; + +/** + * Raised when a cycle is found in the interface's dependencies. + * + * TODO sure would be nice to know what the cycle is.. + */ +struct CircularDependencyException: Exception { + CircularDependencyException(): + Exception("Request for unbound interface.") {} }; }
Add a circular dependency exception. Also break out an exception base type.
mit
phs/sauce,phs/sauce,phs/sauce,phs/sauce
7a61dc2985b7095d1bc413d014ca3c06e5bc4477
/** * The login information to access a server * * This class combines login, password and vhost * * @copyright 2014 Copernica BV */ /** * Set up namespace */ namespace AMQP { /** * Class definition */ class Login { private: /** * The username * @var string */ std::string _user; /** * The password * @var string */ std::string _password; public: /** * Constructor * @param user * @param password */ Login(const std::string &user, const std::string &password) : _user(user), _password(password) {} /** * Copy constructor * @param login */ Login(const Login &login) : _user(login._user), _password(login._password) {} /** * Constructor */ Login() : _user("guest"), _password("guest") {} /** * Destructor */ virtual ~Login() {} /** * String representation in SASL PLAIN mode * @return string */ std::string saslPlain() { // we need an initial string std::string result("\0", 1); // append other elements return result.append(_user).append("\0",1).append(_password); } }; /** * End of namespace */ }
/** * The login information to access a server * * This class combines login, password and vhost * * @copyright 2014 Copernica BV */ /** * Set up namespace */ namespace AMQP { /** * Class definition */ class Login { private: /** * The username * @var string */ std::string _user; /** * The password * @var string */ std::string _password; public: /** * Constructor * @param user * @param password */ Login(const std::string &user, const std::string &password) : _user(user), _password(password) {} /** * Constructor */ Login() : _user("guest"), _password("guest") {} /** * Destructor */ virtual ~Login() {} /** * String representation in SASL PLAIN mode * @return string */ std::string saslPlain() { // we need an initial string std::string result("\0", 1); // append other elements return result.append(_user).append("\0",1).append(_password); } }; /** * End of namespace */ }
--- +++ @@ -41,6 +41,13 @@ _user(user), _password(password) {} /** + * Copy constructor + * @param login + */ + Login(const Login &login) : + _user(login._user), _password(login._password) {} + + /** * Constructor */ Login() :
Copy constructor added to Login class
apache-2.0
fantastory/AMQP-CPP,tangkingchun/AMQP-CPP,antoniomonty/AMQP-CPP,antoniomonty/AMQP-CPP,toolking/AMQP-CPP,fantastory/AMQP-CPP,tm604/AMQP-CPP,CopernicaMarketingSoftware/AMQP-CPP,CopernicaMarketingSoftware/AMQP-CPP,tangkingchun/AMQP-CPP,tm604/AMQP-CPP,toolking/AMQP-CPP,Kojoley/AMQP-CPP,Kojoley/AMQP-CPP
42f61a65bf3d78263b54e74a70d52badbab53638
#ifndef HALIDE_CPLUSPLUS_MANGLE_H #define HALIDE_CPLUSPLUS_MANGLE_H /** \file * * A simple function to get a C++ mangled function name for a function. */ #include <string> #include "IR.h" #include "Target.h" namespace Halide { namespace Internal { /** Return the mangled C++ name for a function. * The target parameter is used to decide on the C++ * ABI/mangling style to use. */ EXPORT std::string cplusplus_function_mangled_name(const std::string &name, const std::vector<std::string> &namespaces, Type return_type, const std::vector<ExternFuncArgument> &args, const Target &target); EXPORT void cplusplus_mangle_test(); } } #endif
#ifndef HALIDE_CPLUSPLUS_MANGLE_H #define HALIDE_CPLUSPLUS_MANGLE_H /** \file * * A simple function to get a C++ mangled function name for a function. */ #include <string> #include "IR.h" #include "Target.h" namespace Halide { namespace Internal { /** Return the mangled C++ name for a function. * The target parameter is used to decide on the C++ * ABI/mangling style to use. */ std::string cplusplus_function_mangled_name(const std::string &name, const std::vector<std::string> &namespaces, Type return_type, const std::vector<ExternFuncArgument> &args, const Target &target); void cplusplus_mangle_test(); } } #endif
--- +++ @@ -17,11 +17,11 @@ * The target parameter is used to decide on the C++ * ABI/mangling style to use. */ -std::string cplusplus_function_mangled_name(const std::string &name, const std::vector<std::string> &namespaces, - Type return_type, const std::vector<ExternFuncArgument> &args, - const Target &target); +EXPORT std::string cplusplus_function_mangled_name(const std::string &name, const std::vector<std::string> &namespaces, + Type return_type, const std::vector<ExternFuncArgument> &args, + const Target &target); -void cplusplus_mangle_test(); +EXPORT void cplusplus_mangle_test(); }
Add some EXPORT qualifiers for msvc
mit
kgnk/Halide,psuriana/Halide,ronen/Halide,ronen/Halide,tdenniston/Halide,tdenniston/Halide,ronen/Halide,ronen/Halide,kgnk/Halide,jiawen/Halide,jiawen/Halide,jiawen/Halide,psuriana/Halide,jiawen/Halide,ronen/Halide,jiawen/Halide,psuriana/Halide,ronen/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide,ronen/Halide,jiawen/Halide,kgnk/Halide,tdenniston/Halide,kgnk/Halide,psuriana/Halide,kgnk/Halide,tdenniston/Halide,tdenniston/Halide,ronen/Halide,tdenniston/Halide,kgnk/Halide,kgnk/Halide,tdenniston/Halide,jiawen/Halide,kgnk/Halide,tdenniston/Halide
d0593d880573052e6ae2790328a336a6a9865cc3