after
stringlengths
72
2.11k
before
stringlengths
21
1.55k
diff
stringlengths
85
2.31k
instruction
stringlengths
20
1.71k
license
stringclasses
13 values
repos
stringlengths
7
82.6k
commit
stringlengths
40
40
#include <bert/buffer.h> #include <string.h> #include <stdio.h> #include "test.h" #define DATA_SIZE 4 int main() { unsigned char data[4]; bert_buffer_t buffer; bert_buffer_init(&buffer); memset(data,'A',DATA_SIZE); unsigned int i; for (i=0;i<((BERT_CHUNK_SIZE / DATA_SIZE) * 2);i++) { bert_buffer_write(&buffer,data,DATA_SIZE); } unsigned char output[DATA_SIZE]; size_t result; if ((result = bert_buffer_read(output,&buffer,DATA_SIZE)) != DATA_SIZE) { test_fail("bert_buffer_read only read %u bytes, expected %u",result,DATA_SIZE); } if (memcmp(output,data,DATA_SIZE)) { test_fail("bert_buffer_read return %c%c%c%c, expected AAAA",output[0],output[1],output[2],output[3]); } return 0; }
#include <bert/buffer.h> #include <string.h> #include <stdio.h> #include "test.h" #define DATA_SIZE 4 int main() { unsigned char data[4]; bert_buffer_t buffer; bert_buffer_init(&buffer); memset(data,'A',DATA_SIZE); bert_buffer_write(&buffer,data,DATA_SIZE); bert_buffer_write(&buffer,data,DATA_SIZE); bert_buffer_write(&buffer,data,DATA_SIZE); unsigned char output[DATA_SIZE]; size_t result; if ((result = bert_buffer_read(output,&buffer,DATA_SIZE)) != DATA_SIZE) { test_fail("bert_buffer_read only read %u bytes, expected %u",result,DATA_SIZE); } if (memcmp(output,data,DATA_SIZE)) { test_fail("bert_buffer_read return %c%c%c%c, expected AAAA",output[0],output[1],output[2],output[3]); } return 0; }
--- +++ @@ -16,9 +16,12 @@ memset(data,'A',DATA_SIZE); - bert_buffer_write(&buffer,data,DATA_SIZE); - bert_buffer_write(&buffer,data,DATA_SIZE); - bert_buffer_write(&buffer,data,DATA_SIZE); + unsigned int i; + + for (i=0;i<((BERT_CHUNK_SIZE / DATA_SIZE) * 2);i++) + { + bert_buffer_write(&buffer,data,DATA_SIZE); + } unsigned char output[DATA_SIZE]; size_t result;
Make sure the buffer small read populates the buffer with multiple chunks.
mit
postmodern/libBERT
2e7fdd6a1db4a649f7e3e469729946d3978f83a1
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "config.h" #include <stddef.h> #include <sys/types.h> #include <sys/time.h> #include <sched.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif #if defined (__i386__) || defined (__x86_64__) #include <xmmintrin.h> #endif #include "runtime.h" /* Spin wait. */ void runtime_procyield (uint32 cnt) { volatile uint32 i; for (i = 0; i < cnt; ++i) { #if defined (__i386__) || defined (__x86_64__) _mm_pause (); #endif } } /* Ask the OS to reschedule this thread. */ void runtime_osyield (void) { sched_yield (); } /* Sleep for some number of microseconds. */ void runtime_usleep (uint32 us) { struct timeval tv; tv.tv_sec = us / 1000000; tv.tv_usec = us % 1000000; select (0, NULL, NULL, NULL, &tv); }
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "config.h" #include <stddef.h> #include <sys/types.h> #include <sys/time.h> #include <sched.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif #include "runtime.h" /* Spin wait. */ void runtime_procyield (uint32 cnt) { volatile uint32 i; for (i = 0; i < cnt; ++i) { #if defined (__i386__) || defined (__x86_64__) __builtin_ia32_pause (); #endif } } /* Ask the OS to reschedule this thread. */ void runtime_osyield (void) { sched_yield (); } /* Sleep for some number of microseconds. */ void runtime_usleep (uint32 us) { struct timeval tv; tv.tv_sec = us / 1000000; tv.tv_usec = us % 1000000; select (0, NULL, NULL, NULL, &tv); }
--- +++ @@ -14,6 +14,10 @@ #include <sys/select.h> #endif +#if defined (__i386__) || defined (__x86_64__) +#include <xmmintrin.h> +#endif + #include "runtime.h" /* Spin wait. */ @@ -26,7 +30,7 @@ for (i = 0; i < cnt; ++i) { #if defined (__i386__) || defined (__x86_64__) - __builtin_ia32_pause (); + _mm_pause (); #endif } }
runtime: Use _mm_pause rather than __builtin_ia32_pause. Based on a patch from Peter Collingbourne. R=iant CC=gofrontend-dev https://golang.org/cl/102920043
bsd-3-clause
anlhord/gofrontend,golang/gofrontend,golang/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,golang/gofrontend,golang/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend
936e55e8fad9394aeee8e4ca4e50c1247ca4d390
#pragma once #include <Windows.h> #include <functional> #include <string> class Control { public: Control(); Control(int id, HWND parent); ~Control(); virtual RECT Dimensions(); virtual void Enable(); virtual void Disable(); virtual bool Enabled(); virtual void Enabled(bool enabled); virtual std::wstring Text(); virtual int TextAsInt(); virtual bool Text(std::wstring text); virtual bool Text(int value); void WindowExStyle(); void WindowExStyle(long exStyle); void AddWindowExStyle(long exStyle); void RemoveWindowExStyle(long exStyle); /// <summary>Handles WM_COMMAND messages.</summary> /// <param name="nCode">Control-defined notification code</param> virtual DLGPROC Command(unsigned short nCode); /// <summary>Handles WM_NOTIFY messages.</summary> /// <param name="nHdr">Notification header structure</param> virtual DLGPROC Notification(NMHDR *nHdr); protected: int _id; HWND _hWnd; HWND _parent; protected: static const int MAX_EDITSTR = 0x4000; };
#pragma once #include <Windows.h> #include <functional> #include <string> class Control { public: Control(); Control(int id, HWND parent); ~Control(); RECT Dimensions(); void Enable(); void Disable(); bool Enabled(); void Enabled(bool enabled); std::wstring Text(); int TextAsInt(); bool Text(std::wstring text); bool Text(int value); void WindowExStyle(); void WindowExStyle(long exStyle); void AddWindowExStyle(long exStyle); void RemoveWindowExStyle(long exStyle); /// <summary>Handles WM_COMMAND messages.</summary> /// <param name="nCode">Control-defined notification code</param> virtual DLGPROC Command(unsigned short nCode); /// <summary>Handles WM_NOTIFY messages.</summary> /// <param name="nHdr">Notification header structure</param> virtual DLGPROC Notification(NMHDR *nHdr); protected: int _id; HWND _hWnd; HWND _parent; protected: static const int MAX_EDITSTR = 0x4000; };
--- +++ @@ -10,17 +10,17 @@ Control(int id, HWND parent); ~Control(); - RECT Dimensions(); + virtual RECT Dimensions(); - void Enable(); - void Disable(); - bool Enabled(); - void Enabled(bool enabled); + virtual void Enable(); + virtual void Disable(); + virtual bool Enabled(); + virtual void Enabled(bool enabled); - std::wstring Text(); - int TextAsInt(); - bool Text(std::wstring text); - bool Text(int value); + virtual std::wstring Text(); + virtual int TextAsInt(); + virtual bool Text(std::wstring text); + virtual bool Text(int value); void WindowExStyle(); void WindowExStyle(long exStyle);
Allow some control methods to be overridden
bsd-2-clause
malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,Soulflare3/3RVX,malensek/3RVX
735b05cf0afe8aff15925202b65834d9d81e6498
/* * Copyright 2011-2016 Blender Foundation * * 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 __UTIL_VERSION_H__ #define __UTIL_VERSION_H__ /* Cycles version number */ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 #define CYCLES_VERSION_MINOR 12 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c #define CYCLES_MAKE_VERSION_STRING(a, b, c) CYCLES_MAKE_VERSION_STRING2(a, b, c) #define CYCLES_VERSION_STRING \ CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, CYCLES_VERSION_MINOR, CYCLES_VERSION_PATCH) CCL_NAMESPACE_END #endif /* __UTIL_VERSION_H__ */
/* * Copyright 2011-2016 Blender Foundation * * 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 __UTIL_VERSION_H__ #define __UTIL_VERSION_H__ /* Cycles version number */ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 #define CYCLES_VERSION_MINOR 11 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c #define CYCLES_MAKE_VERSION_STRING(a, b, c) CYCLES_MAKE_VERSION_STRING2(a, b, c) #define CYCLES_VERSION_STRING \ CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, CYCLES_VERSION_MINOR, CYCLES_VERSION_PATCH) CCL_NAMESPACE_END #endif /* __UTIL_VERSION_H__ */
--- +++ @@ -22,7 +22,7 @@ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 -#define CYCLES_VERSION_MINOR 11 +#define CYCLES_VERSION_MINOR 12 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c
Bump version to 1.12, matching blender 2.83 release cycle
apache-2.0
tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird
fd767a1b53b8f2ef3ca484c8bbbcb29ffcc8c3b9
#ifndef IPSS_BENCH_H #define IPSS_BENCH_H #ifdef __cplusplus extern "C" { #endif void start_ipss_measurement(); void stop_ipss_measurement(); #ifdef __cplusplus } #endif #endif
#ifndef IPSS_BENCH_H #define IPSS_BENCH_H extern void start_ipss_measurement(); extern void stop_ipss_measurement(); #endif
--- +++ @@ -1,7 +1,16 @@ #ifndef IPSS_BENCH_H #define IPSS_BENCH_H -extern void start_ipss_measurement(); -extern void stop_ipss_measurement(); +#ifdef __cplusplus +extern "C" +{ +#endif + +void start_ipss_measurement(); +void stop_ipss_measurement(); + +#ifdef __cplusplus +} +#endif #endif
CMSIS-DSP: Update header for use from C++
apache-2.0
JonatanAntoni/CMSIS_5,JonatanAntoni/CMSIS_5,ARM-software/CMSIS_5,JonatanAntoni/CMSIS_5,JonatanAntoni/CMSIS_5,JonatanAntoni/CMSIS_5,ARM-software/CMSIS_5,ARM-software/CMSIS_5,ARM-software/CMSIS_5,JonatanAntoni/CMSIS_5,ARM-software/CMSIS_5,ARM-software/CMSIS_5
236a881c46f7930f74ed656d85c18a93e2fb9e25
/* $Id: Output_def.h,v 1.17 2008-07-31 18:08:50 phruksar Exp $ */ #ifndef _OUTPUT_DEF_H #define _OUTPUT_DEF_H #define OUTFMT_HEAD 0 #define OUTFMT_UNITS 1 #define OUTFMT_COMP 2 #define OUTFMT_NUM 4 #define OUTFMT_ACT 8 #define OUTFMT_HEAT 16 #define OUTFMT_ALPHA 32 #define OUTFMT_BETA 64 #define OUTFMT_GAMMA 128 #define OUTFMT_SRC 256 #define OUTFMT_CDOSE 512 #define OUTFMT_ADJ 1024 #define OUTFMT_EXP 2048 #define OUTFMT_EXP_CYL_VOL 4096 #define OUTFMT_WDR 8192 #define OUTNORM_KG -2 #define OUTNORM_G -1 #define OUTNORM_NULL 0 #define OUTNORM_CM3 1 #define OUTNORM_M3 2 #define OUTNORM_VOL_INT 100 #define BQ_CI 2.7027e-11 #define CM3_M3 1e-6 #define G_KG 1e-3 #endif
/* $Id: Output_def.h,v 1.16 2007-10-18 20:30:58 phruksar Exp $ */ #ifndef _OUTPUT_DEF_H #define _OUTPUT_DEF_H #define OUTFMT_HEAD 0 #define OUTFMT_UNITS 1 #define OUTFMT_COMP 2 #define OUTFMT_NUM 4 #define OUTFMT_ACT 8 #define OUTFMT_HEAT 16 #define OUTFMT_ALPHA 32 #define OUTFMT_BETA 64 #define OUTFMT_GAMMA 128 #define OUTFMT_SRC 256 #define OUTFMT_CDOSE 512 #define OUTFMT_ADJ 1024 #define OUTFMT_EXP 2048 #define OUTFMT_WDR 4096 #define OUTNORM_KG -2 #define OUTNORM_G -1 #define OUTNORM_NULL 0 #define OUTNORM_CM3 1 #define OUTNORM_M3 2 #define OUTNORM_VOL_INT 100 #define BQ_CI 2.7027e-11 #define CM3_M3 1e-6 #define G_KG 1e-3 #endif
--- +++ @@ -1,4 +1,4 @@ -/* $Id: Output_def.h,v 1.16 2007-10-18 20:30:58 phruksar Exp $ */ +/* $Id: Output_def.h,v 1.17 2008-07-31 18:08:50 phruksar Exp $ */ #ifndef _OUTPUT_DEF_H #define _OUTPUT_DEF_H @@ -15,7 +15,8 @@ #define OUTFMT_CDOSE 512 #define OUTFMT_ADJ 1024 #define OUTFMT_EXP 2048 -#define OUTFMT_WDR 4096 +#define OUTFMT_EXP_CYL_VOL 4096 +#define OUTFMT_WDR 8192 #define OUTNORM_KG -2 #define OUTNORM_G -1
Define new number for new exposure rate calc
bsd-3-clause
elliottbiondo/ALARA,elliottbiondo/ALARA,elliottbiondo/ALARA,elliottbiondo/ALARA,elliottbiondo/ALARA
1c719512a25876346c28ebaf0ecdad007fce0a99
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_AURA_AURA_SWITCHES_H_ #define UI_AURA_AURA_SWITCHES_H_ #pragma once #include "ui/aura/aura_export.h" namespace switches { AURA_EXPORT extern const char kAuraHostWindowSize[]; AURA_EXPORT extern const char kAuraWindows[]; } // namespace switches #endif // UI_AURA_AURA_SWITCHES_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_AURA_AURA_SWITCHES_H_ #define UI_AURA_AURA_SWITCHES_H_ #pragma once namespace switches { extern const char kAuraHostWindowSize[]; extern const char kAuraWindows[]; } // namespace switches #endif // UI_AURA_AURA_SWITCHES_H_
--- +++ @@ -6,10 +6,12 @@ #define UI_AURA_AURA_SWITCHES_H_ #pragma once +#include "ui/aura/aura_export.h" + namespace switches { -extern const char kAuraHostWindowSize[]; -extern const char kAuraWindows[]; +AURA_EXPORT extern const char kAuraHostWindowSize[]; +AURA_EXPORT extern const char kAuraWindows[]; } // namespace switches
Fix shared library build for aura. [email protected],[email protected] [email protected],[email protected] BUG=none TEST=none Review URL: http://codereview.chromium.org/8438039 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@108299 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
yitian134/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,adobe/chromium
962d09e8e4566fe6780f106e98d8b131542defb5
// // STTweetLabel.h // STTweetLabel // // Created by Sebastien Thiebaud on 09/29/13. // Copyright (c) 2013 Sebastien Thiebaud. All rights reserved. // typedef NS_ENUM(NSInteger, STTweetHotWord) { STTweetHandle = 0, STTweetHashtag, STTweetLink }; @interface STTweetLabel : UILabel @property (nonatomic, strong) NSArray *validProtocols; @property (nonatomic, assign) BOOL leftToRight; @property (nonatomic, assign) BOOL textSelectable; @property (nonatomic, strong) UIColor *selectionColor; @property (nonatomic, copy) void (^detectionBlock)(STTweetHotWord hotWord, NSString *string, NSString *protocol, NSRange range); - (void)setAttributes:(NSDictionary *)attributes; - (void)setAttributes:(NSDictionary *)attributes hotWord:(STTweetHotWord)hotWord; - (NSDictionary *)attributes; - (NSDictionary *)attributesForHotWord:(STTweetHotWord)hotWord; - (CGSize)suggestedFrameSizeToFitEntireStringConstraintedToWidth:(CGFloat)width; @end
// // STTweetLabel.h // STTweetLabel // // Created by Sebastien Thiebaud on 09/29/13. // Copyright (c) 2013 Sebastien Thiebaud. All rights reserved. // typedef enum { STTweetHandle = 0, STTweetHashtag, STTweetLink } STTweetHotWord; @interface STTweetLabel : UILabel @property (nonatomic, strong) NSArray *validProtocols; @property (nonatomic, assign) BOOL leftToRight; @property (nonatomic, assign) BOOL textSelectable; @property (nonatomic, strong) UIColor *selectionColor; @property (nonatomic, copy) void (^detectionBlock)(STTweetHotWord hotWord, NSString *string, NSString *protocol, NSRange range); - (void)setAttributes:(NSDictionary *)attributes; - (void)setAttributes:(NSDictionary *)attributes hotWord:(STTweetHotWord)hotWord; - (NSDictionary *)attributes; - (NSDictionary *)attributesForHotWord:(STTweetHotWord)hotWord; - (CGSize)suggestedFrameSizeToFitEntireStringConstraintedToWidth:(CGFloat)width; @end
--- +++ @@ -6,11 +6,11 @@ // Copyright (c) 2013 Sebastien Thiebaud. All rights reserved. // -typedef enum { +typedef NS_ENUM(NSInteger, STTweetHotWord) { STTweetHandle = 0, STTweetHashtag, STTweetLink -} STTweetHotWord; +}; @interface STTweetLabel : UILabel
Make enum available to swift
mit
bespider/STTweetLabel,pankkor/STTweetLabel,pabelnl/STTweetLabel,HackRoy/STTweetLabel,SebastienThiebaud/STTweetLabel,quanquan1986/STTweetLabel
2a655bcf9e5c30077197d314690ffbf86a042712
#ifndef MUDUO_BASE_ATOMIC_H #define MUDUO_BASE_ATOMIC_H #include <boost/noncopyable.hpp> namespace muduo { class AtomicInt64 : boost::noncopyable { public: AtomicInt64() : value_(0) { } int64_t get() { return value_; } int64_t addAndGet(int64_t x) { return __sync_add_and_fetch(&value_, x); } int64_t incrementAndGet() { return addAndGet(1); } int64_t getAndSet(int64_t newValue) { return __sync_lock_test_and_set(&value_, newValue); } private: volatile int64_t value_; }; } #endif // MUDUO_BASE_ATOMIC_H
#ifndef MUDUO_BASE_ATOMIC_H #define MUDUO_BASE_ATOMIC_H #include <boost/noncopyable.hpp> namespace muduo { class AtomicInt64 : boost::noncopyable { public: AtomicInt64() : value_(0) { } int64_t get() { return value_; } int64_t addAndGet(int64_t x) { value_ += x; return value_; } int64_t incrementAndGet() { return addAndGet(1); } int64_t getAndSet(int64_t newValue) { int64_t old = value_; value_ = newValue; return old; } private: int64_t value_; }; } #endif // MUDUO_BASE_ATOMIC_H
--- +++ @@ -21,8 +21,7 @@ int64_t addAndGet(int64_t x) { - value_ += x; - return value_; + return __sync_add_and_fetch(&value_, x); } int64_t incrementAndGet() @@ -32,13 +31,11 @@ int64_t getAndSet(int64_t newValue) { - int64_t old = value_; - value_ = newValue; - return old; + return __sync_lock_test_and_set(&value_, newValue); } private: - int64_t value_; + volatile int64_t value_; }; }
Implement atomic integer with gcc builtins.
bsd-3-clause
wangweihao/muduo,Cofyc/muduo,jxd134/muduo,shenhzou654321/muduo,floristt/muduo,floristt/muduo,SuperMXC/muduo,Cofyc/muduo,lvshiling/muduo,fc500110/muduo,danny200309/muduo,jerk1991/muduo,lizj3624/http-github.com-chenshuo-muduo-,jxd134/muduo,SourceInsight/muduo,zhuangshi23/muduo,SourceInsight/muduo,devsoulwolf/muduo,shenhzou654321/muduo,KunYi/muduo,devsoulwolf/muduo,lizj3624/muduo,KublaikhanGeek/muduo,DongweiLee/muduo,KingLebron/muduo,KublaikhanGeek/muduo,KingLebron/muduo,danny200309/muduo,yunhappy/muduo,shuang-shuang/muduo,DongweiLee/muduo,mitliucak/muduo,tsh185/muduo,danny200309/muduo,guker/muduo,huan80s/muduo,dhanzhang/muduo,lizj3624/muduo,yunhappy/muduo,floristt/muduo,SourceInsight/muduo,lvmaoxv/muduo,KingLebron/muduo,tsh185/muduo,wangweihao/muduo,lizj3624/http-github.com-chenshuo-muduo-,zhanMingming/muduo,lizj3624/muduo,Cofyc/muduo,ucfree/muduo,decimalbell/muduo,ywy2090/muduo,KingLebron/muduo,xzmagic/muduo,lizj3624/http-github.com-chenshuo-muduo-,wangweihao/muduo,dhanzhang/muduo,dhanzhang/muduo,SuperMXC/muduo,guker/muduo,SourceInsight/muduo,ucfree/muduo,decimalbell/muduo,shenhzou654321/muduo,fc500110/muduo,devsoulwolf/muduo,floristt/muduo,zhuangshi23/muduo,lizj3624/muduo,zxylvlp/muduo,huan80s/muduo,jerk1991/muduo,wangweihao/muduo,mitliucak/muduo,lizj3624/http-github.com-chenshuo-muduo-,lizhanhui/muduo,flyfeifan/muduo,mitliucak/muduo,Cofyc/muduo,Cofyc/muduo,westfly/muduo,xzmagic/muduo,mitliucak/muduo,mitliucak/muduo,decimalbell/muduo,decimalbell/muduo,daodaoliang/muduo,westfly/muduo,penyatree/muduo,devsoulwolf/muduo,danny200309/muduo,penyatree/muduo,wangweihao/muduo,pthreadself/muduo,SuperMXC/muduo,kidzyoung/muduo,pthreadself/muduo,lizj3624/http-github.com-chenshuo-muduo-,lizj3624/muduo,huan80s/muduo,ucfree/muduo,youprofit/muduo,zouzl/muduo-learning,ucfree/muduo,zhanMingming/muduo,daodaoliang/muduo,floristt/muduo,shenhzou654321/muduo,dhanzhang/muduo,KunYi/muduo,june505/muduo,lizhanhui/muduo,decimalbell/muduo,shuang-shuang/muduo,zxylvlp/muduo,dhanzhang/muduo,ywy2090/muduo,youprofit/muduo,june505/muduo,SuperMXC/muduo,zouzl/muduo-learning,danny200309/muduo,devsoulwolf/muduo,flyfeifan/muduo,zhuangshi23/muduo,lvmaoxv/muduo,ucfree/muduo,nestle1998/muduo,zxylvlp/muduo,SuperMXC/muduo,shenhzou654321/muduo,huan80s/muduo,KingLebron/muduo,kidzyoung/muduo,lvshiling/muduo,huan80s/muduo,zouzl/muduo-learning,SourceInsight/muduo,nestle1998/muduo,westfly/muduo
1d6e54c49babe1975a1b6285e8b7f039c04b3ab3
// RUN: rm -f %t // RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s // RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s int foo() { // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 } // CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 // CHECK-NEXT: +-serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] [] // CHECK-NEXT: Number FIXITs = 0 void bar() {} typedef int bar; // CHECK-LABEL: Number of diagnostics: 2
// RUN: rm -f %t // RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s // RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s int foo() { // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 } // CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 // CHECK-NEXT: +-/Volumes/Lore/llvm-public/clang/test/Misc/serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] [] // CHECK-NEXT: Number FIXITs = 0 void bar() {} typedef int bar; // CHECK-LABEL: Number of diagnostics: 2
--- +++ @@ -11,7 +11,7 @@ // CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 -// CHECK-NEXT: +-/Volumes/Lore/llvm-public/clang/test/Misc/serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] [] +// CHECK-NEXT: +-serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] [] // CHECK-NEXT: Number FIXITs = 0 void bar() {} typedef int bar;
Remove absolute path from r202733. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@202746 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
7124f160555bee9fb154b73893de6e853fe31441
#define _GNU_SOURCE #include <stdio.h> #include <sched.h> #include <errno.h> #include <stdint.h> #include <sys/resource.h> #include "cpu.h" #include "../util/taskstats.h" #include "../util/file_utils.h" int current_cpus(int pid) { cpu_set_t proc_cpus; size_t mask_size = sizeof proc_cpus; int ret = sched_getaffinity(pid, mask_size, &proc_cpus); if (ret == -1) return errno; int cpu_affinity = CPU_COUNT(&proc_cpus); return cpu_affinity; } int nice(int pid) { return getpriority(PRIO_PROCESS, pid); } uint64_t get_process_ctxt_switches(int pid) { return task_req(pid, 's'); } char *get_user_ps_ctxt_switches(char *pid) { char path[MAXPATH]; snprintf(path, MAXPATH, STATUS, pid); return parse_proc(path, SWITCHES); }
#define _GNU_SOURCE #include <stdio.h> #include <sched.h> #include <errno.h> #include <stdint.h> #include <sys/resource.h> #include "cpu.h" #include "../util/taskstats.h" #include "../util/file_utils.h" int current_cpus(int pid) { cpu_set_t proc_cpus; size_t mask_size = sizeof proc_cpus; int ret = sched_getaffinity(pid, mask_size, &proc_cpus); if (ret == -1) return errno; int cpu_affinity = CPU_COUNT(&proc_cpus); return cpu_affinity; } int nice(int pid) { return getpriority(PRIO_PROCESS, pid); } uint64_t get_process_ctxt_switches(int pid) { return task_req(pid, 's'); }
--- +++ @@ -35,3 +35,11 @@ { return task_req(pid, 's'); } + +char *get_user_ps_ctxt_switches(char *pid) +{ + char path[MAXPATH]; + snprintf(path, MAXPATH, STATUS, pid); + + return parse_proc(path, SWITCHES); +}
Use parse_proc for context switches if lower perms
mit
tijko/dashboard
e2aa329f967e3ceb9e789dbc8cf636d5fb373a3b
#ifndef TAGREADER_H #define TAGREADER_H #include "taglib/fileref.h" #include "taglib/tag.h" #include "taglib/mpeg/mpegfile.h" #include "taglib/mpeg/id3v2/id3v2tag.h" #include "taglib/mpeg/id3v2/frames/attachedpictureframe.h" #include <QString> #include <QImage> class TagReader { public: TagReader(const QString &file); ~TagReader(); bool isValid() const; bool hasAudioProperties() const; QString title() const; QString album() const; QString artist() const; int track() const; int year() const; QString genre() const; QString comment() const; int length() const; int bitrate() const; int sampleRate() const; int channels() const; QImage thumbnailImage() const; QByteArray thumbnail() const; private: TagLib::FileRef m_fileRef; TagLib::Tag *m_tag; TagLib::AudioProperties *m_audioProperties; }; #endif // TAGREADER_H
#ifndef TAGREADER_H #define TAGREADER_H #include <taglib/fileref.h> #include <taglib/tag.h> #include <taglib/mpegfile.h> #include <taglib/id3v2tag.h> #include <taglib/attachedpictureframe.h> #include <QString> #include <QImage> class TagReader { public: TagReader(const QString &file); ~TagReader(); bool isValid() const; bool hasAudioProperties() const; QString title() const; QString album() const; QString artist() const; int track() const; int year() const; QString genre() const; QString comment() const; int length() const; int bitrate() const; int sampleRate() const; int channels() const; QImage thumbnailImage() const; QByteArray thumbnail() const; private: TagLib::FileRef m_fileRef; TagLib::Tag *m_tag; TagLib::AudioProperties *m_audioProperties; }; #endif // TAGREADER_H
--- +++ @@ -1,11 +1,11 @@ #ifndef TAGREADER_H #define TAGREADER_H -#include <taglib/fileref.h> -#include <taglib/tag.h> -#include <taglib/mpegfile.h> -#include <taglib/id3v2tag.h> -#include <taglib/attachedpictureframe.h> +#include "taglib/fileref.h" +#include "taglib/tag.h" +#include "taglib/mpeg/mpegfile.h" +#include "taglib/mpeg/id3v2/id3v2tag.h" +#include "taglib/mpeg/id3v2/frames/attachedpictureframe.h" #include <QString> #include <QImage>
Use our package taglib headers and not the hosts!
bsd-3-clause
qtmediahub/sasquatch,qtmediahub/sasquatch,qtmediahub/sasquatch
ad42bb9a0b167e38bd2fef333c1d725bc41f0dc0
#include "gradient_decent.h" void decend_cpu(int len, double rate, double momentum, double regulariser, const double* weights, const double* gradient, const double* last, double* outputWeights, double* outputMomentum) { for (int i = 0; i < len; i++) { outputMomentum[i] = momentum * last[i] - rate * gradient[i]; outputWeights[i] = weights[i] + outputMomentum[i] - (rate * regulariser) * weights[i]; } }
#include "gradient_decent.h" void decend_cpu(int len, double rate, double momentum, double regulariser, const double* weights, const double* gradient, const double* last, double* outputWeights, double* outputMomentum) { for (int i = 0; i <= len; i++) { outputMomentum[i] = momentum * last[i] - rate * gradient[i]; outputWeights[i] = weights[i] + outputMomentum[i] - (rate * regulariser) * weights[i]; } }
--- +++ @@ -6,7 +6,7 @@ const double* last, double* outputWeights, double* outputMomentum) { - for (int i = 0; i <= len; i++) { + for (int i = 0; i < len; i++) { outputMomentum[i] = momentum * last[i] - rate * gradient[i]; outputWeights[i] = weights[i] + outputMomentum[i] - (rate * regulariser) * weights[i]; }
Fix off-by-one error in C code
bsd-2-clause
HuwCampbell/grenade,HuwCampbell/grenade
2c68ddc27ccc965b15ebc50159cae4d76ed5af2b
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #pragma once #include "content/browser/renderer_host/render_view_host_observer.h" class GURL; struct DesktopNotificationHostMsg_Show_Params; // Per-tab Desktop notification handler. Handles desktop notification IPCs // coming in from the renderer. class DesktopNotificationHandler : public RenderViewHostObserver { public: explicit DesktopNotificationHandler(RenderViewHost* render_view_host); virtual ~DesktopNotificationHandler(); private: // RenderViewHostObserver implementation. bool OnMessageReceived(const IPC::Message& message); // IPC handlers. void OnShow(const DesktopNotificationHostMsg_Show_Params& params); void OnCancel(int notification_id); void OnRequestPermission(const GURL& origin, int callback_id); private: DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler); }; #endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #pragma once #include "content/browser/renderer_host/render_view_host_observer.h" class GURL; struct DesktopNotificationHostMsg_Show_Params; // Per-tab Desktop notification handler. Handles desktop notification IPCs // coming in from the renderer. class DesktopNotificationHandler : public RenderViewHostObserver { public: explicit DesktopNotificationHandler(RenderViewHost* render_view_host); virtual ~DesktopNotificationHandler(); private: // RenderViewHostObserver implementation. virtual bool OnMessageReceived(const IPC::Message& message); // IPC handlers. void OnShow(const DesktopNotificationHostMsg_Show_Params& params); void OnCancel(int notification_id); void OnRequestPermission(const GURL& origin, int callback_id); private: DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler); }; #endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
--- +++ @@ -20,7 +20,7 @@ private: // RenderViewHostObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message); + bool OnMessageReceived(const IPC::Message& message); // IPC handlers. void OnShow(const DesktopNotificationHostMsg_Show_Params& params);
Revert 80939 - Fix clang error [email protected] git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@80954 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
dushu1203/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,hujiajie/pa-chromium,patrickm/chromium.src,mogoweb/chromium-crosswalk,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,rogerwang/chromium,Just-D/chromium-1,dednal/chromium.src,zcbenz/cefode-chromium,robclark/chromium,anirudhSK/chromium,ondra-novak/chromium.src,Just-D/chromium-1,anirudhSK/chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,hujiajie/pa-chromium,robclark/chromium,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,robclark/chromium,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,rogerwang/chromium,ltilve/chromium,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,rogerwang/chromium,ondra-novak/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,keishi/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,keishi/chromium,Fireblend/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,keishi/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,Chilledheart/chromium,zcbenz/cefode-chromium,Jonekee/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,ondra-novak/chromium.src,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,M4sse/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,nacl-webkit/chrome_deps,jaruba/chromium.src,patrickm/chromium.src,ltilve/chromium,M4sse/chromium.src,axinging/chromium-crosswalk,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,keishi/chromium,M4sse/chromium.src,keishi/chromium,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,rogerwang/chromium,dednal/chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,jaruba/chromium.src,robclark/chromium,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,M4sse/chromium.src,dednal/chromium.src,rogerwang/chromium,ChromiumWebApps/chromium,littlstar/chromium.src,robclark/chromium,dushu1203/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,patrickm/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,robclark/chromium,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,robclark/chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,robclark/chromium,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,littlstar/chromium.src,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,keishi/chromium,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,littlstar/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,rogerwang/chromium,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,ltilve/chromium,zcbenz/cefode-chromium,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,robclark/chromium,zcbenz/cefode-chromium,ltilve/chromium,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,robclark/chromium,axinging/chromium-crosswalk,ondra-novak/chromium.src,dednal/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,rogerwang/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,zcbenz/cefode-chromium,Jonekee/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,keishi/chromium,rogerwang/chromium,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,dushu1203/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,M4sse/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,keishi/chromium,bright-sparks/chromium-spacewalk,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,keishi/chromium,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,M4sse/chromium.src,ltilve/chromium,ondra-novak/chromium.src,patrickm/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,dednal/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,Jonekee/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,keishi/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,M4sse/chromium.src,markYoungH/chromium.src
73689e53255c6ac22a90b0cd01fe40180ec2bbba
#ifndef THERMALCONFIG_H #define THERMALCONFIG_H #ifndef M_PI const double M_PI = 3.141592653; #endif const double T0 = 273.15; // [C] const double R_TSV = 5e-6; // [m] /* Thermal conductance */ const double Ksi = 148.0; // Silicon const double Kcu = 401.0; // Copper const double Kin = 1.5; // insulator const double Khs = 4.0; // Heat sink /* Thermal capacitance */ const double Csi = 1.66e6; // Silicon const double Ccu = 3.2e6; // Copper const double Cin = 1.65e6; // insulator const double Chs = 2.42e6; // Heat sink /* Layer Hight */ const double Hsi = 400e-6; // Silicon const double Hcu = 5e-6; // Copper const double Hin = 20e-6; // Insulator const double Hhs = 1000e-6; // Heat sink #endif
#ifndef THERMALCONFIG_H #define THERMALCONFIG_H #ifndef M_PI const double M_PI = 3.141592653; #endif const double T0 = 273.15; // [C] const double R_TSV = 5e-6; // [m] /* Thermal conductance */ const double Ksi = 148.0; // Silicon const double Kcu = 401.0; // Copper const double Kin = 1.5; // insulator const double Khs = 2.0; // Heat sink /* Thermal capacitance */ const double Csi = 1.66e6; // Silicon const double Ccu = 3.2e6; // Copper const double Cin = 1.65e6; // insulator const double Chs = 2.42e6; // Heat sink /* Layer Hight */ const double Hsi = 400e-6; // Silicon const double Hcu = 5e-6; // Copper const double Hin = 20e-6; // Insulator const double Hhs = 1000e-6; // Heat sink #endif
--- +++ @@ -13,7 +13,7 @@ const double Ksi = 148.0; // Silicon const double Kcu = 401.0; // Copper const double Kin = 1.5; // insulator -const double Khs = 2.0; // Heat sink +const double Khs = 4.0; // Heat sink /* Thermal capacitance */ const double Csi = 1.66e6; // Silicon
Change default khs to 4
mit
umd-memsys/DRAMsim3,umd-memsys/DRAMsim3,umd-memsys/DRAMsim3
05a3ffb6b93cf390f5401511184303a419de3cbf
#pragma once #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <malloc.h> #include <memory.h> #include <prsht.h> #include <stdlib.h> #include <tchar.h> #include <vector> #include "../3RVX/3RVX.h" #include "resource.h" class About; class Display; class General; class Hotkeys; class OSD; class TabPage; class SettingsUI : public Window { public: SettingsUI(HINSTANCE hInstance); INT_PTR LaunchPropertySheet(); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); private: std::vector<TabPage *> _tabs; General *_general; Display *_display; OSD *_osd; Hotkeys *_hotkeys; About *_about; private: /* Startup x/y location offsets */ static const int XOFFSET = 70; static const int YOFFSET = 20; }; /* Forward Declarations */ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam);
#pragma once #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <malloc.h> #include <memory.h> #include <prsht.h> #include <stdlib.h> #include <tchar.h> #include "../3RVX/3RVX.h" #include "resource.h" class SettingsUI : public Window { public: SettingsUI(HINSTANCE hInstance); INT_PTR LaunchPropertySheet(); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); private: }; /* Forward Declarations */ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam); BOOL CALLBACK GeneralTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK DisplayTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK OSDTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK HotkeyTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK AboutTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
--- +++ @@ -8,10 +8,17 @@ #include <prsht.h> #include <stdlib.h> #include <tchar.h> +#include <vector> #include "../3RVX/3RVX.h" #include "resource.h" +class About; +class Display; +class General; +class Hotkeys; +class OSD; +class TabPage; class SettingsUI : public Window { public: @@ -22,17 +29,21 @@ virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +private: + std::vector<TabPage *> _tabs; + General *_general; + Display *_display; + OSD *_osd; + Hotkeys *_hotkeys; + About *_about; private: + /* Startup x/y location offsets */ + static const int XOFFSET = 70; + static const int YOFFSET = 20; }; /* Forward Declarations */ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam); - -BOOL CALLBACK GeneralTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK DisplayTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK OSDTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK HotkeyTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK AboutTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
Add instance variables, remove callbacks
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
e581eb9f332bde7e69cf4fa10a379d860e5d133a
/*- * Copyright (c) 1998 Sendmail, Inc. All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * * * @(#)pathnames.h 8.5 (Berkeley) 5/19/1998 * $FreeBSD$ */ #include <paths.h> #define _PATH_LOCTMP "/var/tmp/local.XXXXXX"
/*- * Copyright (c) 1998 Sendmail, Inc. All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * * * @(#)pathnames.h 8.5 (Berkeley) 5/19/1998 */ #include <paths.h> #define _PATH_LOCTMP "/tmp/local.XXXXXX"
--- +++ @@ -9,7 +9,8 @@ * * * @(#)pathnames.h 8.5 (Berkeley) 5/19/1998 + * $FreeBSD$ */ #include <paths.h> -#define _PATH_LOCTMP "/tmp/local.XXXXXX" +#define _PATH_LOCTMP "/var/tmp/local.XXXXXX"
Change location of temporary file from /tmp to /var/tmp. This is a repeat of an earlier commit which apparently got lost with the last import. It helps solve the frequently reported problem pid 4032 (mail.local), uid 0 on /: file system full (though there appears to be a lot of space) caused by idiots sending 30 MB mail messages. Most-recently-reported-by: jahanur <[email protected]> Add $FreeBSD$ so that I can check the file back in. Rejected-by: CVS
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
07d0cafdf2018e8789e4e0671eb0ccc8bbc5c186
/* * Copyright (c) 2017, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef QUECTEL_BC95_CELLULAR_POWER_H_ #define QUECTEL_BC95_CELLULAR_POWER_H_ #include "AT_CellularPower.h" namespace mbed { class QUECTEL_BC95_CellularPower : public AT_CellularPower { public: QUECTEL_BC95_CellularPower(ATHandler &atHandler); virtual ~QUECTEL_BC95_CellularPower(); public: //from CellularPower virtual nsapi_error_t set_at_mode(); virtual nsapi_error_t reset(); }; } // namespace mbed #endif // QUECTEL_BC95_CELLULAR_POWER_H_
/* * Copyright (c) 2017, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TELIT_HE910_CELLULAR_POWER_H_ #define TELIT_HE910_CELLULAR_POWER_H_ #include "AT_CellularPower.h" namespace mbed { class QUECTEL_BC95_CellularPower : public AT_CellularPower { public: QUECTEL_BC95_CellularPower(ATHandler &atHandler); virtual ~QUECTEL_BC95_CellularPower(); public: //from CellularPower virtual nsapi_error_t set_at_mode(); virtual nsapi_error_t reset(); }; } // namespace mbed #endif // TELIT_HE910_CELLULAR_POWER_H_
--- +++ @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef TELIT_HE910_CELLULAR_POWER_H_ -#define TELIT_HE910_CELLULAR_POWER_H_ +#ifndef QUECTEL_BC95_CELLULAR_POWER_H_ +#define QUECTEL_BC95_CELLULAR_POWER_H_ #include "AT_CellularPower.h" @@ -36,4 +36,4 @@ } // namespace mbed -#endif // TELIT_HE910_CELLULAR_POWER_H_ +#endif // QUECTEL_BC95_CELLULAR_POWER_H_
Fix wrong header define name
apache-2.0
andcor02/mbed-os,mbedmicro/mbed,andcor02/mbed-os,mbedmicro/mbed,betzw/mbed-os,betzw/mbed-os,andcor02/mbed-os,betzw/mbed-os,kjbracey-arm/mbed,c1728p9/mbed-os,mbedmicro/mbed,andcor02/mbed-os,betzw/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os,mbedmicro/mbed,mbedmicro/mbed,kjbracey-arm/mbed,c1728p9/mbed-os,kjbracey-arm/mbed,c1728p9/mbed-os,betzw/mbed-os,kjbracey-arm/mbed,andcor02/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,betzw/mbed-os
9f6454a084ed56920de2c6bb0cfdb3fa258a0e54
// Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #define ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #import <Cocoa/Cocoa.h> #import "ui/base/cocoa/underlay_opengl_hosting_window.h" // Override NSWindow to access unhandled keyboard events (for command // processing); subclassing NSWindow is the only method to do // this. @interface AtomEventProcessingWindow : UnderlayOpenGLHostingWindow { @private BOOL redispatchingEvent_; BOOL eventHandled_; } // Sends a key event to |NSApp sendEvent:|, but also makes sure that it's not // short-circuited to the RWHV. This is used to send keyboard events to the menu // and the cmd-` handler if a keyboard event comes back unhandled from the // renderer. The event must be of type |NSKeyDown|, |NSKeyUp|, or // |NSFlagsChanged|. // Returns |YES| if |event| has been handled. - (BOOL)redispatchKeyEvent:(NSEvent*)event; - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; @end #endif // ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_
// Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #define ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #import <Cocoa/Cocoa.h> // Override NSWindow to access unhandled keyboard events (for command // processing); subclassing NSWindow is the only method to do // this. @interface AtomEventProcessingWindow : NSWindow { @private BOOL redispatchingEvent_; BOOL eventHandled_; } // Sends a key event to |NSApp sendEvent:|, but also makes sure that it's not // short-circuited to the RWHV. This is used to send keyboard events to the menu // and the cmd-` handler if a keyboard event comes back unhandled from the // renderer. The event must be of type |NSKeyDown|, |NSKeyUp|, or // |NSFlagsChanged|. // Returns |YES| if |event| has been handled. - (BOOL)redispatchKeyEvent:(NSEvent*)event; - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; @end #endif // ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_
--- +++ @@ -7,10 +7,12 @@ #import <Cocoa/Cocoa.h> +#import "ui/base/cocoa/underlay_opengl_hosting_window.h" + // Override NSWindow to access unhandled keyboard events (for command // processing); subclassing NSWindow is the only method to do // this. -@interface AtomEventProcessingWindow : NSWindow { +@interface AtomEventProcessingWindow : UnderlayOpenGLHostingWindow { @private BOOL redispatchingEvent_; BOOL eventHandled_;
Fix the black devtools view. Without using UnderlayOpenGLHostingWindow the devtools view would just be black.
mit
baiwyc119/electron,IonicaBizauKitchen/electron,farmisen/electron,dahal/electron,bright-sparks/electron,darwin/electron,sky7sea/electron,greyhwndz/electron,sircharleswatson/electron,vipulroxx/electron,JesselJohn/electron,vaginessa/electron,hokein/atom-shell,thomsonreuters/electron,kenmozi/electron,brave/muon,Zagorakiss/electron,bobwol/electron,rprichard/electron,lzpfmh/electron,the-ress/electron,LadyNaggaga/electron,nicobot/electron,setzer777/electron,rreimann/electron,edulan/electron,IonicaBizauKitchen/electron,fabien-d/electron,gabriel/electron,farmisen/electron,tincan24/electron,kikong/electron,kazupon/electron,saronwei/electron,Faiz7412/electron,JussMee15/electron,anko/electron,leolujuyi/electron,eric-seekas/electron,aichingm/electron,bwiggs/electron,electron/electron,the-ress/electron,astoilkov/electron,kokdemo/electron,JesselJohn/electron,simongregory/electron,jlord/electron,natgolov/electron,jacksondc/electron,saronwei/electron,the-ress/electron,mattotodd/electron,mjaniszew/electron,simonfork/electron,kokdemo/electron,nagyistoce/electron-atom-shell,sshiting/electron,wan-qy/electron,webmechanicx/electron,Rokt33r/electron,iftekeriba/electron,mattdesl/electron,yalexx/electron,posix4e/electron,jonatasfreitasv/electron,deed02392/electron,xfstudio/electron,beni55/electron,stevemao/electron,jaanus/electron,jlord/electron,mirrh/electron,lrlna/electron,Ivshti/electron,shockone/electron,mattotodd/electron,gbn972/electron,pirafrank/electron,greyhwndz/electron,edulan/electron,systembugtj/electron,bruce/electron,arusakov/electron,RobertJGabriel/electron,pandoraui/electron,astoilkov/electron,timruffles/electron,vHanda/electron,mrwizard82d1/electron,posix4e/electron,christian-bromann/electron,Neron-X5/electron,jonatasfreitasv/electron,pirafrank/electron,Jacobichou/electron,RIAEvangelist/electron,howmuchcomputer/electron,hokein/atom-shell,the-ress/electron,nagyistoce/electron-atom-shell,nekuz0r/electron,Jonekee/electron,Evercoder/electron,benweissmann/electron,joaomoreno/atom-shell,tylergibson/electron,nicobot/electron,yan-foto/electron,electron/electron,carsonmcdonald/electron,mubassirhayat/electron,gabrielPeart/electron,nagyistoce/electron-atom-shell,dongjoon-hyun/electron,bitemyapp/electron,jiaz/electron,adcentury/electron,Zagorakiss/electron,Floato/electron,jonatasfreitasv/electron,adcentury/electron,twolfson/electron,electron/electron,beni55/electron,timruffles/electron,vipulroxx/electron,eric-seekas/electron,brenca/electron,Ivshti/electron,tylergibson/electron,LadyNaggaga/electron,jlhbaseball15/electron,ervinb/electron,gabrielPeart/electron,d-salas/electron,chrisswk/electron,cqqccqc/electron,christian-bromann/electron,kenmozi/electron,gabriel/electron,Zagorakiss/electron,xfstudio/electron,MaxWhere/electron,jiaz/electron,shiftkey/electron,bruce/electron,jannishuebl/electron,the-ress/electron,jannishuebl/electron,medixdev/electron,fabien-d/electron,Neron-X5/electron,jtburke/electron,oiledCode/electron,darwin/electron,fritx/electron,shockone/electron,pombredanne/electron,rsvip/electron,tincan24/electron,Faiz7412/electron,biblerule/UMCTelnetHub,christian-bromann/electron,takashi/electron,bbondy/electron,aaron-goshine/electron,MaxGraey/electron,mirrh/electron,mhkeller/electron,Faiz7412/electron,evgenyzinoviev/electron,shiftkey/electron,mirrh/electron,simongregory/electron,aliib/electron,preco21/electron,thompsonemerson/electron,bwiggs/electron,jcblw/electron,eric-seekas/electron,chrisswk/electron,bobwol/electron,wolfflow/electron,zhakui/electron,leolujuyi/electron,BionicClick/electron,IonicaBizauKitchen/electron,fireball-x/atom-shell,synaptek/electron,xfstudio/electron,adcentury/electron,miniak/electron,thingsinjars/electron,Andrey-Pavlov/electron,Faiz7412/electron,vHanda/electron,BionicClick/electron,jiaz/electron,zhakui/electron,ankitaggarwal011/electron,coderhaoxin/electron,roadev/electron,rajatsingla28/electron,sircharleswatson/electron,tomashanacek/electron,kostia/electron,anko/electron,kokdemo/electron,eric-seekas/electron,leethomas/electron,arturts/electron,stevekinney/electron,aliib/electron,jcblw/electron,sshiting/electron,iftekeriba/electron,pandoraui/electron,lrlna/electron,DivyaKMenon/electron,subblue/electron,Ivshti/electron,stevemao/electron,nicholasess/electron,fireball-x/atom-shell,MaxWhere/electron,chrisswk/electron,abhishekgahlot/electron,rhencke/electron,stevekinney/electron,Andrey-Pavlov/electron,chriskdon/electron,noikiy/electron,Ivshti/electron,systembugtj/electron,lzpfmh/electron,kikong/electron,miniak/electron,rreimann/electron,trankmichael/electron,tonyganch/electron,synaptek/electron,joneit/electron,trankmichael/electron,darwin/electron,digideskio/electron,aaron-goshine/electron,nekuz0r/electron,webmechanicx/electron,fabien-d/electron,wan-qy/electron,trigrass2/electron,kostia/electron,shennushi/electron,gamedevsam/electron,meowlab/electron,jcblw/electron,icattlecoder/electron,maxogden/atom-shell,oiledCode/electron,nicholasess/electron,voidbridge/electron,RIAEvangelist/electron,tomashanacek/electron,darwin/electron,egoist/electron,greyhwndz/electron,natgolov/electron,jiaz/electron,pirafrank/electron,Evercoder/electron,etiktin/electron,beni55/electron,SufianHassan/electron,tincan24/electron,fritx/electron,davazp/electron,egoist/electron,arturts/electron,vipulroxx/electron,kazupon/electron,jhen0409/electron,gbn972/electron,mubassirhayat/electron,pombredanne/electron,simonfork/electron,adamjgray/electron,dkfiresky/electron,fomojola/electron,wolfflow/electron,biblerule/UMCTelnetHub,soulteary/electron,seanchas116/electron,destan/electron,JesselJohn/electron,Jonekee/electron,evgenyzinoviev/electron,natgolov/electron,bitemyapp/electron,shockone/electron,xfstudio/electron,mjaniszew/electron,kikong/electron,timruffles/electron,digideskio/electron,fomojola/electron,Jacobichou/electron,trankmichael/electron,bobwol/electron,d-salas/electron,trankmichael/electron,faizalpribadi/electron,jacksondc/electron,leftstick/electron,ervinb/electron,jacksondc/electron,felixrieseberg/electron,kikong/electron,tomashanacek/electron,robinvandernoord/electron,leolujuyi/electron,kostia/electron,leethomas/electron,IonicaBizauKitchen/electron,RobertJGabriel/electron,fffej/electron,soulteary/electron,baiwyc119/electron,nicholasess/electron,fomojola/electron,renaesop/electron,RobertJGabriel/electron,twolfson/electron,simonfork/electron,aecca/electron,vHanda/electron,subblue/electron,Gerhut/electron,leethomas/electron,JussMee15/electron,thompsonemerson/electron,tinydew4/electron,nagyistoce/electron-atom-shell,shockone/electron,trigrass2/electron,mattdesl/electron,joaomoreno/atom-shell,micalan/electron,kokdemo/electron,renaesop/electron,rhencke/electron,webmechanicx/electron,hokein/atom-shell,bruce/electron,Evercoder/electron,Rokt33r/electron,wolfflow/electron,chrisswk/electron,tonyganch/electron,DivyaKMenon/electron,aliib/electron,davazp/electron,simongregory/electron,mubassirhayat/electron,vHanda/electron,nekuz0r/electron,eriser/electron,etiktin/electron,jsutcodes/electron,mubassirhayat/electron,takashi/electron,trigrass2/electron,iftekeriba/electron,sky7sea/electron,mattotodd/electron,vaginessa/electron,carsonmcdonald/electron,tomashanacek/electron,astoilkov/electron,chriskdon/electron,Neron-X5/electron,robinvandernoord/electron,RIAEvangelist/electron,medixdev/electron,aliib/electron,joaomoreno/atom-shell,cqqccqc/electron,rajatsingla28/electron,Jonekee/electron,neutrous/electron,farmisen/electron,fffej/electron,Gerhut/electron,iftekeriba/electron,jhen0409/electron,Zagorakiss/electron,soulteary/electron,noikiy/electron,leolujuyi/electron,leolujuyi/electron,oiledCode/electron,arusakov/electron,gstack/infinium-shell,chriskdon/electron,bitemyapp/electron,roadev/electron,shiftkey/electron,jhen0409/electron,mattotodd/electron,trankmichael/electron,dongjoon-hyun/electron,stevekinney/electron,simonfork/electron,jlord/electron,minggo/electron,the-ress/electron,sshiting/electron,beni55/electron,cos2004/electron,fireball-x/atom-shell,stevemao/electron,fabien-d/electron,yalexx/electron,bpasero/electron,saronwei/electron,baiwyc119/electron,bbondy/electron,mirrh/electron,benweissmann/electron,aecca/electron,leethomas/electron,jsutcodes/electron,mhkeller/electron,mattdesl/electron,kcrt/electron,kazupon/electron,jcblw/electron,aliib/electron,digideskio/electron,sircharleswatson/electron,mhkeller/electron,matiasinsaurralde/electron,vipulroxx/electron,cqqccqc/electron,joaomoreno/atom-shell,RIAEvangelist/electron,jannishuebl/electron,abhishekgahlot/electron,rsvip/electron,John-Lin/electron,arturts/electron,xiruibing/electron,chriskdon/electron,jlhbaseball15/electron,thomsonreuters/electron,bobwol/electron,baiwyc119/electron,tylergibson/electron,MaxGraey/electron,leftstick/electron,voidbridge/electron,wan-qy/electron,leftstick/electron,jsutcodes/electron,aecca/electron,tomashanacek/electron,egoist/electron,faizalpribadi/electron,deed02392/electron,Rokt33r/electron,greyhwndz/electron,LadyNaggaga/electron,howmuchcomputer/electron,gabrielPeart/electron,edulan/electron,anko/electron,deed02392/electron,brave/muon,DivyaKMenon/electron,jhen0409/electron,renaesop/electron,John-Lin/electron,jlhbaseball15/electron,astoilkov/electron,systembugtj/electron,iftekeriba/electron,aichingm/electron,carsonmcdonald/electron,jaanus/electron,bpasero/electron,davazp/electron,wolfflow/electron,brave/electron,trigrass2/electron,GoooIce/electron,wolfflow/electron,gbn972/electron,rsvip/electron,zhakui/electron,bwiggs/electron,mattotodd/electron,Neron-X5/electron,jonatasfreitasv/electron,mirrh/electron,coderhaoxin/electron,kenmozi/electron,etiktin/electron,yan-foto/electron,adamjgray/electron,coderhaoxin/electron,preco21/electron,bruce/electron,vipulroxx/electron,minggo/electron,twolfson/electron,ervinb/electron,etiktin/electron,chriskdon/electron,jonatasfreitasv/electron,wan-qy/electron,astoilkov/electron,aaron-goshine/electron,rajatsingla28/electron,mattotodd/electron,jacksondc/electron,lrlna/electron,thompsonemerson/electron,adamjgray/electron,brave/electron,gstack/infinium-shell,GoooIce/electron,chrisswk/electron,preco21/electron,deed02392/electron,Zagorakiss/electron,SufianHassan/electron,systembugtj/electron,icattlecoder/electron,lzpfmh/electron,biblerule/UMCTelnetHub,vipulroxx/electron,Gerhut/electron,kenmozi/electron,arturts/electron,faizalpribadi/electron,arusakov/electron,thompsonemerson/electron,xiruibing/electron,ianscrivener/electron,aichingm/electron,deed02392/electron,electron/electron,stevekinney/electron,takashi/electron,carsonmcdonald/electron,smczk/electron,systembugtj/electron,dahal/electron,zhakui/electron,felixrieseberg/electron,pirafrank/electron,ianscrivener/electron,dahal/electron,aichingm/electron,pandoraui/electron,Zagorakiss/electron,oiledCode/electron,wan-qy/electron,fffej/electron,natgolov/electron,kcrt/electron,jhen0409/electron,Jonekee/electron,dongjoon-hyun/electron,kazupon/electron,meowlab/electron,ianscrivener/electron,brave/muon,adamjgray/electron,edulan/electron,icattlecoder/electron,matiasinsaurralde/electron,jsutcodes/electron,IonicaBizauKitchen/electron,Faiz7412/electron,roadev/electron,gerhardberger/electron,edulan/electron,miniak/electron,deepak1556/atom-shell,tylergibson/electron,electron/electron,rprichard/electron,farmisen/electron,noikiy/electron,rhencke/electron,timruffles/electron,bwiggs/electron,noikiy/electron,felixrieseberg/electron,ianscrivener/electron,meowlab/electron,tinydew4/electron,tinydew4/electron,mhkeller/electron,setzer777/electron,arturts/electron,vaginessa/electron,nicobot/electron,pandoraui/electron,RIAEvangelist/electron,xfstudio/electron,lzpfmh/electron,felixrieseberg/electron,Gerhut/electron,bpasero/electron,trigrass2/electron,posix4e/electron,Jacobichou/electron,gstack/infinium-shell,Andrey-Pavlov/electron,GoooIce/electron,seanchas116/electron,cos2004/electron,jjz/electron,astoilkov/electron,cqqccqc/electron,tinydew4/electron,brave/muon,gamedevsam/electron,smczk/electron,gerhardberger/electron,davazp/electron,d-salas/electron,kenmozi/electron,fritx/electron,tonyganch/electron,mjaniszew/electron,xiruibing/electron,miniak/electron,gbn972/electron,brave/muon,setzer777/electron,jacksondc/electron,gamedevsam/electron,Jonekee/electron,jtburke/electron,systembugtj/electron,Floato/electron,gerhardberger/electron,biblerule/UMCTelnetHub,mhkeller/electron,simongregory/electron,Ivshti/electron,mattdesl/electron,icattlecoder/electron,rhencke/electron,shiftkey/electron,gabriel/electron,dahal/electron,JussMee15/electron,jtburke/electron,fritx/electron,nicobot/electron,Evercoder/electron,d-salas/electron,Neron-X5/electron,brenca/electron,gabrielPeart/electron,voidbridge/electron,brave/electron,xiruibing/electron,robinvandernoord/electron,rreimann/electron,jaanus/electron,shennushi/electron,nekuz0r/electron,shaundunne/electron,gerhardberger/electron,icattlecoder/electron,smczk/electron,shockone/electron,beni55/electron,abhishekgahlot/electron,nicholasess/electron,twolfson/electron,arturts/electron,leftstick/electron,trankmichael/electron,sircharleswatson/electron,bpasero/electron,stevemao/electron,robinvandernoord/electron,jtburke/electron,Jacobichou/electron,thompsonemerson/electron,meowlab/electron,rreimann/electron,icattlecoder/electron,minggo/electron,howmuchcomputer/electron,JesselJohn/electron,RobertJGabriel/electron,thomsonreuters/electron,gamedevsam/electron,farmisen/electron,thompsonemerson/electron,kazupon/electron,kcrt/electron,aichingm/electron,MaxWhere/electron,Floato/electron,simonfork/electron,aliib/electron,cos2004/electron,baiwyc119/electron,jlhbaseball15/electron,dongjoon-hyun/electron,howmuchcomputer/electron,pandoraui/electron,sshiting/electron,yan-foto/electron,neutrous/electron,michaelchiche/electron,destan/electron,matiasinsaurralde/electron,cos2004/electron,jjz/electron,vaginessa/electron,adcentury/electron,etiktin/electron,GoooIce/electron,chriskdon/electron,ankitaggarwal011/electron,Floato/electron,kikong/electron,roadev/electron,simonfork/electron,anko/electron,pirafrank/electron,bbondy/electron,bpasero/electron,joneit/electron,bpasero/electron,fabien-d/electron,jjz/electron,seanchas116/electron,d-salas/electron,lzpfmh/electron,bbondy/electron,renaesop/electron,eriser/electron,fffej/electron,medixdev/electron,mjaniszew/electron,adamjgray/electron,vaginessa/electron,meowlab/electron,Jonekee/electron,coderhaoxin/electron,benweissmann/electron,brave/electron,gabriel/electron,kcrt/electron,gerhardberger/electron,shockone/electron,dkfiresky/electron,jonatasfreitasv/electron,John-Lin/electron,eriser/electron,preco21/electron,kostia/electron,webmechanicx/electron,rsvip/electron,jhen0409/electron,Andrey-Pavlov/electron,deepak1556/atom-shell,MaxWhere/electron,xfstudio/electron,MaxGraey/electron,evgenyzinoviev/electron,BionicClick/electron,ankitaggarwal011/electron,ankitaggarwal011/electron,zhakui/electron,farmisen/electron,dahal/electron,joneit/electron,thingsinjars/electron,thingsinjars/electron,timruffles/electron,bbondy/electron,destan/electron,howmuchcomputer/electron,pombredanne/electron,micalan/electron,MaxGraey/electron,Andrey-Pavlov/electron,michaelchiche/electron,John-Lin/electron,renaesop/electron,mirrh/electron,dahal/electron,gamedevsam/electron,rsvip/electron,edulan/electron,jiaz/electron,saronwei/electron,cos2004/electron,ianscrivener/electron,shennushi/electron,eriser/electron,soulteary/electron,deed02392/electron,yan-foto/electron,medixdev/electron,mubassirhayat/electron,tylergibson/electron,Rokt33r/electron,benweissmann/electron,dongjoon-hyun/electron,smczk/electron,JussMee15/electron,matiasinsaurralde/electron,webmechanicx/electron,leolujuyi/electron,etiktin/electron,cqqccqc/electron,jlhbaseball15/electron,kostia/electron,tincan24/electron,Gerhut/electron,natgolov/electron,evgenyzinoviev/electron,michaelchiche/electron,thomsonreuters/electron,SufianHassan/electron,bobwol/electron,takashi/electron,MaxWhere/electron,kokdemo/electron,SufianHassan/electron,adcentury/electron,faizalpribadi/electron,anko/electron,minggo/electron,d-salas/electron,benweissmann/electron,John-Lin/electron,micalan/electron,shaundunne/electron,sircharleswatson/electron,deepak1556/atom-shell,bobwol/electron,leftstick/electron,michaelchiche/electron,fritx/electron,zhakui/electron,arusakov/electron,brenca/electron,robinvandernoord/electron,dkfiresky/electron,arusakov/electron,BionicClick/electron,egoist/electron,miniak/electron,jcblw/electron,JesselJohn/electron,destan/electron,tincan24/electron,sky7sea/electron,renaesop/electron,hokein/atom-shell,Floato/electron,noikiy/electron,tomashanacek/electron,bright-sparks/electron,jlord/electron,bwiggs/electron,egoist/electron,stevemao/electron,vHanda/electron,joaomoreno/atom-shell,voidbridge/electron,nicholasess/electron,shennushi/electron,posix4e/electron,fireball-x/atom-shell,JesselJohn/electron,rreimann/electron,jjz/electron,gerhardberger/electron,micalan/electron,ervinb/electron,jtburke/electron,mrwizard82d1/electron,xiruibing/electron,noikiy/electron,minggo/electron,MaxWhere/electron,jtburke/electron,bitemyapp/electron,mjaniszew/electron,stevemao/electron,yan-foto/electron,coderhaoxin/electron,gabrielPeart/electron,nekuz0r/electron,ianscrivener/electron,rajatsingla28/electron,nagyistoce/electron-atom-shell,stevekinney/electron,shaundunne/electron,Jacobichou/electron,eriser/electron,GoooIce/electron,wan-qy/electron,sshiting/electron,setzer777/electron,christian-bromann/electron,bruce/electron,shaundunne/electron,joneit/electron,bruce/electron,aecca/electron,simongregory/electron,rhencke/electron,anko/electron,micalan/electron,felixrieseberg/electron,maxogden/atom-shell,bitemyapp/electron,carsonmcdonald/electron,benweissmann/electron,michaelchiche/electron,Gerhut/electron,neutrous/electron,thingsinjars/electron,greyhwndz/electron,gstack/infinium-shell,mhkeller/electron,stevekinney/electron,biblerule/UMCTelnetHub,IonicaBizauKitchen/electron,nekuz0r/electron,BionicClick/electron,smczk/electron,aaron-goshine/electron,lrlna/electron,vaginessa/electron,oiledCode/electron,LadyNaggaga/electron,fomojola/electron,posix4e/electron,brave/muon,SufianHassan/electron,JussMee15/electron,gerhardberger/electron,greyhwndz/electron,kazupon/electron,rhencke/electron,Andrey-Pavlov/electron,thomsonreuters/electron,aecca/electron,jannishuebl/electron,thingsinjars/electron,gbn972/electron,sircharleswatson/electron,carsonmcdonald/electron,aaron-goshine/electron,evgenyzinoviev/electron,Rokt33r/electron,gbn972/electron,medixdev/electron,kcrt/electron,synaptek/electron,preco21/electron,joneit/electron,felixrieseberg/electron,seanchas116/electron,davazp/electron,brave/electron,jannishuebl/electron,xiruibing/electron,eric-seekas/electron,matiasinsaurralde/electron,shennushi/electron,deepak1556/atom-shell,leethomas/electron,takashi/electron,sky7sea/electron,shaundunne/electron,robinvandernoord/electron,bright-sparks/electron,ervinb/electron,bright-sparks/electron,bbondy/electron,DivyaKMenon/electron,yan-foto/electron,abhishekgahlot/electron,baiwyc119/electron,rreimann/electron,joaomoreno/atom-shell,subblue/electron,sky7sea/electron,digideskio/electron,abhishekgahlot/electron,bright-sparks/electron,minggo/electron,voidbridge/electron,roadev/electron,leftstick/electron,tylergibson/electron,voidbridge/electron,BionicClick/electron,tonyganch/electron,fffej/electron,arusakov/electron,fomojola/electron,pombredanne/electron,simongregory/electron,LadyNaggaga/electron,subblue/electron,fffej/electron,rajatsingla28/electron,Evercoder/electron,oiledCode/electron,thomsonreuters/electron,brenca/electron,deepak1556/atom-shell,jacksondc/electron,saronwei/electron,cqqccqc/electron,nicobot/electron,fritx/electron,sky7sea/electron,gamedevsam/electron,joneit/electron,electron/electron,meowlab/electron,dongjoon-hyun/electron,dkfiresky/electron,micalan/electron,abhishekgahlot/electron,bright-sparks/electron,christian-bromann/electron,LadyNaggaga/electron,shennushi/electron,nicobot/electron,lzpfmh/electron,smczk/electron,digideskio/electron,saronwei/electron,tonyganch/electron,faizalpribadi/electron,the-ress/electron,SufianHassan/electron,faizalpribadi/electron,ervinb/electron,pirafrank/electron,kokdemo/electron,pombredanne/electron,RIAEvangelist/electron,DivyaKMenon/electron,MaxGraey/electron,maxogden/atom-shell,yalexx/electron,medixdev/electron,gstack/infinium-shell,eriser/electron,evgenyzinoviev/electron,twolfson/electron,jsutcodes/electron,setzer777/electron,jannishuebl/electron,Jacobichou/electron,dkfiresky/electron,christian-bromann/electron,subblue/electron,adamjgray/electron,yalexx/electron,mattdesl/electron,sshiting/electron,howmuchcomputer/electron,Evercoder/electron,preco21/electron,kostia/electron,synaptek/electron,darwin/electron,rajatsingla28/electron,miniak/electron,gabriel/electron,destan/electron,thingsinjars/electron,tincan24/electron,ankitaggarwal011/electron,adcentury/electron,RobertJGabriel/electron,biblerule/UMCTelnetHub,gabrielPeart/electron,Neron-X5/electron,shiftkey/electron,rprichard/electron,subblue/electron,kcrt/electron,jiaz/electron,jlhbaseball15/electron,setzer777/electron,dkfiresky/electron,neutrous/electron,aecca/electron,lrlna/electron,DivyaKMenon/electron,takashi/electron,jjz/electron,synaptek/electron,michaelchiche/electron,fireball-x/atom-shell,seanchas116/electron,neutrous/electron,leethomas/electron,jsutcodes/electron,tinydew4/electron,bwiggs/electron,tonyganch/electron,neutrous/electron,roadev/electron,aaron-goshine/electron,mattdesl/electron,soulteary/electron,John-Lin/electron,bpasero/electron,ankitaggarwal011/electron,maxogden/atom-shell,coderhaoxin/electron,webmechanicx/electron,maxogden/atom-shell,jjz/electron,jlord/electron,shiftkey/electron,iftekeriba/electron,fomojola/electron,trigrass2/electron,vHanda/electron,yalexx/electron,eric-seekas/electron,mrwizard82d1/electron,rprichard/electron,JussMee15/electron,seanchas116/electron,kenmozi/electron,cos2004/electron,tinydew4/electron,posix4e/electron,mrwizard82d1/electron,davazp/electron,pandoraui/electron,yalexx/electron,nicholasess/electron,synaptek/electron,wolfflow/electron,mjaniszew/electron,destan/electron,electron/electron,matiasinsaurralde/electron,beni55/electron,jaanus/electron,brave/electron,jcblw/electron,brenca/electron,digideskio/electron,jaanus/electron,hokein/atom-shell,RobertJGabriel/electron,Floato/electron,GoooIce/electron,twolfson/electron,egoist/electron,brenca/electron,pombredanne/electron,aichingm/electron,jaanus/electron,lrlna/electron,mrwizard82d1/electron,shaundunne/electron,soulteary/electron,Rokt33r/electron,mrwizard82d1/electron,natgolov/electron,bitemyapp/electron,gabriel/electron
1c0b391419b035f78b41ee3bce8934f42896eef2
/** * \usergroup{SceAVConfig} * \usage{psp2/avconfig.h,SceAVConfig_stub} */ #ifndef _PSP2_AVCONFIG_H_ #define _PSP2_AVCONFIG_H_ #include <psp2/types.h> #ifdef __cplusplus extern "C" { #endif /*** * Get the maximum brightness. * * @param[out] maxBrightness - Maximum brightness. * * @return 0 on success, < 0 on error. */ int sceAVConfigGetDisplayMaxBrightness(int *maxBrightness); /*** * Set the screen brightness. * * @param brightness - Brightness that the screen will be set to (range 21-65536, 0 turns off the screen). * * @return 0 on success, < 0 on error. */ int sceAVConfigSetDisplayBrightness(int brightness); /*** * Get the shutter volume. * * @param[out] volume - shutter volume. * * @return 0 on success, < 0 on error. */ int sceAVConfigGetShutterVol(int *volume); /*** * Get the system volume. * * @param[out] volume - System volume. * * @return 0 on success, < 0 on error. */ int sceAVConfigGetSystemVol(int *volume); /*** * Set the system volume. * * @param volume - volume that the device will be set to (range 0-30). * * @return 0 on success, < 0 on error. */ int sceAVConfigSetSystemVol(int volume); /** * Turns on mute. * * @return 0 on success, < 0 on error. * */ int sceAVConfigMuteOn(void); #ifdef __cplusplus } #endif #endif
/** * \usergroup{SceAVConfig} * \usage{psp2/avconfig.h,SceAVConfig_stub} */ #ifndef _PSP2_AVCONFIG_H_ #define _PSP2_AVCONFIG_H_ #include <psp2/types.h> #ifdef __cplusplus extern "C" { #endif /*** * Get the maximum brightness. * * @param[out] maxBrightness - Maximum brightness. * * @return 0 on success, < 0 on error. */ int sceAVConfigGetDisplayMaxBrightness(int *maxBrightness); /*** * Set the screen brightness. * * @param brightness - Brightness that the screen will be set to (range 21-65536, 0 turns off the screen). * * @return 0 on success, < 0 on error. */ int sceAVConfigSetDisplayBrightness(int brightness); #ifdef __cplusplus } #endif #endif
--- +++ @@ -31,6 +31,41 @@ */ int sceAVConfigSetDisplayBrightness(int brightness); +/*** + * Get the shutter volume. + * + * @param[out] volume - shutter volume. + * + * @return 0 on success, < 0 on error. + */ +int sceAVConfigGetShutterVol(int *volume); + +/*** + * Get the system volume. + * + * @param[out] volume - System volume. + * + * @return 0 on success, < 0 on error. + */ +int sceAVConfigGetSystemVol(int *volume); + +/*** + * Set the system volume. + * + * @param volume - volume that the device will be set to (range 0-30). + * + * @return 0 on success, < 0 on error. + */ +int sceAVConfigSetSystemVol(int volume); + +/** + * Turns on mute. + * + * @return 0 on success, < 0 on error. + * + */ +int sceAVConfigMuteOn(void); + #ifdef __cplusplus }
Add some sceAVConfig volume functions
mit
Rinnegatamante/vita-headers,Rinnegatamante/vita-headers,vitasdk/vita-headers,vitasdk/vita-headers,Rinnegatamante/vita-headers,vitasdk/vita-headers,vitasdk/vita-headers,Rinnegatamante/vita-headers
40489836d8c58602f60a2f2fa7b564754d41d7ae
// // Copyright (C) 2007 SIPez LLC. // Licensed to SIPfoundry under a Contributor Agreement. // // Copyright (C) 2007 SIPfoundry Inc. // Licensed by SIPfoundry under the LGPL license. // // $$ /////////////////////////////////////////////////////////////////////////////// // Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com> #ifndef _plgg726_h_ #define _plgg726_h_ #include <mp/codecs/PlgDefsV1.h> #include <spandsp/bitstream.h> #include <spandsp/g726.h> #ifndef G726_PACKING_NONE #define G726_PACKING_NONE 0 #endif #ifndef G726_ENCODING_LINEAR #define G726_ENCODING_LINEAR 0 #endif int internal_decode_g726(void* handle, const void* pCodedData, unsigned cbCodedPacketSize, void* pAudioBuffer, unsigned cbBufferSize, unsigned *pcbCodedSize, const struct RtpHeader* pRtpHeader); int internal_encode_g726(void* handle, const void* pAudioBuffer, unsigned cbAudioSamples, int* rSamplesConsumed, void* pCodedData, unsigned cbMaxCodedData, int* pcbCodedSize, unsigned* pbSendNow); #endif
// // Copyright (C) 2007 SIPez LLC. // Licensed to SIPfoundry under a Contributor Agreement. // // Copyright (C) 2007 SIPfoundry Inc. // Licensed by SIPfoundry under the LGPL license. // // $$ /////////////////////////////////////////////////////////////////////////////// // Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com> #ifndef _plgg726_h_ #define _plgg726_h_ #include <mp/codecs/PlgDefsV1.h> #include <spandsp/bitstream.h> #include <spandsp/g726.h> int internal_decode_g726(void* handle, const void* pCodedData, unsigned cbCodedPacketSize, void* pAudioBuffer, unsigned cbBufferSize, unsigned *pcbCodedSize, const struct RtpHeader* pRtpHeader); int internal_encode_g726(void* handle, const void* pAudioBuffer, unsigned cbAudioSamples, int* rSamplesConsumed, void* pCodedData, unsigned cbMaxCodedData, int* pcbCodedSize, unsigned* pbSendNow); #endif
--- +++ @@ -18,6 +18,13 @@ #include <spandsp/bitstream.h> #include <spandsp/g726.h> +#ifndef G726_PACKING_NONE +#define G726_PACKING_NONE 0 +#endif + +#ifndef G726_ENCODING_LINEAR +#define G726_ENCODING_LINEAR 0 +#endif int internal_decode_g726(void* handle, const void* pCodedData, unsigned cbCodedPacketSize, void* pAudioBuffer,
FIx build of G.726 codec wrapper with older versions of SpanDSP. git-svn-id: 5274dacc98e2a95d0b0452670772bfdffe61ca90@10190 a612230a-c5fa-0310-af8b-88eea846685b
lgpl-2.1
sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror
939667b6efbc5eb92e80af985727eb2465d19810
/****************************************************************************** GameState.h Game State Management Copyright (c) 2013 Jeffrey Carpenter Portions Copyright (c) 2013 Fielding Johnston ******************************************************************************/ #ifndef GAMEAPP_GAMESTATE_HEADERS #define GAMEAPP_GAMESTATE_HEADERS #include <iostream> #include <string> #include "SDL.h" #include "SDLInput.h" #include "gamelib.h" { public: virtual ~GameState(); virtual void Pause() = 0; virtual void Resume() = 0; virtual void HandleInput ( void ) = 0; virtual void Update ( void ) = 0; virtual void Draw ( void ) = 0; private: // ... }; #endif // GAMEAPP_GAMESTATE_HEADERS defined
/****************************************************************************** GameState.h Game State Management Copyright (c) 2013 Jeffrey Carpenter Portions Copyright (c) 2013 Fielding Johnston ******************************************************************************/ #ifndef GAMEAPP_GAMESTATE_HEADERS #define GAMEAPP_GAMESTATE_HEADERS #include <iostream> #include <string> #include "SDL.h" #include "SDLInput.h" #include "gamelib.h" { public: virtual ~GameState(); virtual void Pause() = 0; virtual void Resume() = 0; virtual void Input ( void ) = 0; virtual void Update ( void ) = 0; virtual void Draw ( void ) = 0; private: // ... }; #endif // GAMEAPP_GAMESTATE_HEADERS defined
--- +++ @@ -27,7 +27,7 @@ virtual void Pause() = 0; virtual void Resume() = 0; - virtual void Input ( void ) = 0; + virtual void HandleInput ( void ) = 0; virtual void Update ( void ) = 0; virtual void Draw ( void ) = 0;
Rename of Input to HandleInput
bsd-2-clause
i8degrees/nomlib,i8degrees/nomlib,i8degrees/nomlib,i8degrees/nomlib
af65de668c8b6ab55e46e07ca5235feee23e86dc
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/document/bucket/bucketid.h> #include <vespa/persistence/spi/bucket_limits.h> #include <cassert> namespace storage { /** * Returns the super bucket key of the given bucket id key based on the minimum used bits allowed. */ inline uint64_t get_super_bucket_key(const document::BucketId& bucket_id) noexcept { assert(bucket_id.getUsedBits() >= spi::BucketLimits::MinUsedBits); // Since bucket keys have count-bits at the LSB positions, we want to look at the MSBs instead. return (bucket_id.toKey() >> (64 - spi::BucketLimits::MinUsedBits)); } }
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/document/bucket/bucketid.h> #include <vespa/persistence/spi/bucket_limits.h> #include <cassert> namespace storage { /** * Returns the super bucket key of the given bucket id key based on the minimum used bits allowed. */ uint64_t get_super_bucket_key(const document::BucketId& bucket_id) { assert(bucket_id.getUsedBits() >= spi::BucketLimits::MinUsedBits); // Since bucket keys have count-bits at the LSB positions, we want to look at the MSBs instead. return (bucket_id.toKey() >> (64 - spi::BucketLimits::MinUsedBits)); } }
--- +++ @@ -11,7 +11,7 @@ /** * Returns the super bucket key of the given bucket id key based on the minimum used bits allowed. */ -uint64_t get_super_bucket_key(const document::BucketId& bucket_id) { +inline uint64_t get_super_bucket_key(const document::BucketId& bucket_id) noexcept { assert(bucket_id.getUsedBits() >= spi::BucketLimits::MinUsedBits); // Since bucket keys have count-bits at the LSB positions, we want to look at the MSBs instead. return (bucket_id.toKey() >> (64 - spi::BucketLimits::MinUsedBits));
Make function inline and noexcept.
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
7a276551f8349db28f32c36a68ab96c46c90517c
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // version: $Id$ // author: Timur Pocheptsov <[email protected]> //------------------------------------------------------------------------------ #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 <[email protected]> //------------------------------------------------------------------------------ #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: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@47814 27541ba8-7e3a-0410-8455-c3a389f83636
lgpl-2.1
karies/cling,marsupial/cling,karies/cling,perovic/cling,marsupial/cling,marsupial/cling,perovic/cling,root-mirror/cling,marsupial/cling,perovic/cling,root-mirror/cling,marsupial/cling,perovic/cling,karies/cling,karies/cling,root-mirror/cling,karies/cling,root-mirror/cling,perovic/cling,marsupial/cling,root-mirror/cling,karies/cling,root-mirror/cling
3f150a8d8b571ca3f072d3ced1b3272aa82b9ea9
#ifndef TDCChannel_h #define TDCChannel_h #include <fstream> #include <TObject.h> #include <TClonesArray.h> #include <iostream> #define MAX_FULL_HITS 50 class TDCChannel : public TObject { protected: Int_t channel; double leadTime1; double trailTime1; double tot1; double referenceDiff1; double leadTimes[MAX_FULL_HITS]; double trailTimes[MAX_FULL_HITS]; double tots[MAX_FULL_HITS]; double referenceDiffs[MAX_FULL_HITS]; int hitsNum; public: TDCChannel(); ~TDCChannel(); void SetChannel(Int_t channel) { this->channel = channel; } int GetChannel() { return channel; } int GetHitsNum() { return hitsNum; } void AddHit(double lead, double trail, double ref); void AddHit(double lead, double trail); double GetLeadTime1() { return leadTime1; } double GetLeadTime(int mult) { return leadTimes[mult]; } double GetTrailTime1() { return trailTime1; } double GetTrailTime(int mult) { return trailTimes[mult]; } double GetTOT1() { return tot1; } int GetMult() { return hitsNum; } double GetTOT(int mult) { return tots[mult]; } ClassDef(TDCChannel,1); }; #endif
#ifndef TDCChannel_h #define TDCChannel_h #include <fstream> #include <TObject.h> #include <TClonesArray.h> #include <iostream> #define MAX_FULL_HITS 100 class TDCChannel : public TObject { protected: Int_t channel; double leadTime1; double trailTime1; double tot1; double referenceDiff1; double leadTimes[MAX_FULL_HITS]; double trailTimes[MAX_FULL_HITS]; double tots[MAX_FULL_HITS]; double referenceDiffs[MAX_FULL_HITS]; int hitsNum; public: TDCChannel(); ~TDCChannel(); void SetChannel(Int_t channel) { this->channel = channel; } int GetChannel() { return channel; } int GetHitsNum() { return hitsNum; } void AddHit(double lead, double trail, double ref); void AddHit(double lead, double trail); double GetLeadTime1() { return leadTime1; } double GetLeadTime(int mult) { return leadTimes[mult]; } double GetTrailTime1() { return trailTime1; } double GetTrailTime(int mult) { return trailTimes[mult]; } double GetTOT1() { return tot1; } int GetMult() { return hitsNum; } double GetTOT(int mult) { return tots[mult]; } ClassDef(TDCChannel,1); }; #endif
--- +++ @@ -6,7 +6,7 @@ #include <TClonesArray.h> #include <iostream> -#define MAX_FULL_HITS 100 +#define MAX_FULL_HITS 50 class TDCChannel : public TObject {
Change TDCHits array size from 100 to 50 For consistency with the standalone version of the Unpacker.
apache-2.0
kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework
2766579a314f92c3fdf3f87e7bb20e5a4e52c01b
#import <Foundation/Foundation.h> //! Project version number for Quick. FOUNDATION_EXPORT double QuickVersionNumber; //! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Quick/PublicHeader.h> #import <Quick/QuickSpec.h> #import <Quick/QCKDSL.h> #import <Quick/QuickConfiguration.h>
#import <Foundation/Foundation.h> //! Project version number for Quick. FOUNDATION_EXPORT double QuickVersionNumber; //! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; #import <Quick/QuickSpec.h>
--- +++ @@ -6,4 +6,8 @@ //! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; +// In this header, you should import all the public headers of your framework using statements like #import <Quick/PublicHeader.h> + #import <Quick/QuickSpec.h> +#import <Quick/QCKDSL.h> +#import <Quick/QuickConfiguration.h>
Revert "Remove public headers from umbrella header" This reverts commit 3c5ab51a235a400427b364a608e679d91390f96a.
apache-2.0
ikesyo/Quick,Quick/Quick,jeffh/Quick,Quick/Quick,jasonchaffee/Quick,jasonchaffee/Quick,paulyoung/Quick,marciok/Quick,jasonchaffee/Quick,phatblat/Quick,ikesyo/Quick,DanielAsher/Quick,ashfurrow/Quick,marciok/Quick,DanielAsher/Quick,paulyoung/Quick,ikesyo/Quick,ashfurrow/Quick,Quick/Quick,mokagio/Quick,paulyoung/Quick,phatblat/Quick,jeffh/Quick,dgdosen/Quick,mokagio/Quick,jeffh/Quick,phatblat/Quick,mokagio/Quick,dgdosen/Quick,Quick/Quick,dgdosen/Quick,phatblat/Quick,marciok/Quick
ee99eef691ae08f3bea6012e0ff81850be1a4906
#ifndef DG_POINTS_TO_SET_H_ #define DG_POINTS_TO_SET_H_ #include "dg/PointerAnalysis/PointsToSets/OffsetsSetPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/SimplePointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/SeparateOffsetsPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/PointerIdPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/SmallOffsetsPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/AlignedSmallOffsetsPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/AlignedPointerIdPointsToSet.h" namespace dg { namespace pta { using PointsToSetT = OffsetsSetPointsToSet; using PointsToMapT = std::map<Offset, PointsToSetT>; } // namespace pta } // namespace dg #endif
#ifndef DG_POINTS_TO_SET_H_ #define DG_POINTS_TO_SET_H_ #include "dg/PointerAnalysis/PointsToSets/OffsetsSetPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/SimplePointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/SeparateOffsetsPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/PointerIdPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/SmallOffsetsPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/AlignedSmallOffsetsPointsToSet.h" #include "dg/PointerAnalysis/PointsToSets/AlignedPointerIdPointsToSet.h" namespace dg { namespace pta { //using PointsToSetT = OffsetsSetPointsToSet; using PointsToSetT = PointerIdPointsToSet; using PointsToMapT = std::map<Offset, PointsToSetT>; } // namespace pta } // namespace dg #endif
--- +++ @@ -12,8 +12,7 @@ namespace dg { namespace pta { -//using PointsToSetT = OffsetsSetPointsToSet; -using PointsToSetT = PointerIdPointsToSet; +using PointsToSetT = OffsetsSetPointsToSet; using PointsToMapT = std::map<Offset, PointsToSetT>; } // namespace pta
Revert "PTA: use bitvector-based points-to set representation" This reverts commit 74f5d133452018f5e933ab864446bdb720fa84b9.
mit
mchalupa/dg,mchalupa/dg,mchalupa/dg,mchalupa/dg
462e57739769909d72cda50355e2ccc055386816
#include <ruby.h> #ifndef RARRAY_PTR #define RARRAY_PTR(ary) RARRAY(ary)->ptr #endif #ifndef RARRAY_LEN #define RARRAY_LEN(ary) RARRAY(ary)->len #endif static ID id_cmp; static VALUE rb_array_binary_index(VALUE self, VALUE value) { int lower = 0; int upper = RARRAY_LEN(self) - 1; int i, comp; while(lower <= upper) { i = lower + (upper - lower) / 2; comp = FIX2INT(rb_funcall(value, id_cmp, 1, RARRAY_PTR(self)[i])); if(comp == 0) { return LONG2NUM(i); } else if(comp == 1) { lower = i + 1; } else { upper = i - 1; }; } return Qnil; } void Init_binary_search() { id_cmp = rb_intern("<=>"); rb_define_method(rb_cArray, "binary_index", rb_array_binary_index, 1); }
#include <ruby.h> static ID id_cmp; static VALUE rb_array_binary_index(VALUE self, VALUE value) { int lower = 0; int upper = RARRAY(self)->len - 1; int i, comp; while(lower <= upper) { i = lower + (upper - lower) / 2; comp = FIX2INT(rb_funcall(value, id_cmp, 1, RARRAY(self)->ptr[i])); if(comp == 0) { return LONG2NUM(i); } else if(comp == 1) { lower = i + 1; } else { upper = i - 1; }; } return Qnil; } void Init_binary_search() { id_cmp = rb_intern("<=>"); rb_define_method(rb_cArray, "binary_index", rb_array_binary_index, 1); }
--- +++ @@ -1,15 +1,22 @@ #include <ruby.h> + +#ifndef RARRAY_PTR +#define RARRAY_PTR(ary) RARRAY(ary)->ptr +#endif +#ifndef RARRAY_LEN +#define RARRAY_LEN(ary) RARRAY(ary)->len +#endif static ID id_cmp; static VALUE rb_array_binary_index(VALUE self, VALUE value) { int lower = 0; - int upper = RARRAY(self)->len - 1; + int upper = RARRAY_LEN(self) - 1; int i, comp; while(lower <= upper) { i = lower + (upper - lower) / 2; - comp = FIX2INT(rb_funcall(value, id_cmp, 1, RARRAY(self)->ptr[i])); + comp = FIX2INT(rb_funcall(value, id_cmp, 1, RARRAY_PTR(self)[i])); if(comp == 0) { return LONG2NUM(i);
Use RARRAY_LEN and RARRAY_PTR on ruby 1.9
mit
tyler/binary_search,tyler/binary_search
9b4a41296ef6979aa4622c509d301d8e5fd7f275
#include <kotaka/privilege.h> /* keeps track of bans */ mapping username_bans; private void save(); private void restore(); static void create() { username_bans = ([ ]); restore(); } void ban_username(string username) { ACCESS_CHECK(GAME()); if (username == "admin") { error("Cannot ban admin"); } if (username_bans[username]) { error("Username already banned"); } username_bans[username] = 1; save(); } void unban_username(string username) { ACCESS_CHECK(GAME()); if (!username_bans[username]) { error("Username not banned"); } username_bans[username] = nil; save(); } int query_is_banned(string username) { return !!username_bans[username]; } private void save() { save_object("band.o"); } private void restore() { restore_object("band.o"); }
/* keeps track of bans */ mapping username_bans; mapping ip_bans; static void create() { username_bans = ([ ]); } void ban_username(string username) { ACCESS_CHECK(GAME()); if (username_bans[username]) { error("Username already banned"); } username_bans[username] = 1; } void unban_username(string username) { ACCESS_CHECK(GAME()); if (!username_bans[username]) { error("Username not banned"); } username_bans[username] = nil; } int query_is_banned(string username) { return !!username_bans(username); }
--- +++ @@ -1,22 +1,32 @@ +#include <kotaka/privilege.h> + /* keeps track of bans */ mapping username_bans; -mapping ip_bans; + +private void save(); +private void restore(); static void create() { username_bans = ([ ]); + restore(); } void ban_username(string username) { ACCESS_CHECK(GAME()); + if (username == "admin") { + error("Cannot ban admin"); + } + if (username_bans[username]) { error("Username already banned"); } username_bans[username] = 1; + save(); } void unban_username(string username) @@ -28,9 +38,20 @@ } username_bans[username] = nil; + save(); } int query_is_banned(string username) { - return !!username_bans(username); + return !!username_bans[username]; } + +private void save() +{ + save_object("band.o"); +} + +private void restore() +{ + restore_object("band.o"); +}
Allow ban manager to save state
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
406f0cd7f1c4cd3796592305ae9e338d2ea6cdf8
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix(): data_(), rows_(0), cols_(0) {} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): data_(rows*cols), rows_(rows), cols_(cols) {} template<class T> matrix<T>::matrix( std::initializer_list<std::initializer_list<T>> init_list): data_( make_vector(init_list) ), rows_(init_list.size()), cols_( (init_list.size() > 0) ? init_list.begin()->size() : 0 ) {}
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix():data_(),rows_(0),cols_(0){} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): data_(rows*cols),rows_(rows),cols_(cols){} template<class T> matrix<T>::matrix( std::initializer_list<std::initializer_list<T>> init_list): data_( make_vector(init_list) ), rows_(init_list.size()),cols_( init_list.begin()->size() ){} // !!! // // Is "init_list.begin()->size()" ok if init_list = {} ? // // !!!
--- +++ @@ -3,19 +3,20 @@ //----------------------------------------------------------------------------- template<class T> -matrix<T>::matrix():data_(),rows_(0),cols_(0){} +matrix<T>::matrix(): + data_(), + rows_(0), + cols_(0) {} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): - data_(rows*cols),rows_(rows),cols_(cols){} + data_(rows*cols), + rows_(rows), + cols_(cols) {} template<class T> matrix<T>::matrix( std::initializer_list<std::initializer_list<T>> init_list): data_( make_vector(init_list) ), - rows_(init_list.size()),cols_( init_list.begin()->size() ){} - // !!! - // - // Is "init_list.begin()->size()" ok if init_list = {} ? - // - // !!! + rows_(init_list.size()), + cols_( (init_list.size() > 0) ? init_list.begin()->size() : 0 ) {}
Add check for empty matrix in constructor.
mit
actinium/cppMatrix,actinium/cppMatrix
20c2122027dab79bda516c91fe924f23bc938794
#ifndef __ASM_SH_SECTIONS_H #define __ASM_SH_SECTIONS_H #include <asm-generic/sections.h> extern long __nosave_begin, __nosave_end; extern long __machvec_start, __machvec_end; extern char __uncached_start, __uncached_end; extern char _ebss[]; extern char __start_eh_frame[], __stop_eh_frame[]; #endif /* __ASM_SH_SECTIONS_H */
#ifndef __ASM_SH_SECTIONS_H #define __ASM_SH_SECTIONS_H #include <asm-generic/sections.h> extern void __nosave_begin, __nosave_end; extern long __machvec_start, __machvec_end; extern char __uncached_start, __uncached_end; extern char _ebss[]; extern char __start_eh_frame[], __stop_eh_frame[]; #endif /* __ASM_SH_SECTIONS_H */
--- +++ @@ -3,7 +3,7 @@ #include <asm-generic/sections.h> -extern void __nosave_begin, __nosave_end; +extern long __nosave_begin, __nosave_end; extern long __machvec_start, __machvec_end; extern char __uncached_start, __uncached_end; extern char _ebss[];
sh: Change __nosave_XXX symbols to long This patch changes the: - __nosave_begin - __nosave_end symbols from 'void' to 'long' as required by the latest Gcc (4.5.2) which raises the compilation error: cc1: warnings being treated as errors arch/sh/kernel/swsusp.c: In function 'pfn_is_nosave': arch/sh/kernel/swsusp.c:24:28: error: taking address of expression of type 'void' arch/sh/kernel/swsusp.c:25:26: error: taking address of expression of type 'void' arch/sh/kernel/swsusp.c:25:26: error: taking address of expression of type 'void' arch/sh/kernel/swsusp.c:25:26: error: taking address of expression of type 'void' Signed-off-by: Francesco Virlinzi <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
mit
KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
13c12a4e8ecdf3998cd2d89ade69f6f194819c95
#define _MASTERTYPES #include <inttypes.h> //Declarations for master types typedef enum { Register = 0, Coil = 1, DiscreteInput = 2 } MODBUSDataType; //MODBUS data types enum (coil, register, input, etc.) typedef struct { uint8_t Address; //Device address uint8_t Function; //Function called, in which exception occured uint8_t Code; //Exception code } MODBUSException; //Parsed exception data typedef struct { uint8_t Address; //Device address MODBUSDataType DataType; //Data type uint16_t Register; //Register, coil, input ID uint16_t Value; //Value of data } MODBUSData; typedef struct { uint8_t Length; //Length of frame, if it's equal to 0, frame is not ready uint8_t *Frame; //Request frame content } MODBUSRequestStatus; //Type containing information about frame that is set up at master side typedef struct { MODBUSData *Data; //Data read from slave MODBUSException Exception; //Optional exception read MODBUSRequestStatus Request; //Formatted request for slave uint8_t DataLength; //Count of data type instances read from slave uint8_t Error; //Have any error occured? uint8_t Finished; //Is parsing finished? } MODBUSMasterStatus; //Type containing master device configuration data
#define _MASTERTYPES #include <inttypes.h> //Declarations for master types typedef enum { Register = 0, Coil = 1 } MODBUSDataType; //MODBUS data types enum (coil, register, input, etc.) typedef struct { uint8_t Address; //Device address uint8_t Function; //Function called, in which exception occured uint8_t Code; //Exception code } MODBUSException; //Parsed exception data typedef struct { uint8_t Address; //Device address MODBUSDataType DataType; //Data type uint16_t Register; //Register, coil, input ID uint16_t Value; //Value of data } MODBUSData; typedef struct { uint8_t Length; //Length of frame, if it's equal to 0, frame is not ready uint8_t *Frame; //Request frame content } MODBUSRequestStatus; //Type containing information about frame that is set up at master side typedef struct { MODBUSData *Data; //Data read from slave MODBUSException Exception; //Optional exception read MODBUSRequestStatus Request; //Formatted request for slave uint8_t DataLength; //Count of data type instances read from slave uint8_t Error; //Have any error occured? uint8_t Finished; //Is parsing finished? } MODBUSMasterStatus; //Type containing master device configuration data
--- +++ @@ -7,7 +7,8 @@ typedef enum { Register = 0, - Coil = 1 + Coil = 1, + DiscreteInput = 2 } MODBUSDataType; //MODBUS data types enum (coil, register, input, etc.) typedef struct
Add 'DiscreteImput' Modbus data type
mit
Jacajack/modlib
88a704e430bbbc5d6f179a87e84a498b0d0529e1
/* Copyright (C) 2015 George White <[email protected]>, All rights reserved. See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details. */ // ******************* Timing helpers ******************* void startTimer(long &timer) { timer = millis(); } boolean isTimerExpired(long &timer, long expiration) { long current = millis() - timer; return current > expiration; } void clearTimer(long &timer) { timer = 0; }
/* Copyright (C) 2015 George White <[email protected]>, All rights reserved. See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details. */ // ******************* Timing helpers ******************* void startTimer(long &timer) { timer = millis(); } boolean isTimerExpired(long &timer, int expiration) { long current = millis() - timer; return current > expiration; } void clearTimer(long &timer) { timer = 0; }
--- +++ @@ -9,7 +9,7 @@ timer = millis(); } -boolean isTimerExpired(long &timer, int expiration) { +boolean isTimerExpired(long &timer, long expiration) { long current = millis() - timer; return current > expiration; }
Fix bug in timing helper
mit
stonehippo/tankbot,stonehippo/tankbot
9c0c3451a66ad78dad1c9394d38a2a3be2dc89df
/* * LibCassandra * Copyright (C) 2010-2011 Padraig O'Sullivan, Ewen Cheslack-Postava * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. */ #ifndef __LIBCASSANDRA_UTIL_PLATFORM_H #define __LIBCASSANDRA_UTIL_PLATFORM_H #ifdef __GNUC__ // #include_next is broken: it does not search default include paths! #define BOOST_TR1_DISABLE_INCLUDE_NEXT // config_all.hpp reads this variable, then sets BOOST_HAS_INCLUDE_NEXT anyway #include <boost/tr1/detail/config_all.hpp> #ifdef BOOST_HAS_INCLUDE_NEXT // This behavior has existed since boost 1.34, unlikely to change. #undef BOOST_HAS_INCLUDE_NEXT #endif #endif #endif #include <boost/tr1/memory.hpp> #include <boost/tr1/tuple.hpp> #include <boost/tr1/unordered_map.hpp> #include <string> #include <vector> #include <map> #include <set> #endif //__LIBCASSANDRA_UTIL_PLATFORM_H
/* * LibCassandra * Copyright (C) 2010-2011 Padraig O'Sullivan, Ewen Cheslack-Postava * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. */ #ifndef __LIBCASSANDRA_UTIL_PLATFORM_H #define __LIBCASSANDRA_UTIL_PLATFORM_H #include <boost/tr1/memory.hpp> #include <boost/tr1/tuple.hpp> #include <boost/tr1/unordered_map.hpp> #include <string> #include <vector> #include <map> #include <set> #endif //__LIBCASSANDRA_UTIL_PLATFORM_H
--- +++ @@ -10,6 +10,20 @@ #ifndef __LIBCASSANDRA_UTIL_PLATFORM_H #define __LIBCASSANDRA_UTIL_PLATFORM_H +#ifdef __GNUC__ + +// #include_next is broken: it does not search default include paths! +#define BOOST_TR1_DISABLE_INCLUDE_NEXT +// config_all.hpp reads this variable, then sets BOOST_HAS_INCLUDE_NEXT anyway +#include <boost/tr1/detail/config_all.hpp> +#ifdef BOOST_HAS_INCLUDE_NEXT +// This behavior has existed since boost 1.34, unlikely to change. +#undef BOOST_HAS_INCLUDE_NEXT +#endif + +#endif +#endif + #include <boost/tr1/memory.hpp> #include <boost/tr1/tuple.hpp> #include <boost/tr1/unordered_map.hpp>
Disable boost's include_next functionality, fixes compatibility with Sirikata.
bsd-3-clause
xiaozhou/libcassandra,xiaozhou/libcassandra,xiaozhou/libcassandra,xiaozhou/libcassandra
0b7aa15019283753a620c908deea7bab4da1f94d
/* $FreeBSD$ */ /* XXX: Depend on our system headers protecting against multiple includes. */ #include <paths.h> #undef _PATH_FTPUSERS #include <pwd.h> #define _DIAGASSERT(x) #include <sys/_types.h> #ifndef _SIZE_T_DECLARED typedef __size_t size_t; #define _SIZE_T_DECLARED #endif long long strsuftollx(const char *, const char *, long long, long long, char *, size_t); /* * IEEE Std 1003.1c-95, adopted in X/Open CAE Specification Issue 5 Version 2 */ #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 #define LOGIN_NAME_MAX MAXLOGNAME /* max login name length (incl. NUL) */ #endif
/* $FreeBSD$ */ /* XXX: Depend on our system headers protecting against multiple includes. */ #include <paths.h> #undef _PATH_FTPUSERS #include <pwd.h> #define _DIAGASSERT(x) #include <sys/_types.h> #ifndef _SIZE_T_DECLARED typedef __size_t size_t; #define _SIZE_T_DECLARED #endif long long strsuftollx(const char *, const char *, long long, long long, char *, size_t);
--- +++ @@ -15,3 +15,10 @@ #endif long long strsuftollx(const char *, const char *, long long, long long, char *, size_t); + +/* + * IEEE Std 1003.1c-95, adopted in X/Open CAE Specification Issue 5 Version 2 + */ +#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 +#define LOGIN_NAME_MAX MAXLOGNAME /* max login name length (incl. NUL) */ +#endif
Deal with the LOGIN_NAME_MAX issue in the NetBSD->FreeBSD translation^H^H^Hhack layer.
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
507c61e2567c01f86e8bea87a37b173318779fb4
// // SQLiteDatabaseHelper // Include/SQLiteDatabaseHelper.h // #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ #include <SQLiteDatabaseHelper/Operations/Read/DatabaseReader.h> #endif
// // SQLiteDatabaseHelper // Include/SQLiteDatabaseHelper.h // #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ #include <stdio.h> #include <sqlite3.h> #endif
--- +++ @@ -5,8 +5,6 @@ #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ -#include <stdio.h> - -#include <sqlite3.h> +#include <SQLiteDatabaseHelper/Operations/Read/DatabaseReader.h> #endif
Include database reader in main library header Signed-off-by: Gigabyte-Giant <[email protected]>
mit
Gigabyte-Giant/SQLiteDatabaseHelper
03a7507e13b84eb3ddd6fad31832e99825977895
#ifndef PWM_H #define PWM_H extern void PwmInit(uint8_t channel); extern void PwmSetPeriod(uint8_t channel, uint32_t frequency); extern void PwmSetDuty(uint8_t channel, uint8_t duty); typedef struct { uint32_t frequency; uint8_t duty; } PwmOutput; #endif //PWM_H
#ifndef PWM_H #define PWM_H void PwmInit(uint8_t channel); void PwmSetPeriod(uint8_t channel, uint32_t frequency); void PwmSetDuty(uint8_t channel, uint8_t duty); typedef struct { uint32_t frequency; uint8_t duty; } PwmOutput; #endif //PWM_H
--- +++ @@ -1,9 +1,9 @@ #ifndef PWM_H #define PWM_H -void PwmInit(uint8_t channel); -void PwmSetPeriod(uint8_t channel, uint32_t frequency); -void PwmSetDuty(uint8_t channel, uint8_t duty); +extern void PwmInit(uint8_t channel); +extern void PwmSetPeriod(uint8_t channel, uint32_t frequency); +extern void PwmSetDuty(uint8_t channel, uint8_t duty); typedef struct
Update prototypes to make them more compliant.
mit
jotux/LaunchLib,jotux/LaunchLib,jotux/LaunchLib
d655d71e6b85f7f07c738dbb1a22d6c29bb0bdbf
// Copyright 2019 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 // // https://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 IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_ #define IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_ #include "mlir/IR/Module.h" #include "mlir/Pass/Pass.h" namespace mlir { namespace iree_compiler { namespace IREE { std::unique_ptr<OpPassBase<ModuleOp>> createDropCompilerHintsPass(); } // namespace IREE } // namespace iree_compiler } // namespace mlir #endif // IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_
// Copyright 2019 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 // // https://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 IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_ #define IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_ #include "third_party/llvm/llvm-project/mlir//include/mlir/IR/Module.h" #include "third_party/llvm/llvm-project/mlir//include/mlir/Pass/Pass.h" namespace mlir { namespace iree_compiler { namespace IREE { std::unique_ptr<OpPassBase<ModuleOp>> createDropCompilerHintsPass(); } // namespace IREE } // namespace iree_compiler } // namespace mlir #endif // IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_
--- +++ @@ -15,8 +15,8 @@ #ifndef IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_ #define IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_ -#include "third_party/llvm/llvm-project/mlir//include/mlir/IR/Module.h" -#include "third_party/llvm/llvm-project/mlir//include/mlir/Pass/Pass.h" +#include "mlir/IR/Module.h" +#include "mlir/Pass/Pass.h" namespace mlir { namespace iree_compiler {
Fix include path typo from merge conflicts PiperOrigin-RevId: 287685318
apache-2.0
google/iree,iree-org/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,iree-org/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,iree-org/iree
1843a02b1359aa796a71c45da5f3f07615ae0f9a
/** * @file debug_msg.c Debug Message function */ /* $Id$ */ #include "gangliaconf.h" int debug_level = 0; /** * @fn void debug_msg(const char *format, ...) * Prints the message to STDERR if DEBUG is #defined * @param format The format of the msg (see printf manpage) * @param ... Optional arguments */ void debug_msg(const char *format, ...) { if (debug_level > 1 && format) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); fprintf(stderr,"\n"); va_end(ap); } return; }
/** * @file debug_msg.c Debug Message function */ /* $Id$ */ #include "gangliaconf.h" int debug_level = 0; /** * @fn void debug_msg(const char *format, ...) * Prints the message to STDERR if DEBUG is #defined * @param format The format of the msg (see printf manpage) * @param ... Optional arguments */ void debug_msg(const char *format, ...) { if (debug_level && format) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); fprintf(stderr,"\n"); va_end(ap); } return; }
--- +++ @@ -15,7 +15,7 @@ void debug_msg(const char *format, ...) { - if (debug_level && format) + if (debug_level > 1 && format) { va_list ap; va_start(ap, format);
Debug level 1 now only shows error messages (and no backgrounding in gmetad).
bsd-3-clause
phreakocious/monitor-core,phreakocious/monitor-core,mjzhou/monitor-core,lawrencewu/monitor-core,dmourati/monitor-core,phreakocious/monitor-core,fastly/monitor-core,fastly/monitor-core,lawrencewu/monitor-core,ganglia/monitor-core,torkelsson/monitor-core,phreakocious/monitor-core,ganglia/monitor-core,fastly/monitor-core,dmourati/monitor-core,fastly/monitor-core,hinesmr/monitor-core,dmourati/monitor-core,NoodlesNZ/monitor-core,hinesmr/monitor-core,sdgdsffdsfff/monitor-core,torkelsson/monitor-core,NoodlesNZ/monitor-core,torkelsson/monitor-core,mjzhou/monitor-core,lawrencewu/monitor-core,NoodlesNZ/monitor-core,torkelsson/monitor-core,NoodlesNZ/monitor-core,ganglia/monitor-core,phreakocious/monitor-core,hinesmr/monitor-core,torkelsson/monitor-core,NoodlesNZ/monitor-core,phreakocious/monitor-core,sdgdsffdsfff/monitor-core,lawrencewu/monitor-core,mjzhou/monitor-core,hinesmr/monitor-core,sdgdsffdsfff/monitor-core,mjzhou/monitor-core,fastly/monitor-core,mjzhou/monitor-core,torkelsson/monitor-core,ganglia/monitor-core,ganglia/monitor-core,sdgdsffdsfff/monitor-core,ganglia/monitor-core,NoodlesNZ/monitor-core,mjzhou/monitor-core,lawrencewu/monitor-core,ganglia/monitor-core,lawrencewu/monitor-core,sdgdsffdsfff/monitor-core,mjzhou/monitor-core,dmourati/monitor-core,torkelsson/monitor-core,ganglia/monitor-core,sdgdsffdsfff/monitor-core,dmourati/monitor-core,fastly/monitor-core,dmourati/monitor-core,hinesmr/monitor-core,lawrencewu/monitor-core,NoodlesNZ/monitor-core,sdgdsffdsfff/monitor-core,phreakocious/monitor-core,fastly/monitor-core
613d7f23227b5b763e3ebe58442b5edaefe324ba
#ifndef _TESTUTILS_H #define _TESTUTILS_H /* * tslib/tests/testutils.h * * Copyright (C) 2004 Michael Opdenacker <[email protected]> * * This file is placed under the GPL. * * SPDX-License-Identifier: GPL-2.0+ * * * Misc utils for ts test programs */ #define RESET "\033[0m" #define RED "\033[31m" #define GREEN "\033[32m" #define BLUE "\033[34m" #define YELLOW "\033[33m" struct ts_button { int x, y, w, h; char *text; int flags; #define BUTTON_ACTIVE 0x00000001 }; void button_draw(struct ts_button *button); int button_handle(struct ts_button *button, int x, int y, unsigned int pressure); void getxy(struct tsdev *ts, int *x, int *y); void ts_flush (struct tsdev *ts); void print_ascii_logo(void); #endif /* _TESTUTILS_H */
#ifndef _TESTUTILS_H #define _TESTUTILS_H /* * tslib/tests/testutils.h * * Copyright (C) 2004 Michael Opdenacker <[email protected]> * * This file is placed under the LGPL. * * * Misc utils for ts test programs */ #define RESET "\033[0m" #define RED "\033[31m" #define GREEN "\033[32m" #define BLUE "\033[34m" #define YELLOW "\033[33m" struct ts_button { int x, y, w, h; char *text; int flags; #define BUTTON_ACTIVE 0x00000001 }; void button_draw(struct ts_button *button); int button_handle(struct ts_button *button, int x, int y, unsigned int pressure); void getxy(struct tsdev *ts, int *x, int *y); void ts_flush (struct tsdev *ts); void print_ascii_logo(void); #endif /* _TESTUTILS_H */
--- +++ @@ -5,7 +5,9 @@ * * Copyright (C) 2004 Michael Opdenacker <[email protected]> * - * This file is placed under the LGPL. + * This file is placed under the GPL. + * + * SPDX-License-Identifier: GPL-2.0+ * * * Misc utils for ts test programs
tests: Fix license statement in header comment and add SPDS identifier This file had been copied around a long time ago, and included a wrong license. All files in the tests directory (except for this small header) are GPL licensed. I actually doubt that the copyright notice is accurate here -.- Signed-off-by: Martin Kepplinger <[email protected]>
lgpl-2.1
kergoth/tslib,kergoth/tslib,kergoth/tslib,kergoth/tslib
b288888c9a5546844c146d8b7161d24ebbd7c7f7
/* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.3 2000/09/08 16:42:12 brun Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class TParticle-; #pragma link C++ class TAttParticle+; #pragma link C++ class TPrimary+; #pragma link C++ class TGenerator+; #pragma link C++ class TDatabasePDG+; #pragma link C++ class TParticlePDG+; #endif
/* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.2 2000/09/06 15:15:18 brun Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class TParticle-; #pragma link C++ class TAttParticle; #pragma link C++ class TPrimary; #pragma link C++ class TGenerator-; #pragma link C++ class TDatabasePDG+; #pragma link C++ class TParticlePDG+; #endif
--- +++ @@ -1,4 +1,4 @@ -/* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.2 2000/09/06 15:15:18 brun Exp $ */ +/* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.3 2000/09/08 16:42:12 brun Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * @@ -15,9 +15,9 @@ #pragma link off all functions; #pragma link C++ class TParticle-; -#pragma link C++ class TAttParticle; -#pragma link C++ class TPrimary; -#pragma link C++ class TGenerator-; +#pragma link C++ class TAttParticle+; +#pragma link C++ class TPrimary+; +#pragma link C++ class TGenerator+; #pragma link C++ class TDatabasePDG+; #pragma link C++ class TParticlePDG+;
Use option + for TAttParticle and TPrimary git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@932 27541ba8-7e3a-0410-8455-c3a389f83636
lgpl-2.1
nilqed/root,agarciamontoro/root,jrtomps/root,vukasinmilosevic/root,abhinavmoudgil95/root,zzxuanyuan/root,buuck/root,perovic/root,Dr15Jones/root,sawenzel/root,olifre/root,ffurano/root5,sawenzel/root,0x0all/ROOT,simonpf/root,agarciamontoro/root,sbinet/cxx-root,esakellari/root,omazapa/root,tc3t/qoot,mhuwiler/rootauto,ffurano/root5,georgtroska/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,omazapa/root-old,krafczyk/root,sawenzel/root,veprbl/root,mattkretz/root,esakellari/root,bbockelm/root,bbockelm/root,ffurano/root5,zzxuanyuan/root-compressor-dummy,vukasinmilosevic/root,strykejern/TTreeReader,gbitzes/root,buuck/root,satyarth934/root,georgtroska/root,zzxuanyuan/root,perovic/root,satyarth934/root,jrtomps/root,evgeny-boger/root,mkret2/root,mattkretz/root,zzxuanyuan/root-compressor-dummy,bbockelm/root,olifre/root,karies/root,evgeny-boger/root,Y--/root,omazapa/root-old,arch1tect0r/root,mattkretz/root,olifre/root,bbockelm/root,sbinet/cxx-root,zzxuanyuan/root-compressor-dummy,mhuwiler/rootauto,davidlt/root,kirbyherm/root-r-tools,gbitzes/root,esakellari/root,dfunke/root,Duraznos/root,abhinavmoudgil95/root,thomaskeck/root,gganis/root,mattkretz/root,bbockelm/root,esakellari/my_root_for_test,simonpf/root,olifre/root,abhinavmoudgil95/root,BerserkerTroll/root,tc3t/qoot,evgeny-boger/root,evgeny-boger/root,bbockelm/root,karies/root,veprbl/root,perovic/root,veprbl/root,bbockelm/root,beniz/root,beniz/root,dfunke/root,mkret2/root,zzxuanyuan/root,mkret2/root,beniz/root,karies/root,kirbyherm/root-r-tools,root-mirror/root,buuck/root,esakellari/my_root_for_test,nilqed/root,georgtroska/root,gganis/root,Duraznos/root,davidlt/root,simonpf/root,nilqed/root,dfunke/root,mhuwiler/rootauto,dfunke/root,mattkretz/root,Dr15Jones/root,vukasinmilosevic/root,gbitzes/root,bbockelm/root,esakellari/my_root_for_test,sirinath/root,omazapa/root,mkret2/root,perovic/root,esakellari/my_root_for_test,jrtomps/root,pspe/root,omazapa/root-old,gganis/root,zzxuanyuan/root-compressor-dummy,mkret2/root,veprbl/root,simonpf/root,dfunke/root,davidlt/root,thomaskeck/root,Y--/root,esakellari/my_root_for_test,tc3t/qoot,thomaskeck/root,lgiommi/root,BerserkerTroll/root,smarinac/root,Y--/root,CristinaCristescu/root,sbinet/cxx-root,omazapa/root,mkret2/root,esakellari/my_root_for_test,evgeny-boger/root,mhuwiler/rootauto,satyarth934/root,pspe/root,abhinavmoudgil95/root,simonpf/root,alexschlueter/cern-root,Y--/root,omazapa/root-old,georgtroska/root,satyarth934/root,alexschlueter/cern-root,CristinaCristescu/root,krafczyk/root,omazapa/root,sirinath/root,sawenzel/root,davidlt/root,abhinavmoudgil95/root,omazapa/root-old,omazapa/root,vukasinmilosevic/root,CristinaCristescu/root,simonpf/root,cxx-hep/root-cern,Dr15Jones/root,jrtomps/root,gbitzes/root,smarinac/root,agarciamontoro/root,root-mirror/root,Dr15Jones/root,cxx-hep/root-cern,lgiommi/root,thomaskeck/root,vukasinmilosevic/root,sirinath/root,mattkretz/root,vukasinmilosevic/root,nilqed/root,nilqed/root,mhuwiler/rootauto,veprbl/root,beniz/root,CristinaCristescu/root,beniz/root,arch1tect0r/root,simonpf/root,olifre/root,buuck/root,agarciamontoro/root,omazapa/root-old,zzxuanyuan/root-compressor-dummy,krafczyk/root,0x0all/ROOT,krafczyk/root,sawenzel/root,smarinac/root,jrtomps/root,jrtomps/root,arch1tect0r/root,mhuwiler/rootauto,veprbl/root,davidlt/root,arch1tect0r/root,olifre/root,karies/root,zzxuanyuan/root,mattkretz/root,0x0all/ROOT,Duraznos/root,mkret2/root,omazapa/root-old,alexschlueter/cern-root,perovic/root,gbitzes/root,lgiommi/root,gbitzes/root,krafczyk/root,perovic/root,BerserkerTroll/root,satyarth934/root,arch1tect0r/root,root-mirror/root,gganis/root,sirinath/root,root-mirror/root,vukasinmilosevic/root,zzxuanyuan/root-compressor-dummy,evgeny-boger/root,davidlt/root,pspe/root,BerserkerTroll/root,Y--/root,vukasinmilosevic/root,veprbl/root,cxx-hep/root-cern,abhinavmoudgil95/root,beniz/root,tc3t/qoot,dfunke/root,zzxuanyuan/root,omazapa/root-old,omazapa/root-old,abhinavmoudgil95/root,nilqed/root,Duraznos/root,mkret2/root,BerserkerTroll/root,krafczyk/root,Duraznos/root,esakellari/my_root_for_test,mkret2/root,strykejern/TTreeReader,evgeny-boger/root,lgiommi/root,root-mirror/root,arch1tect0r/root,mattkretz/root,gganis/root,kirbyherm/root-r-tools,CristinaCristescu/root,gbitzes/root,arch1tect0r/root,beniz/root,ffurano/root5,pspe/root,beniz/root,gbitzes/root,smarinac/root,kirbyherm/root-r-tools,lgiommi/root,Dr15Jones/root,Duraznos/root,gganis/root,agarciamontoro/root,esakellari/my_root_for_test,Duraznos/root,simonpf/root,zzxuanyuan/root,tc3t/qoot,sawenzel/root,davidlt/root,smarinac/root,davidlt/root,nilqed/root,buuck/root,lgiommi/root,sawenzel/root,abhinavmoudgil95/root,pspe/root,gganis/root,karies/root,olifre/root,veprbl/root,Duraznos/root,tc3t/qoot,zzxuanyuan/root-compressor-dummy,sawenzel/root,tc3t/qoot,CristinaCristescu/root,esakellari/root,dfunke/root,arch1tect0r/root,esakellari/my_root_for_test,tc3t/qoot,buuck/root,abhinavmoudgil95/root,bbockelm/root,karies/root,sirinath/root,omazapa/root-old,sirinath/root,zzxuanyuan/root,sbinet/cxx-root,gganis/root,root-mirror/root,strykejern/TTreeReader,krafczyk/root,arch1tect0r/root,perovic/root,simonpf/root,satyarth934/root,thomaskeck/root,kirbyherm/root-r-tools,pspe/root,lgiommi/root,cxx-hep/root-cern,karies/root,dfunke/root,alexschlueter/cern-root,gganis/root,olifre/root,beniz/root,lgiommi/root,zzxuanyuan/root,sbinet/cxx-root,cxx-hep/root-cern,cxx-hep/root-cern,esakellari/root,buuck/root,mattkretz/root,thomaskeck/root,agarciamontoro/root,lgiommi/root,mhuwiler/rootauto,strykejern/TTreeReader,buuck/root,veprbl/root,mhuwiler/rootauto,mkret2/root,strykejern/TTreeReader,zzxuanyuan/root,georgtroska/root,0x0all/ROOT,georgtroska/root,Duraznos/root,vukasinmilosevic/root,Dr15Jones/root,0x0all/ROOT,satyarth934/root,esakellari/root,pspe/root,vukasinmilosevic/root,buuck/root,smarinac/root,CristinaCristescu/root,jrtomps/root,sbinet/cxx-root,0x0all/ROOT,satyarth934/root,perovic/root,davidlt/root,satyarth934/root,lgiommi/root,abhinavmoudgil95/root,bbockelm/root,mattkretz/root,tc3t/qoot,zzxuanyuan/root-compressor-dummy,cxx-hep/root-cern,esakellari/root,alexschlueter/cern-root,karies/root,arch1tect0r/root,evgeny-boger/root,beniz/root,dfunke/root,alexschlueter/cern-root,Y--/root,pspe/root,ffurano/root5,agarciamontoro/root,omazapa/root,omazapa/root,jrtomps/root,Y--/root,agarciamontoro/root,dfunke/root,thomaskeck/root,mkret2/root,pspe/root,olifre/root,BerserkerTroll/root,nilqed/root,smarinac/root,zzxuanyuan/root-compressor-dummy,cxx-hep/root-cern,CristinaCristescu/root,Y--/root,agarciamontoro/root,strykejern/TTreeReader,jrtomps/root,sbinet/cxx-root,perovic/root,root-mirror/root,lgiommi/root,jrtomps/root,strykejern/TTreeReader,zzxuanyuan/root-compressor-dummy,Y--/root,gbitzes/root,0x0all/ROOT,zzxuanyuan/root,sawenzel/root,mhuwiler/rootauto,CristinaCristescu/root,smarinac/root,0x0all/ROOT,mhuwiler/rootauto,ffurano/root5,smarinac/root,omazapa/root,sirinath/root,CristinaCristescu/root,sbinet/cxx-root,root-mirror/root,abhinavmoudgil95/root,evgeny-boger/root,krafczyk/root,evgeny-boger/root,root-mirror/root,mhuwiler/rootauto,smarinac/root,sawenzel/root,Dr15Jones/root,sirinath/root,tc3t/qoot,gganis/root,georgtroska/root,georgtroska/root,satyarth934/root,olifre/root,zzxuanyuan/root,gganis/root,mattkretz/root,sirinath/root,sbinet/cxx-root,perovic/root,sirinath/root,veprbl/root,thomaskeck/root,root-mirror/root,BerserkerTroll/root,gbitzes/root,vukasinmilosevic/root,sbinet/cxx-root,sbinet/cxx-root,nilqed/root,evgeny-boger/root,omazapa/root,esakellari/root,satyarth934/root,Y--/root,krafczyk/root,ffurano/root5,Duraznos/root,beniz/root,karies/root,Duraznos/root,root-mirror/root,omazapa/root-old,BerserkerTroll/root,esakellari/root,dfunke/root,omazapa/root,CristinaCristescu/root,perovic/root,karies/root,nilqed/root,esakellari/root,buuck/root,sirinath/root,nilqed/root,kirbyherm/root-r-tools,kirbyherm/root-r-tools,sawenzel/root,georgtroska/root,agarciamontoro/root,arch1tect0r/root,krafczyk/root,esakellari/my_root_for_test,esakellari/root,davidlt/root,BerserkerTroll/root,georgtroska/root,Y--/root,gbitzes/root,pspe/root,alexschlueter/cern-root,davidlt/root,thomaskeck/root,jrtomps/root,olifre/root,thomaskeck/root,bbockelm/root,krafczyk/root,veprbl/root,BerserkerTroll/root,pspe/root,georgtroska/root,karies/root,simonpf/root,omazapa/root,0x0all/ROOT,buuck/root,agarciamontoro/root,simonpf/root,BerserkerTroll/root
c62a4efe9492d867e281c2c680e0b8c185d9669b
#include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include <limits.h> #include <string.h> #include <ctype.h> #include "_condor_fix_types.h" #include <fcntl.h> #include <errno.h>
#include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include <limits.h> #include <string.h> #include <ctype.h> #include <fcntl.h> #include "_condor_fix_types.h" #include <errno.h>
--- +++ @@ -4,7 +4,7 @@ #include <limits.h> #include <string.h> #include <ctype.h> +#include "_condor_fix_types.h" #include <fcntl.h> -#include "_condor_fix_types.h" #include <errno.h>
Add <fcntl.h> to list of commonly included files.
apache-2.0
htcondor/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,zhangzhehust/htcondor,djw8605/condor,htcondor/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,djw8605/condor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,zhangzhehust/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,htcondor/htcondor,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,zhangzhehust/htcondor,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor
74feaa2154590685a8702b9bab6aa2a4c2e58382
// // RTRNodeState.h // Router // // Created by Nick Tymchenko on 14/09/15. // Copyright (c) 2015 Pixty. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSInteger, RTRNodeState) { RTRNodeStateNotInitialized = 0, RTRNodeStateInactive = 1, RTRNodeStateDeactivating = 2, RTRNodeStateActivating = 3, RTRNodeStateActive = 4 }; static inline BOOL RTRNodeStateIsInitialized(RTRNodeState state) { return state != RTRNodeStateNotInitialized; } static inline BOOL RTRNodeStateIsTransitioning(RTRNodeState state) { return state == RTRNodeStateDeactivating || state == RTRNodeStateActivating; }
// // RTRNodeState.h // Router // // Created by Nick Tymchenko on 14/09/15. // Copyright (c) 2015 Pixty. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSInteger, RTRNodeState) { RTRNodeStateNotInitialized = 0, RTRNodeStateInactive = 1, RTRNodeStateDeactivating = 2, RTRNodeStateActivating = 3, RTRNodeStateActive = 4 };
--- +++ @@ -15,3 +15,12 @@ RTRNodeStateActivating = 3, RTRNodeStateActive = 4 }; + + +static inline BOOL RTRNodeStateIsInitialized(RTRNodeState state) { + return state != RTRNodeStateNotInitialized; +} + +static inline BOOL RTRNodeStateIsTransitioning(RTRNodeState state) { + return state == RTRNodeStateDeactivating || state == RTRNodeStateActivating; +}
Add helper functions for state
mit
joomcode/Lighthouse,pixty/Lighthouse,joomcode/Lighthouse,pixty/Router
bcf3710e675c279e04aa90ef12f97f3b686597c7
#include <stdio.h> #include <string.h> void abertura() { printf("*******************\n"); printf("* Jogo de Forca *\n"); printf("*******************\n\n"); } void chuta() { char chute; printf("Qual letra? "); scanf(" %c", &chute); chutes[tentativas] = chute; tentativas++; } int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; char chutes[26]; int tentativas = 0; abertura(); do { // imprime a palavra secreta for(int i = 0; i < strlen(palavrasecreta); i++) { int achou = 0; // a letra ja foi chutada? for(int j = 0; j < tentativas; j++) { if(chutes[j] == palavrasecreta[i]) { achou = 1; break; } } if(achou) { printf("%c ", palavrasecreta[i]); } else { printf("_ "); } } printf("\n"); chuta(); } while(!acertou && !enforcou); }
#include <stdio.h> #include <string.h> void abertura() { printf("*******************\n"); printf("* Jogo de Forca *\n"); printf("*******************\n\n"); } int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; char chutes[26]; int tentativas = 0; abertura(); do { for(int i = 0; i < strlen(palavrasecreta); i++) { int achou = 0; for(int j = 0; j < tentativas; j++) { if(chutes[j] == palavrasecreta[i]) { achou = 1; break; } } if(achou) { printf("%c ", palavrasecreta[i]); } else { printf("_ "); } } printf("\n"); char chute; printf("Qual letra? "); scanf(" %c", &chute); chutes[tentativas] = chute; tentativas++; } while(!acertou && !enforcou); }
--- +++ @@ -5,6 +5,15 @@ printf("*******************\n"); printf("* Jogo de Forca *\n"); printf("*******************\n\n"); +} + +void chuta() { + char chute; + printf("Qual letra? "); + scanf(" %c", &chute); + + chutes[tentativas] = chute; + tentativas++; } int main() { @@ -22,10 +31,12 @@ do { + // imprime a palavra secreta for(int i = 0; i < strlen(palavrasecreta); i++) { int achou = 0; + // a letra ja foi chutada? for(int j = 0; j < tentativas; j++) { if(chutes[j] == palavrasecreta[i]) { achou = 1; @@ -42,12 +53,7 @@ printf("\n"); - char chute; - printf("Qual letra? "); - scanf(" %c", &chute); - - chutes[tentativas] = chute; - tentativas++; + chuta(); } while(!acertou && !enforcou);
Update files, Alura, Introdução a C - Parte 2, Aula 4.2
mit
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
9e317ee873422d95bee44059585ea107f12d76ab
/* * You can use safely use mpi4py between multiple * Py_Initialize()/Py_Finalize() calls ... * but do not blame me for the memory leaks ;-) * */ #include <mpi.h> #include <Python.h> const char helloworld[] = \ "from mpi4py import MPI \n" "hwmess = 'Hello, World! I am process %d of %d on %s.' \n" "myrank = MPI.COMM_WORLD.Get_rank() \n" "nprocs = MPI.COMM_WORLD.Get_size() \n" "procnm = MPI.Get_processor_name() \n" "print (hwmess % (myrank, nprocs, procnm)) \n" ""; int main(int argc, char *argv[]) { int i,n=5; MPI_Init(&argc, &argv); for (i=0; i<n; i++) { Py_Initialize(); PyRun_SimpleString(helloworld); Py_Finalize(); } MPI_Finalize(); return 0; }
#include <stdio.h> #include <mpi.h> #include <Python.h> const char helloworld[] = \ "from mpi4py import MPI \n" "hwmess = 'Hello, World! I am process %d of %d on %s.' \n" "myrank = MPI.COMM_WORLD.Get_rank() \n" "nprocs = MPI.COMM_WORLD.Get_size() \n" "procnm = MPI.Get_processor_name() \n" "print (hwmess % (myrank, nprocs, procnm)) \n" ""; int main(int argc, char *argv[]) { int ierr, rank, size; ierr = MPI_Init(&argc, &argv); ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); ierr = MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Barrier(MPI_COMM_WORLD); Py_Initialize(); PyRun_SimpleString(helloworld); Py_Finalize(); MPI_Barrier(MPI_COMM_WORLD); if (rank == 0) { printf("\n"); fflush(stdout); fflush(stderr); } MPI_Barrier(MPI_COMM_WORLD); Py_Initialize(); PyRun_SimpleString(helloworld); Py_Finalize(); MPI_Barrier(MPI_COMM_WORLD); ierr = MPI_Finalize(); return 0; }
--- +++ @@ -1,4 +1,10 @@ -#include <stdio.h> +/* + * You can use safely use mpi4py between multiple + * Py_Initialize()/Py_Finalize() calls ... + * but do not blame me for the memory leaks ;-) + * + */ + #include <mpi.h> #include <Python.h> @@ -13,30 +19,17 @@ int main(int argc, char *argv[]) { - int ierr, rank, size; + int i,n=5; - ierr = MPI_Init(&argc, &argv); - ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); - ierr = MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Init(&argc, &argv); - MPI_Barrier(MPI_COMM_WORLD); - Py_Initialize(); - PyRun_SimpleString(helloworld); - Py_Finalize(); - MPI_Barrier(MPI_COMM_WORLD); - - if (rank == 0) { - printf("\n"); - fflush(stdout); - fflush(stderr); + for (i=0; i<n; i++) { + Py_Initialize(); + PyRun_SimpleString(helloworld); + Py_Finalize(); } - MPI_Barrier(MPI_COMM_WORLD); - Py_Initialize(); - PyRun_SimpleString(helloworld); - Py_Finalize(); - MPI_Barrier(MPI_COMM_WORLD); - - ierr = MPI_Finalize(); + MPI_Finalize(); + return 0; }
Update and simplify embedding demo
bsd-2-clause
pressel/mpi4py,pressel/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py,pressel/mpi4py,pressel/mpi4py
ad9cd9bfff8f0b7428c68ba02857a5789d8c3b77
start Go to Layout [ “budget” (budget) ] Set Window Title [ Current Window; New Title: "Budget Planner" ] Set Zoom Level [ 100% ] # #Report version number to Memory Switch Table. Set Field [ MemorySwitch::versionBudget; Reference::version ] # #Show regular menus if Admin logs in only. Show/Hide Text Ruler [ Hide ] If [ Get ( AccountName ) = "Admin" ] Show/Hide Status Area [ Hide ] Install Menu Set [ “[Standard FileMaker Menus]” ] Else Show/Hide Status Area [ Lock; Hide ] Install Menu Set [ “Custom Menu Set 1” ] End If January 30, 平成26 22:13:52 Budget Planner.fp7 - start -1-
start Go to Layout [ “budget” (budget) ] Set Window Title [ Current Window; New Title: "Budget Research" ] Set Zoom Level [ 100% ] # #Report version number to Memory Switch Table. Set Field [ MemorySwitch::versionBudget; Reference::version ] # #Show regular menus if Admin logs in only. Show/Hide Text Ruler [ Hide ] If [ Get ( AccountName ) = "Admin" ] Show/Hide Status Area [ Hide ] Install Menu Set [ “[Standard FileMaker Menus]” ] Else Show/Hide Status Area [ Lock; Hide ] Install Menu Set [ “Custom Menu Set 1” ] End If January 8, 平成26 18:44:18 Budget Research.fp7 - start -1-
--- +++ @@ -1,6 +1,6 @@ start Go to Layout [ “budget” (budget) ] -Set Window Title [ Current Window; New Title: "Budget Research" ] +Set Window Title [ Current Window; New Title: "Budget Planner" ] Set Zoom Level [ 100% ] # @@ -19,4 +19,4 @@ [ Lock; Hide ] Install Menu Set [ “Custom Menu Set 1” ] End If -January 8, 平成26 18:44:18 Budget Research.fp7 - start -1- +January 30, 平成26 22:13:52 Budget Planner.fp7 - start -1-
Change solution name to Budget Planner
apache-2.0
HelpGiveThanks/Budget
1da49b17817fdfb4709976c462cc4a9ca943d989
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #ifndef LE_DEBUG_LOGS #ifdef DEBUG #define LE_DEBUG_LOGS 1 #else #define LE_DEBUG_LOGS 0 #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #define LE_DEBUG_LOGS 1 #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
--- +++ @@ -6,7 +6,13 @@ // Copyright (c) 2013 JLizard. All rights reserved. // -#define LE_DEBUG_LOGS 1 +#ifndef LE_DEBUG_LOGS + #ifdef DEBUG + #define LE_DEBUG_LOGS 1 + #else + #define LE_DEBUG_LOGS 0 + #endif +#endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__)
Allow logging to be configured at compilation time.
mit
smalltownheroes/le_ios,omgapuppy/le_ios,omgapuppy/le_ios,omgapuppy/le_ios,smalltownheroes/le_ios,logentries/le_ios,JohnLemberger/le_ios,KieranOB/le_ios,smalltownheroes/le_ios
033bfcb84aa88dde9779c789e4aefeb20bb899ed
/* * Copyright (c) 2007, 2008, 2009, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. */ #ifndef DIRENT_H_ #define DIRENT_H_ #include <sys/cdefs.h> // Depending on header include order, this may collide with the definition in // newlib's <dirent.h> See open issue: https://code.systems.ethz.ch/T58#1169 #ifndef NAME_MAX #define NAME_MAX 512 #endif struct dirent { // long d_ino; // off_t d_off; // unsigned short d_reclen; char d_name[NAME_MAX + 1]; }; typedef struct { struct dirent dirent; void *vh; // really a vfs_handle_t } DIR; __BEGIN_DECLS DIR *opendir(const char *pathname); struct dirent *readdir(DIR* dir); int closedir(DIR *dir); __END_DECLS #endif
/* * Copyright (c) 2007, 2008, 2009, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. */ #ifndef DIRENT_H_ #define DIRENT_H_ #include <sys/cdefs.h> #define NAME_MAX 512 struct dirent { // long d_ino; // off_t d_off; // unsigned short d_reclen; char d_name[NAME_MAX + 1]; }; typedef struct { struct dirent dirent; void *vh; // really a vfs_handle_t } DIR; __BEGIN_DECLS DIR *opendir(const char *pathname); struct dirent *readdir(DIR* dir); int closedir(DIR *dir); __END_DECLS #endif
--- +++ @@ -12,7 +12,11 @@ #include <sys/cdefs.h> +// Depending on header include order, this may collide with the definition in +// newlib's <dirent.h> See open issue: https://code.systems.ethz.ch/T58#1169 +#ifndef NAME_MAX #define NAME_MAX 512 +#endif struct dirent { // long d_ino;
Duplicate definition of NAME_MAX macro I broke the build in rBFIaee0075101b1; this is just a temporary band-aid and only masks the more general issue described in T58. If you have an idea for a better fix, please let me know. Signed-off-by: Zaheer Chothia <[email protected]>
mit
BarrelfishOS/barrelfish,BarrelfishOS/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,kishoredbn/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,kishoredbn/barrelfish,8l/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,8l/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,BarrelfishOS/barrelfish
2ab77e34c2e175d90c79dde9b708e3c5beff64de
// 13 september 2016 #include "uipriv_unix.h" struct uiImage { uiUnixControl c; GtkWidget *widget; }; uiUnixControlAllDefaults(uiImage) void uiImageSetSize(uiImage *i, unsigned int width, unsigned int height) { GdkPixbuf *pixbuf; pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(i->widget)); pixbuf = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); gtk_image_set_from_pixbuf(GTK_IMAGE(i->widget), pixbuf); g_object_unref(pixbuf); } void uiImageGetSize(uiImage *i, unsigned int *width, unsigned int *height) { GdkPixbuf *pixbuf; pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(i->widget)); *width = gdk_pixbuf_get_width(pixbuf); *height = gdk_pixbuf_get_height(pixbuf); } uiImage *uiNewImage(const char *filename) { uiImage *img; uiUnixNewControl(uiImage, img); img->widget = gtk_image_new_from_file(filename); return img; }
// 13 september 2016 #include "uipriv_unix.h" struct uiImage { uiUnixControl c; GtkWidget *widget; }; uiUnixControlAllDefaults(uiImage) uiImage *uiNewImage(const char *filename) { uiImage *img; uiUnixNewControl(uiImage, img); img->widget = gtk_image_new_from_file(filename); return img; }
--- +++ @@ -7,6 +7,28 @@ }; uiUnixControlAllDefaults(uiImage) + +void uiImageSetSize(uiImage *i, unsigned int width, unsigned int height) +{ + GdkPixbuf *pixbuf; + + pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(i->widget)); + pixbuf = gdk_pixbuf_scale_simple(pixbuf, + width, + height, + GDK_INTERP_BILINEAR); + gtk_image_set_from_pixbuf(GTK_IMAGE(i->widget), pixbuf); + g_object_unref(pixbuf); +} + +void uiImageGetSize(uiImage *i, unsigned int *width, unsigned int *height) +{ + GdkPixbuf *pixbuf; + + pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(i->widget)); + *width = gdk_pixbuf_get_width(pixbuf); + *height = gdk_pixbuf_get_height(pixbuf); +} uiImage *uiNewImage(const char *filename) {
Implement getting and setting uiImage size in Gtk
mit
sclukey/libui,sclukey/libui
f3d275984b116f79fbb8568e72d1707ef12230c5
/* * kisskiss.h * * Tim "diff" Strazzere <[email protected]> */ #include <stdlib.h> #include <stdio.h> #include <sys/ptrace.h> #include <dirent.h> #include <fcntl.h> // open / O_RDONLY #include <unistd.h> // close #include <errno.h> // perror #include <string.h> // strlen static const char* odex_magic = "dey\n036"; static const char* static_safe_location = "/data/local/tmp/"; static const char* suffix = ".dumped_odex"; typedef struct { uint64_t start; uint64_t end; } memory_region; uint32_t get_clone_pid(uint32_t service_pid); uint32_t get_process_pid(const char* target_package_name); char *determine_filter(uint32_t clone_pid, int memory_fd); int find_magic_memory(uint32_t clone_pid, int memory_fd, memory_region *memory, char* extra_filter); int peek_memory(int memory_file, uint32_t address); int dump_memory(int memory_fd, memory_region *memory, const char* file_name); int attach_get_memory(uint32_t pid);
/* * kisskiss.h * * Tim "diff" Strazzere <[email protected]> */ #include <stdlib.h> #include <stdio.h> #include <sys/ptrace.h> #include <dirent.h> #include <fcntl.h> // open / O_RDONLY static const char* odex_magic = "dey\n036"; static const char* static_safe_location = "/data/local/tmp/"; static const char* suffix = ".dumped_odex"; typedef struct { uint32_t start; uint32_t end; } memory_region; uint32_t get_clone_pid(uint32_t service_pid); uint32_t get_process_pid(const char* target_package_name); char *determine_filter(uint32_t clone_pid, int memory_fd); int find_magic_memory(uint32_t clone_pid, int memory_fd, memory_region *memory, char* extra_filter); int peek_memory(int memory_file, uint32_t address); int dump_memory(int memory_fd, memory_region *memory, const char* file_name); int attach_get_memory(uint32_t pid);
--- +++ @@ -9,14 +9,17 @@ #include <sys/ptrace.h> #include <dirent.h> #include <fcntl.h> // open / O_RDONLY +#include <unistd.h> // close +#include <errno.h> // perror +#include <string.h> // strlen static const char* odex_magic = "dey\n036"; static const char* static_safe_location = "/data/local/tmp/"; static const char* suffix = ".dumped_odex"; typedef struct { - uint32_t start; - uint32_t end; + uint64_t start; + uint64_t end; } memory_region; uint32_t get_clone_pid(uint32_t service_pid);
Reduce implicit calls, add fix for large memory sections
apache-2.0
strazzere/android-unpacker,strazzere/android-unpacker
8323670661ff47298967bca382b360f50f878041
#pragma once #if defined(_MSC_VER) #define DLL_API __declspec(dllexport) #ifndef STDCALL #define STDCALL __stdcall #endif #ifndef CDECL #define CDECL __cdecl #endif #else #define DLL_API __attribute__ ((visibility ("default"))) #ifndef STDCALL #define STDCALL __attribute__((stdcall)) #endif #ifndef CDECL #define CDECL __attribute__((cdecl)) #endif #endif #define CS_OUT
#pragma once #if defined(_MSC_VER) #define DLL_API __declspec(dllexport) #define STDCALL __stdcall #define CDECL __cdecl #else #define DLL_API __attribute__ ((visibility ("default"))) #define STDCALL __attribute__((stdcall)) #define CDECL __attribute__((cdecl)) #endif #define CS_OUT
--- +++ @@ -2,12 +2,24 @@ #if defined(_MSC_VER) #define DLL_API __declspec(dllexport) + +#ifndef STDCALL #define STDCALL __stdcall +#endif + +#ifndef CDECL #define CDECL __cdecl +#endif #else #define DLL_API __attribute__ ((visibility ("default"))) + +#ifndef STDCALL #define STDCALL __attribute__((stdcall)) +#endif + +#ifndef CDECL #define CDECL __attribute__((cdecl)) +#endif #endif #define CS_OUT
Check for defines before defining to get rid of some warnings.
mit
xistoso/CppSharp,mohtamohit/CppSharp,zillemarco/CppSharp,inordertotest/CppSharp,xistoso/CppSharp,imazen/CppSharp,mono/CppSharp,imazen/CppSharp,SonyaSa/CppSharp,Samana/CppSharp,xistoso/CppSharp,genuinelucifer/CppSharp,mohtamohit/CppSharp,mono/CppSharp,ktopouzi/CppSharp,inordertotest/CppSharp,Samana/CppSharp,imazen/CppSharp,ktopouzi/CppSharp,txdv/CppSharp,mydogisbox/CppSharp,genuinelucifer/CppSharp,inordertotest/CppSharp,genuinelucifer/CppSharp,u255436/CppSharp,ddobrev/CppSharp,txdv/CppSharp,SonyaSa/CppSharp,u255436/CppSharp,KonajuGames/CppSharp,inordertotest/CppSharp,nalkaro/CppSharp,xistoso/CppSharp,u255436/CppSharp,imazen/CppSharp,nalkaro/CppSharp,u255436/CppSharp,genuinelucifer/CppSharp,KonajuGames/CppSharp,nalkaro/CppSharp,nalkaro/CppSharp,zillemarco/CppSharp,KonajuGames/CppSharp,mono/CppSharp,Samana/CppSharp,SonyaSa/CppSharp,zillemarco/CppSharp,mono/CppSharp,SonyaSa/CppSharp,mohtamohit/CppSharp,Samana/CppSharp,KonajuGames/CppSharp,ddobrev/CppSharp,zillemarco/CppSharp,mydogisbox/CppSharp,mydogisbox/CppSharp,ddobrev/CppSharp,SonyaSa/CppSharp,u255436/CppSharp,mohtamohit/CppSharp,imazen/CppSharp,txdv/CppSharp,ktopouzi/CppSharp,Samana/CppSharp,mydogisbox/CppSharp,xistoso/CppSharp,KonajuGames/CppSharp,mohtamohit/CppSharp,ddobrev/CppSharp,zillemarco/CppSharp,txdv/CppSharp,mono/CppSharp,ktopouzi/CppSharp,genuinelucifer/CppSharp,mydogisbox/CppSharp,inordertotest/CppSharp,nalkaro/CppSharp,txdv/CppSharp,ktopouzi/CppSharp,mono/CppSharp,ddobrev/CppSharp
8c75289033623c366a6949adfabe4cdcf550d4ac
// -*- c-basic-offset: 2 -*- /* * This file is part of the KDE libraries * Copyright (C) 2006 George Staikos <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KJS_UNICODE_H #define KJS_UNICODE_H #include <wtf/Platform.h> #if USE(QT4_UNICODE) #include "qt4/UnicodeQt4.h" #elif USE(ICU_UNICODE) #include <wtf/unicode/icu/UnicodeIcu.h> #else #error "Unknown Unicode implementation" #endif #endif // vim: ts=2 sw=2 et
// -*- c-basic-offset: 2 -*- /* * This file is part of the KDE libraries * Copyright (C) 2006 George Staikos <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KJS_UNICODE_H #define KJS_UNICODE_H #include <wtf/Platform.h> #if USE(QT4_UNICODE) #include "qt4/UnicodeQt4.h" #elif USE(ICU_UNICODE) #include <wtf/icu/UnicodeIcu.h> #else #error "Unknown Unicode implementation" #endif #endif // vim: ts=2 sw=2 et
--- +++ @@ -28,7 +28,7 @@ #if USE(QT4_UNICODE) #include "qt4/UnicodeQt4.h" #elif USE(ICU_UNICODE) -#include <wtf/icu/UnicodeIcu.h> +#include <wtf/unicode/icu/UnicodeIcu.h> #else #error "Unknown Unicode implementation" #endif
Fix mac bustage (more still). git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@18103 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bsd-3-clause
primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs
106f354f1fe8dc196665df581ea7b4e986b70ca6
// Copyright 2014 Tanel Lebedev #ifndef SRC_EXPLICIT_SCOPED_LOCK_H_ #define SRC_EXPLICIT_SCOPED_LOCK_H_ #include <string> #include <sstream> #include "Poco/Logger.h" namespace kopsik { class ExplicitScopedLock : public Poco::Mutex::ScopedLock { public: ExplicitScopedLock( const std::string context, Poco::Mutex& mutex) : Poco::Mutex::ScopedLock(mutex), context_(context) { std::stringstream text; text << context_ << " locking"; logger().trace(text.str()); } ~ExplicitScopedLock() { std::stringstream text; text << context_ << " unlocking"; logger().trace(text.str()); } private: Poco::Logger &logger() { return Poco::Logger::get("lock"); } std::string context_; }; } // namespace kopsik #endif // SRC_EXPLICIT_SCOPED_LOCK_H_
// Copyright 2014 Tanel Lebedev #ifndef SRC_EXPLICIT_SCOPED_LOCK_H_ #define SRC_EXPLICIT_SCOPED_LOCK_H_ #include <string> #include <sstream> #include "Poco/Logger.h" namespace kopsik { class ExplicitScopedLock : public Poco::Mutex::ScopedLock { public: ExplicitScopedLock( const std::string context, Poco::Mutex& mutex) : Poco::Mutex::ScopedLock(mutex), context_(context) { std::stringstream text; text << context_ << " locking"; logger().debug(text.str()); } ~ExplicitScopedLock() { std::stringstream text; text << context_ << " unlocking"; logger().debug(text.str()); } private: Poco::Logger &logger() { return Poco::Logger::get("lock"); } std::string context_; }; } // namespace kopsik #endif // SRC_EXPLICIT_SCOPED_LOCK_H_
--- +++ @@ -19,13 +19,13 @@ context_(context) { std::stringstream text; text << context_ << " locking"; - logger().debug(text.str()); + logger().trace(text.str()); } ~ExplicitScopedLock() { std::stringstream text; text << context_ << " unlocking"; - logger().debug(text.str()); + logger().trace(text.str()); } private:
Print out locking/unlocking with trace only
bsd-3-clause
codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop
ac19a88b463c7899f3aeffd283d0a42923449e0e
// Calculates the 45th Fibonacci number with a visual indicator. // Note: using yield() in fib() may allow the spinner to actually spin, but // fib() takes a lot longer to complete. E.g. Over 2 minutes with yield() // vs. 10 seconds without it. #include <stdio.h> #include <assert.h> #include <libdill.h> // Calculates Fibonacci of x. static int fib(int x) { // Need to yield or spinner will not have any time to spin. int rc = yield(); assert(rc == 0); if (x < 2) return x; return fib(x - 1) + fib(x - 2); } coroutine void spinner(int delay) { const char spinChars[] = {'-', '\\', '|', '/'}; while (1) { for (int i = 0; i < sizeof(spinChars); i++) { printf("\r%c", spinChars[i]); msleep(now() + delay); } } } int main() { // Turn off buffering on stdout otherwise we won't see the spinner. setbuf(stdout, NULL); int rc = go(spinner(500)); assert(rc != -1); const int n = 45; int fibN = fib(n); printf("\rFibonacci(%d) = %d\n", n, fibN); }
// Calculates the 45th Fibonacci number with a visual indicator. #include <stdio.h> #include <assert.h> #include <libdill.h> // Calculates Fibonacci of x. static int fib(int x) { // Need to yield or spinner will not have any time to spin. int rc = yield(); assert(rc == 0); if (x < 2) return x; return fib(x - 1) + fib(x - 2); } coroutine void spinner(int delay) { const char spinChars[] = {'-', '\\', '|', '/'}; while (1) { for (int i = 0; i < sizeof(spinChars); i++) { printf("\r%c", spinChars[i]); msleep(now() + delay); } } } int main() { // Turn off buffering on stdout otherwise we won't see the spinner. setbuf(stdout, NULL); int rc = go(spinner(100)); assert(rc != -1); const int n = 45; int fibN = fib(n); printf("\rFibonacci(%d) = %d\n", n, fibN); }
--- +++ @@ -1,4 +1,7 @@ // Calculates the 45th Fibonacci number with a visual indicator. +// Note: using yield() in fib() may allow the spinner to actually spin, but +// fib() takes a lot longer to complete. E.g. Over 2 minutes with yield() +// vs. 10 seconds without it. #include <stdio.h> #include <assert.h> #include <libdill.h> @@ -30,7 +33,7 @@ // Turn off buffering on stdout otherwise we won't see the spinner. setbuf(stdout, NULL); - int rc = go(spinner(100)); + int rc = go(spinner(500)); assert(rc != -1); const int n = 45;
Add note about using yield().
mit
jppunnett/libdill-tutorial
0b4900a73fb6206ad82511b2054843baec172618
#ifndef CONTROL_LOOP_INL_H #define CONTROL_LOOP_INL_H #include "board.h" #include "bitband.h" namespace hardware { inline bool ControlLoop::hw_button_enabled() const { return MEM_ADDR(BITBAND(reinterpret_cast<uint32_t>(&(GPIOF->IDR)), GPIOF_HW_SWITCH_PIN)); } } #endif
#ifndef CONTROL_LOOP_INL_H #define CONTROL_LOOP_INL_H #include "board.h" #include "bitband.h" namespace hardware { inline bool ControlLoop::hw_button_enabled() { return MEM_ADDR(BITBAND(reinterpret_cast<uint32_t>(&(GPIOF->IDR)), GPIOF_HW_SWITCH_PIN)); } } #endif
--- +++ @@ -7,7 +7,7 @@ namespace hardware { inline -bool ControlLoop::hw_button_enabled() +bool ControlLoop::hw_button_enabled() const { return MEM_ADDR(BITBAND(reinterpret_cast<uint32_t>(&(GPIOF->IDR)), GPIOF_HW_SWITCH_PIN));
Add const to hw_button_enabled() definition.
bsd-2-clause
hazelnusse/robot.bicycle,hazelnusse/robot.bicycle,hazelnusse/robot.bicycle,hazelnusse/robot.bicycle,hazelnusse/robot.bicycle
032e91ad8a436a424a8364f70f5fea0ab5f6d23d
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_MMAN_H #define MINLIBC_MMAN_H #include <sys/types.h> #define PROT_NONE 0x0 #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define PROT_EXEC 0x4 #define PROT_NOCACHE 0x8 #define PROT_READWRITE (PROT_READ | PROT_WRITE) #define MAP_SHARED 0x01 #define MAP_PRIVATE 0x02 #define MAP_FIXED 0x10 #define MAP_ANON 0x20 #define MAP_ANONYMOUS 0x20 #define MAP_FAILED ((void *) -1) #define MS_ASYNC 1 #define MS_INVALIDATE 2 #define MS_SYNC 4 #define MADV_NORMAL 0 #define MADV_RANDOM 1 #define MADV_SEQUENTIAL 2 #define MADV_WILLNEED 3 #define MADV_DONTNEED 4 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t off); int munmap(void *start, size_t length); void *mremap(void *old_address, size_t old_size, size_t new_size, int flags); int mprotect(void *addr, size_t len, int prot); #endif
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_MMAN_H #define MINLIBC_MMAN_H #include <sys/types.h> #define PROT_NONE 0x0 #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define PROT_EXEC 0x4 #define PROT_NOCACHE 0x8 #define PROT_READWRITE (PROT_READ | PROT_WRITE) #define MAP_ANON 0x20 #define MAP_ANONYMOUS 0x20 #define MAP_PRIVATE 0x02 #define MAP_FAILED ((void *) -1) void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t off); int munmap(void *start, size_t length); void *mremap(void *old_address, size_t old_size, size_t new_size, int flags); int mprotect(void *addr, size_t len, int prot); #endif
--- +++ @@ -16,10 +16,22 @@ #define PROT_NOCACHE 0x8 #define PROT_READWRITE (PROT_READ | PROT_WRITE) +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_FIXED 0x10 #define MAP_ANON 0x20 #define MAP_ANONYMOUS 0x20 -#define MAP_PRIVATE 0x02 #define MAP_FAILED ((void *) -1) + +#define MS_ASYNC 1 +#define MS_INVALIDATE 2 +#define MS_SYNC 4 + +#define MADV_NORMAL 0 +#define MADV_RANDOM 1 +#define MADV_SEQUENTIAL 2 +#define MADV_WILLNEED 3 +#define MADV_DONTNEED 4 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t off); int munmap(void *start, size_t length);
Add more flags for mmap() to ignore.
bsd-3-clause
GaloisInc/minlibc,GaloisInc/minlibc
f0b45d88d5e1c1737e75cdf4eceda4e5a01461b5
#include "safe-c/safe_memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { if (size == 0) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' and requested zero memory. The pointer should " "be explicitly set to NULL instead.\n", calling_function); exit(EXIT_FAILURE); } void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' requesting %zu bytes of memory, but an error " "occurred allocating this amount of memory. Exiting", calling_function, size); exit(EXIT_FAILURE); } memory = memset(memory, 0, size); return memory; } void safe_free_function(void** pointer) { if (pointer != NULL) { free(*pointer); *pointer = NULL; } }
#include "safe-c/safe_memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { if (size == 0) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' and requested zero memory. The pointer should " "be explicitly set to NULL instead.\n", calling_function); exit(EXIT_FAILURE); } void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' requesting %u bytes of memory, but an error " "occurred allocating this amount of memory. Exiting", calling_function); exit(EXIT_FAILURE); } memset(memory, 0, size); return memory; } void safe_free_function(void** pointer) { if (pointer != NULL) { free(*pointer); *pointer = NULL; } }
--- +++ @@ -19,12 +19,12 @@ if (!memory) { fprintf(stderr, "Error allocating memory: The function %s called " - "'safe_malloc' requesting %u bytes of memory, but an error " + "'safe_malloc' requesting %zu bytes of memory, but an error " "occurred allocating this amount of memory. Exiting", - calling_function); + calling_function, size); exit(EXIT_FAILURE); } - memset(memory, 0, size); + memory = memset(memory, 0, size); return memory; }
Fix: Add value parameter to fprintf in safe_malloc Changed the value type in the `fprintf` from `u` to `zu`, this is because `size` is of type `size_t` and not `unsigned int`. In addation, asign the return value of memset to `memory`.
mit
VanJanssen/safe-c,ErwinJanssen/elegan-c,VanJanssen/elegan-c
5be6eff496407146af24c8e85ae2c560b40eeab8
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_SCOPED_HANDLE_H_ #define BASE_SCOPED_HANDLE_H_ #include <stdio.h> #include "base/basictypes.h" #if defined(OS_WIN) #include "base/scoped_handle_win.h" #endif class ScopedStdioHandle { public: ScopedStdioHandle() : handle_(NULL) { } explicit ScopedStdioHandle(FILE* handle) : handle_(handle) { } ~ScopedStdioHandle() { Close(); } void Close() { if (handle_) { fclose(handle_); handle_ = NULL; } } FILE* get() const { return handle_; } FILE* Take() { FILE* temp = handle_; handle_ = NULL; return temp; } void Set(FILE* newhandle) { Close(); handle_ = newhandle; } private: FILE* handle_; DISALLOW_EVIL_CONSTRUCTORS(ScopedStdioHandle); }; #endif // BASE_SCOPED_HANDLE_H_
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_SCOPED_HANDLE_H_ #define BASE_SCOPED_HANDLE_H_ #include "base/basictypes.h" #if defined(OS_WIN) #include "base/scoped_handle_win.h" #endif class ScopedStdioHandle { public: ScopedStdioHandle() : handle_(NULL) { } explicit ScopedStdioHandle(FILE* handle) : handle_(handle) { } ~ScopedStdioHandle() { Close(); } void Close() { if (handle_) { fclose(handle_); handle_ = NULL; } } FILE* get() const { return handle_; } FILE* Take() { FILE* temp = handle_; handle_ = NULL; return temp; } void Set(FILE* newhandle) { Close(); handle_ = newhandle; } private: FILE* handle_; DISALLOW_EVIL_CONSTRUCTORS(ScopedStdioHandle); }; #endif // BASE_SCOPED_HANDLE_H_
--- +++ @@ -4,6 +4,8 @@ #ifndef BASE_SCOPED_HANDLE_H_ #define BASE_SCOPED_HANDLE_H_ + +#include <stdio.h> #include "base/basictypes.h"
Add stdio to this file becasue we use FILE. It starts failing with FILE, identifier not found, when you remove the include for logging.h, which is included in scoped_handle_win.h Review URL: http://codereview.chromium.org/16461 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@7441 0039d316-1c4b-4281-b951-d872f2087c98
bsd-3-clause
adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,yitian134/chromium
4d2173704ae6884eaab3e9f702fb910bfb84c30d
#ifndef _VJ_DEVICE_INTERFACE_H_ #define _VJ_DEVICE_INTERFACE_H_ //: Base class for simplified interfaces // // Interfaces provide an easier way to access proxy objects from // within user applications. <br> <br> // // Users can simply declare a local interface variable and use it // as a smart_ptr for the proxy // //! NOTE: The init function should be called in the init function of the user //+ application #include <vjConfig.h> class vjDeviceInterface { public: vjDeviceInterface() : mProxyIndex(-1) {;} //: Initialize the object //! ARGS: proxyName - String name of the proxy to connect to void init(string proxyName); //: Return the index of the proxy int getProxyIndex() { return mProxyIndex; } protected: int mProxyIndex; //: The index of the proxy }; #endif
#ifndef _VJ_DEVICE_INTERFACE_H_ #define _VJ_DEVICE_INTERFACE_H_ //: Base class for simplified interfaces // // Interfaces provide an easier way to access proxy objects from // within user applications. <br> <br> // // Users can simply declare a local interface variable and use it // as a smart_ptr for the proxy // //! NOTE: The init function should be called in the init function of the user //+ application #include <mstring.h> class vjDeviceInterface { public: vjDeviceInterface() : mProxyIndex(-1) {;} //: Initialize the object //! ARGS: proxyName - String name of the proxy to connect to void init(string proxyName); //: Return the index of the proxy int getProxyIndex() { return mProxyIndex; } protected: int mProxyIndex; //: The index of the proxy }; #endif
--- +++ @@ -12,7 +12,7 @@ //! NOTE: The init function should be called in the init function of the user //+ application -#include <mstring.h> +#include <vjConfig.h> class vjDeviceInterface {
Include vjConfig.h rather than mstring.h to get the basic_string implmentation. git-svn-id: 769d22dfa2d22aad706b9a451492fb87c0735f19@596 08b38cba-cd3b-11de-854e-f91c5b6e4272
lgpl-2.1
godbyk/vrjuggler-upstream-old,vancegroup-mirrors/vrjuggler,vancegroup-mirrors/vrjuggler,LiuKeHua/vrjuggler,godbyk/vrjuggler-upstream-old,vancegroup-mirrors/vrjuggler,vrjuggler/vrjuggler,MichaelMcDonnell/vrjuggler,godbyk/vrjuggler-upstream-old,godbyk/vrjuggler-upstream-old,vrjuggler/vrjuggler,MichaelMcDonnell/vrjuggler,vrjuggler/vrjuggler,MichaelMcDonnell/vrjuggler,vancegroup-mirrors/vrjuggler,LiuKeHua/vrjuggler,LiuKeHua/vrjuggler,MichaelMcDonnell/vrjuggler,LiuKeHua/vrjuggler,vrjuggler/vrjuggler,MichaelMcDonnell/vrjuggler,LiuKeHua/vrjuggler,vrjuggler/vrjuggler,godbyk/vrjuggler-upstream-old,MichaelMcDonnell/vrjuggler,godbyk/vrjuggler-upstream-old,vrjuggler/vrjuggler,MichaelMcDonnell/vrjuggler,LiuKeHua/vrjuggler,vancegroup-mirrors/vrjuggler,MichaelMcDonnell/vrjuggler,LiuKeHua/vrjuggler,LiuKeHua/vrjuggler,vancegroup-mirrors/vrjuggler,vrjuggler/vrjuggler,vrjuggler/vrjuggler
ff49a712c4cc188cdd7d0207595d99c89fe985f0
/* * 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 __LIBSEL4MUSLCCAMKES_H__ #define __LIBSEL4MUSLCCAMKES_H__ #include <utils/page.h> #define STDOUT_FD 1 #define STDERR_FD 2 #define FIRST_USER_FD 3 #define FILE_TYPE_CPIO 0 #define FILE_TYPE_SOCKET 1 #define FD_TABLE_SIZE(x) (sizeof(muslcsys_fd_t) * (x)) /* this implementation does not allow users to close STDOUT or STDERR, so they can't be freed */ #define FREE_FD_TABLE_SIZE(x) (sizeof(int) * ((x) - FIRST_USER_FD)) typedef struct muslcsys_fd { int filetype; void *data; } muslcsys_fd_t; int allocate_fd(void); muslcsys_fd_t *get_fd_struct(int fd); #endif
/* * 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) */ #define STDOUT_FD 1 #define STDERR_FD 2 #define FIRST_USER_FD 3 #define FILE_TYPE_CPIO 0 #define FILE_TYPE_SOCKET 1 #define FD_TABLE_SIZE(x) (sizeof(muslcsys_fd_t) * (x)) /* this implementation does not allow users to close STDOUT or STDERR, so they can't be freed */ #define FREE_FD_TABLE_SIZE(x) (sizeof(int) * ((x) - FIRST_USER_FD)) #define PAGE_SIZE_4K 4096 typedef struct muslcsys_fd { int filetype; void *data; } muslcsys_fd_t; int allocate_fd(void); muslcsys_fd_t *get_fd_struct(int fd);
--- +++ @@ -7,6 +7,11 @@ * * @TAG(NICTA_BSD) */ + +#ifndef __LIBSEL4MUSLCCAMKES_H__ +#define __LIBSEL4MUSLCCAMKES_H__ + +#include <utils/page.h> #define STDOUT_FD 1 #define STDERR_FD 2 @@ -19,7 +24,6 @@ /* this implementation does not allow users to close STDOUT or STDERR, so they can't be freed */ #define FREE_FD_TABLE_SIZE(x) (sizeof(int) * ((x) - FIRST_USER_FD)) -#define PAGE_SIZE_4K 4096 typedef struct muslcsys_fd { int filetype; void *data; @@ -28,3 +32,5 @@ int allocate_fd(void); muslcsys_fd_t *get_fd_struct(int fd); + +#endif
Add include guard and retrieve PAGE_SIZE_4K definition from libutils
bsd-2-clause
smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool
b0699787c413baf93974a2b39f89117acfe55780
#ifndef VAST_CONCEPT_PARSEABLE_VAST_KEY_H #define VAST_CONCEPT_PARSEABLE_VAST_KEY_H #include "vast/key.h" #include "vast/concept/parseable/core/choice.h" #include "vast/concept/parseable/core/list.h" #include "vast/concept/parseable/core/operators.h" #include "vast/concept/parseable/core/parser.h" #include "vast/concept/parseable/core/plus.h" #include "vast/concept/parseable/string/char_class.h" namespace vast { struct key_parser : parser<key_parser> { using attribute = key; template <typename Iterator, typename Attribute> bool parse(Iterator& f, Iterator const& l, Attribute& a) const { // FIXME: we currently cannot parse character sequences into containers, // e.g., (alpha | '_') >> +(alnum ...). Until we have enhanced the // framework, we'll just bail out when we find a colon at the beginning. if (f != l && *f == ':') return false; using namespace parsers; static auto p = +(alnum | chr{'_'} | chr{':'}) % '.'; return p.parse(f, l, a); } }; template <> struct parser_registry<key> { using type = key_parser; }; namespace parsers { static auto const key = make_parser<vast::key>(); } // namespace parsers } // namespace vast #endif
#ifndef VAST_CONCEPT_PARSEABLE_VAST_KEY_H #define VAST_CONCEPT_PARSEABLE_VAST_KEY_H #include "vast/key.h" #include "vast/concept/parseable/core/choice.h" #include "vast/concept/parseable/core/list.h" #include "vast/concept/parseable/core/operators.h" #include "vast/concept/parseable/core/parser.h" #include "vast/concept/parseable/core/plus.h" #include "vast/concept/parseable/string/char_class.h" namespace vast { struct key_parser : parser<key_parser> { using attribute = key; template <typename Iterator, typename Attribute> bool parse(Iterator& f, Iterator const& l, Attribute& a) const { using namespace parsers; static auto p = +(alnum | chr{'_'} | chr{':'}) % '.'; return p.parse(f, l, a); } }; template <> struct parser_registry<key> { using type = key_parser; }; namespace parsers { static auto const key = make_parser<vast::key>(); } // namespace parsers } // namespace vast #endif
--- +++ @@ -17,6 +17,11 @@ template <typename Iterator, typename Attribute> bool parse(Iterator& f, Iterator const& l, Attribute& a) const { + // FIXME: we currently cannot parse character sequences into containers, + // e.g., (alpha | '_') >> +(alnum ...). Until we have enhanced the + // framework, we'll just bail out when we find a colon at the beginning. + if (f != l && *f == ':') + return false; using namespace parsers; static auto p = +(alnum | chr{'_'} | chr{':'}) % '.'; return p.parse(f, l, a);
Work around missing parsing functionality
bsd-3-clause
mavam/vast,pmos69/vast,vast-io/vast,vast-io/vast,vast-io/vast,vast-io/vast,pmos69/vast,pmos69/vast,mavam/vast,vast-io/vast,mavam/vast,mavam/vast,pmos69/vast
85da0a68e77dd32bd2f55d33e0d93d63b8805c8e
#include <stdlib.h> #include <stdio.h> #include <glib.h> enum markdown_extensions { EXT_SMART = 0x01, EXT_NOTES = 0x02, EXT_FILTER_HTML = 0x04, EXT_FILTER_STYLES = 0x08 }; enum markdown_formats { HTML_FORMAT, LATEX_FORMAT, GROFF_MM_FORMAT }; GString * markdown_to_g_string(char *text, int extensions, int output_format); char * markdown_to_string(char *text, int extensions, int output_format); /* vim: set ts=4 sw=4 : */
#include <stdlib.h> #include <stdio.h> #include <glib.h> enum markdown_extensions { EXT_SMART = 1, EXT_NOTES = 2, EXT_FILTER_HTML = 3, EXT_FILTER_STYLES = 4 }; enum markdown_formats { HTML_FORMAT, LATEX_FORMAT, GROFF_MM_FORMAT }; GString * markdown_to_g_string(char *text, int extensions, int output_format); char * markdown_to_string(char *text, int extensions, int output_format); /* vim: set ts=4 sw=4 : */
--- +++ @@ -3,10 +3,10 @@ #include <glib.h> enum markdown_extensions { - EXT_SMART = 1, - EXT_NOTES = 2, - EXT_FILTER_HTML = 3, - EXT_FILTER_STYLES = 4 + EXT_SMART = 0x01, + EXT_NOTES = 0x02, + EXT_FILTER_HTML = 0x04, + EXT_FILTER_STYLES = 0x08 }; enum markdown_formats {
Fix extensions flags bit collision. Setting EXT_FILTER_HTML was the same as setting (EXT_SMART | EXT_NOTES); setting EXT_FILTER_STYLES would also set EXT_NOTES. The switch to hex notation is purely to hint that the values are meant to be used as bit flags directly.
mit
sftrabbit/MarkdownParse,sftrabbit/MarkdownParse,sftrabbit/MarkdownParse
2abc9a8a44d9920d20c30eb639596a8726580381
//#define _GNU_SOURCE #include <dlfcn.h> #include <stdio.h> #include <string.h> void *dlopen(const char *filename, int flag) { static void* (*dlopenImpl)(const char *filename, int flag) = 0; if(!dlopenImpl) { dlopenImpl = dlsym(RTLD_NEXT, "dlopen"); } if(strcmp(filename, "2//libcoreclrtraceptprovider.so") == 0) { printf("Skip loading 2//libcoreclrtraceptprovider.so.\n"); return 0; } printf("Calling dlopen(%s).\n", filename); return dlopenImpl(filename, flag); } int main(int argc, char* argv[]) { dlopen("1//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); dlopen("2//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); return 0; }
#include <dlfcn.h> int main(int argc, char* argv[]) { dlopen("1//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); dlopen("2//libcoreclrtraceptprovider.so", RTLD_LAZY); dlopen("2//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); return 0; }
--- +++ @@ -1,9 +1,29 @@ +//#define _GNU_SOURCE #include <dlfcn.h> +#include <stdio.h> +#include <string.h> + +void *dlopen(const char *filename, int flag) +{ + static void* (*dlopenImpl)(const char *filename, int flag) = 0; + if(!dlopenImpl) + { + dlopenImpl = dlsym(RTLD_NEXT, "dlopen"); + } + + if(strcmp(filename, "2//libcoreclrtraceptprovider.so") == 0) + { + printf("Skip loading 2//libcoreclrtraceptprovider.so.\n"); + return 0; + } + + printf("Calling dlopen(%s).\n", filename); + return dlopenImpl(filename, flag); +} int main(int argc, char* argv[]) { dlopen("1//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); - dlopen("2//libcoreclrtraceptprovider.so", RTLD_LAZY); dlopen("2//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); return 0;
Update implementation to hook calls to dlopen.
mit
brianrob/coretests,brianrob/coretests
12521bf43e5415935befb6fc02f3bf8564252ddf
/* * * Copyright 2018 Asylo authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include_next <sys/wait.h> #ifndef ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #include <sys/resource.h> #ifdef __cplusplus extern "C" { #endif #define WNOHANG 1 pid_t wait3(int *wstatus, int options, struct rusage *rusage); #ifdef __cplusplus } // extern "C" #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_
/* * * Copyright 2018 Asylo authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include_next <sys/wait.h> #ifndef ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #ifdef __cplusplus extern "C" { #endif #define WNOHANG 1 pid_t wait3(int *wstatus, int options, struct rusage *rusage); #ifdef __cplusplus } // extern "C" #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_
--- +++ @@ -21,6 +21,8 @@ #ifndef ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ +#include <sys/resource.h> + #ifdef __cplusplus extern "C" { #endif
Include sys/resource.h for struct rusage Used in wait3 signature. PiperOrigin-RevId: 269667008 Change-Id: Ie6e3a9b334861c78722bbae806352216d57ac437
apache-2.0
google/asylo,google/asylo,google/asylo,google/asylo,google/asylo,google/asylo
637ba7dd055c6185c4e428b9328299b3e96de833
// This uses a headermap with this entry: // someheader.h -> Product/someheader.h // RUN: %clang_cc1 -triple x86_64-apple-darwin13 -v -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H // RUN: %clang_cc1 -triple x86_64-apple-darwin13 -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H 2> %t.out // RUN: FileCheck %s -input-file %t.out // CHECK: Product/someheader.h // CHECK: system/usr/include/someheader.h // CHECK: system/usr/include/someheader.h #include "someheader.h" #include <someheader.h> #include <someheader.h>
// This uses a headermap with this entry: // someheader.h -> Product/someheader.h // RUN: %clang_cc1 -v -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H // RUN: %clang_cc1 -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H 2> %t.out // RUN: FileCheck %s -input-file %t.out // CHECK: Product/someheader.h // CHECK: system/usr/include/someheader.h // CHECK: system/usr/include/someheader.h #include "someheader.h" #include <someheader.h> #include <someheader.h>
--- +++ @@ -1,8 +1,8 @@ // This uses a headermap with this entry: // someheader.h -> Product/someheader.h -// RUN: %clang_cc1 -v -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H -// RUN: %clang_cc1 -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H 2> %t.out +// RUN: %clang_cc1 -triple x86_64-apple-darwin13 -v -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H +// RUN: %clang_cc1 -triple x86_64-apple-darwin13 -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H 2> %t.out // RUN: FileCheck %s -input-file %t.out // CHECK: Product/someheader.h
[test] Add a triple to the test. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@205073 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
ac0afc8c605ab6039b1a5c25f2b7105f7e5456f5
#include "string.h" #include "stdio.h" #include "stdlib.h" #define DATA_FILE_NAME "nqmq.dat" #define DATA_LINE_MAX_LEN 80 char **cities; char *distances; int main(int argc, char *argv[]) { // Step 1: Read file into cities array and distances adjacency matrix char line[DATA_LINE_MAX_LEN]; FILE *data_file; int num_cities = 0; data_file = fopen(DATA_FILE_NAME, "r"); // The first line will be the number of cities fscanf(data_file, "%d", &num_cities); // Allocate space for the city names cities = malloc(sizeof(char*) * num_cities); // Read in all cities for (int i = 0; i < num_cities; ++i) { fgets(line, DATA_LINE_MAX_LEN, data_file); cities[i] = malloc(strlen(line) * sizeof(char)); strcpy(cities[i], line); } // Clean things up for (int i = 0; i < num_cities; ++i) free(cities[i]); free(cities); return 0; }
#include "string.h" #include "stdio.h" #include "stdlib.h" #define DATA_FILE_NAME "nqmq.dat" #define DATA_LINE_MAX_LEN 80 char **cities; char *distances; int main(int argc, char *argv[]) { // Step 1: Read file into cities array and distances adjacency matrix char line[DATA_LINE_MAX_LEN]; FILE *data_file; data_file = fopen(DATA_FILE_NAME, "r"); // The first line will be the number of cities fgets(line, DATA_LINE_MAX_LEN, data_file); int num_cities = atoi(line); // Allocate space for the city names cities = malloc(sizeof(char*) * num_cities); // Read in all cities for (int i = 0; i < num_cities; ++i) { fgets(line, DATA_LINE_MAX_LEN, data_file); cities[i] = malloc(strlen(line) * sizeof(char)); strcpy(cities[i], line); } // Clean things up for (int i = 0; i < num_cities; ++i) free(cities[i]); free(cities); return 0; }
--- +++ @@ -13,12 +13,12 @@ // Step 1: Read file into cities array and distances adjacency matrix char line[DATA_LINE_MAX_LEN]; FILE *data_file; + int num_cities = 0; data_file = fopen(DATA_FILE_NAME, "r"); // The first line will be the number of cities - fgets(line, DATA_LINE_MAX_LEN, data_file); - int num_cities = atoi(line); + fscanf(data_file, "%d", &num_cities); // Allocate space for the city names cities = malloc(sizeof(char*) * num_cities);
Use fscanf to get the number of cities
mit
EvanPurkhiser/CS-NotQuiteMapquest
4055a7c2fceb6eb2b2e8014b96e70ac6bdc2310c
#pragma once #include <libevm/VMFace.h> #include <evmjit/libevmjit/ExecutionEngine.h> namespace dev { namespace eth { class JitVM: public VMFace { public: virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) override final; private: jit::RuntimeData m_data; jit::ExecutionEngine m_engine; std::unique_ptr<VMFace> m_fallbackVM; ///< VM used in case of input data rejected by JIT }; } }
#pragma once #include <libevm/VMFace.h> #include <evmjit/libevmjit/ExecutionEngine.h> namespace dev { namespace eth { class JitVM: public VMFace { public: virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; private: jit::RuntimeData m_data; jit::ExecutionEngine m_engine; std::unique_ptr<VMFace> m_fallbackVM; ///< VM used in case of input data rejected by JIT }; } }
--- +++ @@ -11,7 +11,7 @@ class JitVM: public VMFace { public: - virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; + virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) override final; private: jit::RuntimeData m_data;
Change the way execution results are collected. Changes handling ExecutionResult by Executive. From now execution results are collected on if a storage for results (ExecutionResult) is provided to an Executiove instance up front. This change allow better output management for calls - VM interface improved.
mit
ethereum/evmjit,ethereum/evmjit,ethereum/evmjit
f72844ae685bc5516a818402115b0df8b3efd016
/** * @file * * @brief Private declarations. * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) */ #ifndef ELEKTRAPRIVATE_H #define ELEKTRAPRIVATE_H #include "kdb.h" struct _ElektraError { int errorNr; const char * msg; }; struct _Elektra { KDB * kdb; KeySet * config; Key * parentKey; }; #endif //ELEKTRAPRIVATE_H
/** * @file * * @brief Private declarations. * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) */ #ifndef ELEKTRAPRIVATE_H #define ELEKTRAPRIVATE_H #include "kdb.h" struct _ElektraError { int errorNr; const char * msg; }; struct _Elektra { KDB * kdb; KeySet * config; Key * parentKey; struct _ElektraError * error; }; #endif //ELEKTRAPRIVATE_H
--- +++ @@ -22,8 +22,6 @@ KDB * kdb; KeySet * config; Key * parentKey; - - struct _ElektraError * error; }; #endif //ELEKTRAPRIVATE_H
Remove error from Elektra struct
bsd-3-clause
mpranj/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,mpranj/libelektra,mpranj/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra
140311ab999dda019075b9f86661ebd51e0a144f
#include <fcntl.h> #include <unistd.h> typedef void (*fnct_ptr)(void); typedef int (*open_t)(const char*,int,...); typedef int (*ftruncate_t)(int,off_t); // Goblint used to crash on this example because the number of supplied arguments for myopen is bigger than // than the expected number of arguments for the library function descriptior of ftruncate. // -- "open" expects 3 arguments, while "ftruncate" expects only 2. int main(){ fnct_ptr ptr; int top, top2, top3; if (top){ ptr = (fnct_ptr) &open; ftruncate_t myftruncate; myftruncate = (ftruncate_t) ptr; myftruncate(0, 100); //NOWARN } else { ptr = (fnct_ptr) &ftruncate; } if (top2) { open_t myopen; myopen = (open_t) ptr; // Warn about possible call to ftruncate with wrong number of arguments myopen("some/path", 0, 0); // WARN } else if(top3) { ftruncate_t myftruncate2; myftruncate2 = (ftruncate_t) ptr; off_t v = 100; // We (currently) only warn about wrong number of args, not wrong type // So no warning is emitted here about possibly calling the vararg function open. myftruncate2(0, v); } else { // Warn about potential calls to open and ftruncate with too few arguments, // and warn that none of the possible targets of the pointer fit as call targets. ptr(); // WARN } return 0; }
#include <fcntl.h> #include <unistd.h> typedef void (*fnct_ptr)(void); typedef int (*open_t)(const char*,int,int); typedef int (*ftruncate_t)(int,off_t); // Goblint used to crash on this example because the number of supplied arguments for myopen is bigger than // than the expected number of arguments for the library function descriptior of ftruncate. // -- "open" expects 3 arguments, while "ftruncate" expects only 2. int main(){ fnct_ptr ptr; int top; if (top){ ptr = &open; } else { ptr = &ftruncate; } if (top) { // Some (nonsensical, but compiling) call to open open_t myopen; myopen = (open_t) ptr; myopen("some/path", O_CREAT, 0); } else { // Some (nonsensical, but compiling) call to ftruncate ftruncate_t myftruncate; myftruncate = (ftruncate_t) ptr; myftruncate(0, 100); } return 0; }
--- +++ @@ -2,7 +2,7 @@ #include <unistd.h> typedef void (*fnct_ptr)(void); -typedef int (*open_t)(const char*,int,int); +typedef int (*open_t)(const char*,int,...); typedef int (*ftruncate_t)(int,off_t); // Goblint used to crash on this example because the number of supplied arguments for myopen is bigger than @@ -10,24 +10,33 @@ // -- "open" expects 3 arguments, while "ftruncate" expects only 2. int main(){ fnct_ptr ptr; - int top; + int top, top2, top3; if (top){ - ptr = &open; + ptr = (fnct_ptr) &open; + ftruncate_t myftruncate; + myftruncate = (ftruncate_t) ptr; + myftruncate(0, 100); //NOWARN } else { - ptr = &ftruncate; + ptr = (fnct_ptr) &ftruncate; } - if (top) { - // Some (nonsensical, but compiling) call to open + if (top2) { open_t myopen; myopen = (open_t) ptr; - myopen("some/path", O_CREAT, 0); + // Warn about possible call to ftruncate with wrong number of arguments + myopen("some/path", 0, 0); // WARN + } else if(top3) { + ftruncate_t myftruncate2; + myftruncate2 = (ftruncate_t) ptr; + off_t v = 100; + // We (currently) only warn about wrong number of args, not wrong type + // So no warning is emitted here about possibly calling the vararg function open. + myftruncate2(0, v); } else { - // Some (nonsensical, but compiling) call to ftruncate - ftruncate_t myftruncate; - myftruncate = (ftruncate_t) ptr; - myftruncate(0, 100); + // Warn about potential calls to open and ftruncate with too few arguments, + // and warn that none of the possible targets of the pointer fit as call targets. + ptr(); // WARN } return 0; }
Add WARN annotations and explanations to test, expand it with one case.
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
778fbd48981675b0a10383efe169e397153e81d6
/* * Copyright (c) 2012 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <[email protected]> */ #ifndef _SLOB_H_ #define _SLOB_H_ #include <stddef.h> /*- * Restrictions * * 1. Heap size limit: Allocation requests bigger than * SLOB_PAGE_BREAK_2ND cannot be serviced. This is due to the * memory block manager not able to guarantee that sequential * allocations of SLOB pages will be contiguous. */ /* * Adjust the number of pages to be statically allocated as needed. If * memory is quickly exhausted, increase the SLOB page count. */ #ifndef SLOB_PAGE_COUNT #define SLOB_PAGE_COUNT 4 #endif /* !SLOB_PAGE_COUNT */ #define SLOB_PAGE_SIZE 0x4000 #define SLOB_PAGE_MASK (~(SLOB_PAGE_SIZE - 1)) #define SLOB_PAGE_BREAK_1ST 0x0100 #define SLOB_PAGE_BREAK_2ND 0x0400 void slob_init(void); void *slob_alloc(size_t); void slob_free(void *); #endif /* _SLOB_H_ */
/* * Copyright (c) 2012 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <[email protected]> */ #ifndef _SLOB_H_ #define _SLOB_H_ #include <stddef.h> /*- * Restrictions * * 1. Allocation requests bigger than SLOB_PAGE_BREAK_2ND cannot be * serviced. This is due to the memory block manager not able to * guarantee that sequential allocations of SLOB pages will be * contiguous. */ /* * Adjust the number of pages to be statically allocated as needed. If * memory is quickly exhausted, increase the SLOB page count. */ #ifndef SLOB_PAGE_COUNT #define SLOB_PAGE_COUNT 4 #endif /* !SLOB_PAGE_COUNT */ #define SLOB_PAGE_SIZE 0x1000 #define SLOB_PAGE_MASK (~(SLOB_PAGE_SIZE - 1)) #define SLOB_PAGE_BREAK_1ST 0x0100 #define SLOB_PAGE_BREAK_2ND 0x0400 void slob_init(void); void *slob_alloc(size_t); void slob_free(void *); #endif /* _SLOB_H_ */
--- +++ @@ -13,10 +13,10 @@ /*- * Restrictions * - * 1. Allocation requests bigger than SLOB_PAGE_BREAK_2ND cannot be - * serviced. This is due to the memory block manager not able to - * guarantee that sequential allocations of SLOB pages will be - * contiguous. + * 1. Heap size limit: Allocation requests bigger than + * SLOB_PAGE_BREAK_2ND cannot be serviced. This is due to the + * memory block manager not able to guarantee that sequential + * allocations of SLOB pages will be contiguous. */ /* @@ -27,7 +27,7 @@ #define SLOB_PAGE_COUNT 4 #endif /* !SLOB_PAGE_COUNT */ -#define SLOB_PAGE_SIZE 0x1000 +#define SLOB_PAGE_SIZE 0x4000 #define SLOB_PAGE_MASK (~(SLOB_PAGE_SIZE - 1)) #define SLOB_PAGE_BREAK_1ST 0x0100
Change hard limit on heap
mit
ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul
4a882fe26dab76ae7b0c89459a5808cfef99055a
#ifndef __ctest__ #define __ctest__ extern void ct_init(const char * module_name); extern void ct_report(const char * test_name, int success); extern void ct_print_stats(void); extern void ct_terminate(void); extern void ct_print_stats_and_terminate(void); #endif
#ifndef __testing__ #define __testing__ extern void ct_init(const char * module_name); extern void ct_report(const char * test_name, int success); extern void ct_terminate(void); #endif
--- +++ @@ -1,10 +1,14 @@ -#ifndef __testing__ -#define __testing__ +#ifndef __ctest__ +#define __ctest__ extern void ct_init(const char * module_name); extern void ct_report(const char * test_name, int success); +extern void ct_print_stats(void); + extern void ct_terminate(void); +extern void ct_print_stats_and_terminate(void); + #endif
Split statistics printing from memory cleanup Created ct_print_stats that outputs stats without freeing memory, and ct_print_stats_and_terminate which does both, along with ct_terminate which only frees memory.
unlicense
Mikko-Finell/ctest
e2e0d27071f3314068b5adf990d54dd978ce966b
#include <caml/mlvalues.h> #include <caml/memory.h> #include <caml/custom.h> #include <caml/callback.h> #include <caml/alloc.h> #include <stdio.h> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <ws2tcpip.h> #else #include <sys/socket.h> #endif CAMLprim value stub_get_SOMAXCONN(value unit){ fprintf(stderr, "SOMAXCONN = %d\n", SOMAXCONN); return (Val_int (SOMAXCONN)); }
#include <caml/mlvalues.h> #include <caml/memory.h> #include <caml/custom.h> #include <caml/callback.h> #include <caml/alloc.h> #include <stdio.h> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <ws2tcpip.h> #else #include <sys/socket.h> #endif CAMLprim value stub_get_SOMAXCONN(){ fprintf(stderr, "SOMAXCONN = %d\n", SOMAXCONN); return (Val_int (SOMAXCONN)); }
--- +++ @@ -14,7 +14,7 @@ #include <sys/socket.h> #endif -CAMLprim value stub_get_SOMAXCONN(){ +CAMLprim value stub_get_SOMAXCONN(value unit){ fprintf(stderr, "SOMAXCONN = %d\n", SOMAXCONN); return (Val_int (SOMAXCONN)); }
Add `value` parameter to SOMAXCONN binding Problem spotted by yallop in https://github.com/moby/vpnkit/commit/8d718125a66fbe746ba17ad3e85b7924ac0ed9a4#commitcomment-21930309 Signed-off-by: David Scott <[email protected]>
apache-2.0
djs55/vpnkit,djs55/vpnkit,djs55/vpnkit
bef527848955070cab42bcc1f42799656e8da0a6
#ifndef LMSENSOR_H #define LMSENSOR_H #include <K3Process> #include <K3ProcIO> #include "sensor.h" /** * * Hans Karlsson **/ class SensorSensor : public Sensor { Q_OBJECT public: SensorSensor(int interval, char tempUnit); ~SensorSensor(); void update(); private: K3ShellProcess ksp; QString extraParams; QMap<QString, QString> sensorMap; #if defined(__FreeBSD__) || defined(Q_OS_NETBSD) QMap<QString, QString> sensorMapBSD; #endif QString sensorResult; private slots: void receivedStdout(K3Process *, char *buffer, int); void processExited(K3Process *); }; #endif // LMSENSOR_H
#ifndef LMSENSOR_H #define LMSENSOR_H #include <K3Process> #include <K3ProcIO> #include "sensor.h" /** * * Hans Karlsson **/ class SensorSensor : public Sensor { Q_OBJECT public: SensorSensor(int interval, char tempUnit); ~SensorSensor(); void update(); private: K3ShellProcess ksp; QString extraParams; QMap<QString, QString> sensorMap; #ifdef __FreeBSD__ QMap<QString, QString> sensorMapBSD; #endif QString sensorResult; private slots: void receivedStdout(K3Process *, char *buffer, int); void processExited(K3Process *); }; #endif // LMSENSOR_H
--- +++ @@ -27,7 +27,7 @@ QString extraParams; QMap<QString, QString> sensorMap; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(Q_OS_NETBSD) QMap<QString, QString> sensorMapBSD; #endif QString sensorResult;
Fix knode superkaramba compilation on NetBSD. Patch by Mark Davies. BUG: 154730 svn path=/trunk/KDE/kdeutils/superkaramba/; revision=753733
lgpl-2.1
KDE/superkaramba,KDE/superkaramba,KDE/superkaramba
0b062eb9d2908410674c2751bbcee5b9df464732
/* * User address space access functions. * * For licencing details see kernel-base/COPYING */ #include <linux/highmem.h> #include <linux/module.h> #include <asm/word-at-a-time.h> #include <linux/sched.h> /* * best effort, GUP based copy_from_user() that is NMI-safe */ unsigned long copy_from_user_nmi(void *to, const void __user *from, unsigned long n) { unsigned long offset, addr = (unsigned long)from; unsigned long size, len = 0; struct page *page; void *map; int ret; if (__range_not_ok(from, n, TASK_SIZE)) return len; do { ret = __get_user_pages_fast(addr, 1, 0, &page); if (!ret) break; offset = addr & (PAGE_SIZE - 1); size = min(PAGE_SIZE - offset, n - len); map = kmap_atomic(page); memcpy(to, map+offset, size); kunmap_atomic(map); put_page(page); len += size; to += size; addr += size; } while (len < n); return len; } EXPORT_SYMBOL_GPL(copy_from_user_nmi);
/* * User address space access functions. * * For licencing details see kernel-base/COPYING */ #include <linux/highmem.h> #include <linux/module.h> #include <asm/word-at-a-time.h> #include <linux/sched.h> /* * best effort, GUP based copy_from_user() that is NMI-safe */ unsigned long copy_from_user_nmi(void *to, const void __user *from, unsigned long n) { unsigned long offset, addr = (unsigned long)from; unsigned long size, len = 0; struct page *page; void *map; int ret; if (__range_not_ok(from, n, TASK_SIZE) == 0) return len; do { ret = __get_user_pages_fast(addr, 1, 0, &page); if (!ret) break; offset = addr & (PAGE_SIZE - 1); size = min(PAGE_SIZE - offset, n - len); map = kmap_atomic(page); memcpy(to, map+offset, size); kunmap_atomic(map); put_page(page); len += size; to += size; addr += size; } while (len < n); return len; } EXPORT_SYMBOL_GPL(copy_from_user_nmi);
--- +++ @@ -22,7 +22,7 @@ void *map; int ret; - if (__range_not_ok(from, n, TASK_SIZE) == 0) + if (__range_not_ok(from, n, TASK_SIZE)) return len; do {
perf/x86: Fix broken LBR fixup code I noticed that the LBR fixups were not working anymore on programs where they used to. I tracked this down to a recent change to copy_from_user_nmi(): db0dc75d640 ("perf/x86: Check user address explicitly in copy_from_user_nmi()") This commit added a call to __range_not_ok() to the copy_from_user_nmi() routine. The problem is that the logic of the test must be reversed. __range_not_ok() returns 0 if the range is VALID. We want to return early from copy_from_user_nmi() if the range is NOT valid. Signed-off-by: Stephane Eranian <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Acked-by: Arun Sharma <[email protected]> Link: 456f892a31581d7b07f7474f53a32b17b8649829@quad Signed-off-by: Ingo Molnar <[email protected]>
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
25f42985825dd93f0593efe454e54c2aa13f7830
#ifndef __GRAPHICS_TB_H__ #define __GRAPHICS_TB_H__ #include <termbox.h> #include "models.h" #include "graphics.h" typedef struct {} graphics_tb_t; // graphics_tb initializes the graphic module. graphics_tb_t *graphics_tb_init(); // graphics_tb_draw draws the given state on the screen. // // We do not use `graphics_tb_t *tg` but `void *context` because this function // is used as a callback and the caller shouldn't have to know about // graphics_tb. This way, this module is pluggable. void graphics_tb_draw(void *context, state_to_draw_t *state); // graphics_tb_quit terminates the graphic module. void graphics_tb_quit(graphics_tb_t *tg); #endif
#ifndef __GRAPHICS_TB_H__ #define __GRAPHICS_TB_H__ #include <termbox.h> #include "models.h" #include "graphics.h" typedef struct {} graphics_tb_t; // graphics_tb initialize the graphic module. graphics_tb_t *graphics_tb_init(); // graphics_tb_draw draws the given state on the screen. void graphics_tb_draw(void *context, state_to_draw_t *state); // graphics_tb_quit terminate the graphic module. void graphics_tb_quit(graphics_tb_t *tg); #endif
--- +++ @@ -8,13 +8,17 @@ typedef struct {} graphics_tb_t; -// graphics_tb initialize the graphic module. +// graphics_tb initializes the graphic module. graphics_tb_t *graphics_tb_init(); // graphics_tb_draw draws the given state on the screen. +// +// We do not use `graphics_tb_t *tg` but `void *context` because this function +// is used as a callback and the caller shouldn't have to know about +// graphics_tb. This way, this module is pluggable. void graphics_tb_draw(void *context, state_to_draw_t *state); -// graphics_tb_quit terminate the graphic module. +// graphics_tb_quit terminates the graphic module. void graphics_tb_quit(graphics_tb_t *tg);
Add an explanation for graphics_*_draw prototype
mit
moverest/bagh-chal,moverest/bagh-chal,moverest/bagh-chal
79ecdd107f7531d36f69d6e7089b4a685a370312
// stdio for file I/O #include <stdio.h> #define HISTORY_SIZE 5 void print_values(float *values, int current_i) { // Print values to stdout, starting from one after newest (oldest) and // circle around to newest int i = current_i; for(i = current_i; i < current_i + HISTORY_SIZE; i++) { fprintf(stdout, "%.1f, ", values[i%HISTORY_SIZE]); } fprintf(stdout, "\n"); } int main(int argc, char *argv[]) { int status = 1; int values_i = 0; float v; float values[HISTORY_SIZE]; // Read floats to values, circle around after filling buffer while(status != EOF) { status = fscanf(stdin, "%f\n", &v); if(status == 1) { values[values_i] = v; values_i = (values_i+1) % HISTORY_SIZE; print_values(values, values_i); //fprintf(stdout, "%f\n", v); } else { fprintf(stdout, "Error reading data (%d)\n", status);\ } } }
// stdio for file I/O #include <stdio.h> int main(int argc, char *argv[]) { int status = 1; float value; while(status != EOF) { status = fscanf(stdin, "%f\n", &value); if(status == 1) fprintf(stdout, "%f\n", value); else fprintf(stdout, "Error reading data (%d)\n", status); } }
--- +++ @@ -1,15 +1,34 @@ // stdio for file I/O #include <stdio.h> +#define HISTORY_SIZE 5 + +void print_values(float *values, int current_i) { + // Print values to stdout, starting from one after newest (oldest) and + // circle around to newest + int i = current_i; + for(i = current_i; i < current_i + HISTORY_SIZE; i++) { + fprintf(stdout, "%.1f, ", values[i%HISTORY_SIZE]); + } + fprintf(stdout, "\n"); +} + int main(int argc, char *argv[]) { int status = 1; - float value; + int values_i = 0; + float v; + float values[HISTORY_SIZE]; + // Read floats to values, circle around after filling buffer while(status != EOF) { - status = fscanf(stdin, "%f\n", &value); - if(status == 1) - fprintf(stdout, "%f\n", value); - else - fprintf(stdout, "Error reading data (%d)\n", status); + status = fscanf(stdin, "%f\n", &v); + if(status == 1) { + values[values_i] = v; + values_i = (values_i+1) % HISTORY_SIZE; + print_values(values, values_i); + //fprintf(stdout, "%f\n", v); + } else { + fprintf(stdout, "Error reading data (%d)\n", status);\ + } } }
Save value history as circular array, print function for debug
bsd-3-clause
seenaburns/stag
27cf500cbbf4672c98f4d31442bfba689cd0d508
#include "siphash.h" #include <stdio.h> int main(void) { uint8_t key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}; uint64_t k0 = *(uint64_t*)(key + 0); uint64_t k1 = *(uint64_t*)(key + 8); uint8_t msg[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e}; uint64_t s = siphash24(k0, k1, msg, sizeof(msg)); printf("SipHash-2-4 test: 0x%016llx (expected 0x%016llx)\n", s, 0xa129ca6149be45e5ull); return 0; }
#include "siphash.h" #include <stdio.h> int main(void) { uint64_t k0 = 0x0706050403020100ull; uint64_t k1 = 0x0f0e0d0c0b0a0908ull; uint8_t msg[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e}; uint64_t s = siphash24(k0, k1, msg, sizeof(msg)); printf("SipHash-2-4 test: 0x%016llx (expected 0x%016llx)\n", s, 0xa129ca6149be45e5ull); return 0; }
--- +++ @@ -4,8 +4,11 @@ int main(void) { - uint64_t k0 = 0x0706050403020100ull; - uint64_t k1 = 0x0f0e0d0c0b0a0908ull; + uint8_t key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}; + + uint64_t k0 = *(uint64_t*)(key + 0); + uint64_t k1 = *(uint64_t*)(key + 8); uint8_t msg[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
Fix test key initialization to be endian-neutral Signed-off-by: Gregory Petrosyan <[email protected]>
mit
flyingmutant/siphash
651603c57e8818a492b59cbaa49f8fc5a27d1566
/** * assert.c * * Copyright (C) 2017 Nickolas Burr <[email protected]> */ #include "assert.h" const Except_T Assert_Failed = { "Assertion failed" }; void (assert)(int e) { assert(e); }
static char rcsid[] = "$Id: H:/drh/idioms/book/RCS/except.doc,v 1.10 1997/02/21 19:43:55 drh Exp $"; #include "assert.h" const Except_T Assert_Failed = { "Assertion failed" }; void (assert)(int e) { assert(e); }
--- +++ @@ -1,6 +1,14 @@ -static char rcsid[] = "$Id: H:/drh/idioms/book/RCS/except.doc,v 1.10 1997/02/21 19:43:55 drh Exp $"; +/** + * assert.c + * + * Copyright (C) 2017 Nickolas Burr <[email protected]> + */ #include "assert.h" -const Except_T Assert_Failed = { "Assertion failed" }; + +const Except_T Assert_Failed = { + "Assertion failed" +}; + void (assert)(int e) { assert(e); }
Update formatting, remove CII vars
mit
nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd
2d18ac2cf8aa2503545d0bd4d3ff883c407ccd99
/* * Copyright (c) 2016, Texas Instruments Incorporated * * 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 __INC_BOARD_H #define __INC_BOARD_H /* Push button switch 2 */ #define SW2_GPIO_PIN 6 /* GPIO22/Pin15 */ #define SW2_GPIO_NAME "GPIO_A2" /* Push button switch 3 */ #define SW3_GPIO_PIN 5 /* GPIO13/Pin4 */ #define SW3_GPIO_NAME "GPIO_A1" /* Push button switch 0: Map to SW2 so zephyr button example works */ #define SW0_GPIO_PIN SW2_GPIO_PIN #define SW0_GPIO_NAME SW2_GPIO_NAME /* Onboard GREEN LED */ #define LED0_GPIO_PIN 3 /*GPIO11/Pin2 */ #define LED0_GPIO_PORT "GPIO_A1" #endif /* __INC_BOARD_H */
/* * Copyright (c) 2016, Texas Instruments Incorporated * * 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 __INC_BOARD_H #define __INC_BOARD_H #endif /* __INC_BOARD_H */
--- +++ @@ -16,4 +16,20 @@ #ifndef __INC_BOARD_H #define __INC_BOARD_H +/* Push button switch 2 */ +#define SW2_GPIO_PIN 6 /* GPIO22/Pin15 */ +#define SW2_GPIO_NAME "GPIO_A2" + +/* Push button switch 3 */ +#define SW3_GPIO_PIN 5 /* GPIO13/Pin4 */ +#define SW3_GPIO_NAME "GPIO_A1" + +/* Push button switch 0: Map to SW2 so zephyr button example works */ +#define SW0_GPIO_PIN SW2_GPIO_PIN +#define SW0_GPIO_NAME SW2_GPIO_NAME + +/* Onboard GREEN LED */ +#define LED0_GPIO_PIN 3 /*GPIO11/Pin2 */ +#define LED0_GPIO_PORT "GPIO_A1" + #endif /* __INC_BOARD_H */
cc3200: Add generic definitions for LEDs and switches Adds generic definitions for GPIO pins for onboard LEDs and switches to enable the basic blinky, button, and disco Zephyr examples for the TI CC3200 LaunchXL. Change-Id: Iac0ed2ad01285f9e84eea1fa7013771ddd8d3a78 Signed-off-by: Gil Pitney <[email protected]>
apache-2.0
zephyrproject-rtos/zephyr,GiulianoFranchetto/zephyr,fractalclone/zephyr-riscv,Vudentz/zephyr,explora26/zephyr,punitvara/zephyr,bboozzoo/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,runchip/zephyr-cc3200,Vudentz/zephyr,GiulianoFranchetto/zephyr,mbolivar/zephyr,explora26/zephyr,sharronliu/zephyr,sharronliu/zephyr,rsalveti/zephyr,mbolivar/zephyr,fbsder/zephyr,sharronliu/zephyr,bboozzoo/zephyr,pklazy/zephyr,ldts/zephyr,runchip/zephyr-cc3200,tidyjiang8/zephyr-doc,pklazy/zephyr,kraj/zephyr,punitvara/zephyr,erwango/zephyr,kraj/zephyr,tidyjiang8/zephyr-doc,fractalclone/zephyr-riscv,bigdinotech/zephyr,holtmann/zephyr,ldts/zephyr,fbsder/zephyr,ldts/zephyr,runchip/zephyr-cc3220,erwango/zephyr,aceofall/zephyr-iotos,zephyrproject-rtos/zephyr,GiulianoFranchetto/zephyr,pklazy/zephyr,sharronliu/zephyr,mbolivar/zephyr,rsalveti/zephyr,punitvara/zephyr,zephyriot/zephyr,finikorg/zephyr,bigdinotech/zephyr,zephyriot/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,rsalveti/zephyr,rsalveti/zephyr,holtmann/zephyr,bboozzoo/zephyr,finikorg/zephyr,runchip/zephyr-cc3220,punitvara/zephyr,finikorg/zephyr,runchip/zephyr-cc3220,bboozzoo/zephyr,galak/zephyr,ldts/zephyr,rsalveti/zephyr,pklazy/zephyr,aceofall/zephyr-iotos,holtmann/zephyr,nashif/zephyr,explora26/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,erwango/zephyr,finikorg/zephyr,kraj/zephyr,finikorg/zephyr,galak/zephyr,runchip/zephyr-cc3200,tidyjiang8/zephyr-doc,runchip/zephyr-cc3220,pklazy/zephyr,kraj/zephyr,GiulianoFranchetto/zephyr,bigdinotech/zephyr,fbsder/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,zephyriot/zephyr,bigdinotech/zephyr,galak/zephyr,aceofall/zephyr-iotos,fractalclone/zephyr-riscv,zephyrproject-rtos/zephyr,erwango/zephyr,runchip/zephyr-cc3200,galak/zephyr,runchip/zephyr-cc3200,nashif/zephyr,runchip/zephyr-cc3220,mbolivar/zephyr,holtmann/zephyr,fbsder/zephyr,Vudentz/zephyr,Vudentz/zephyr,nashif/zephyr,mbolivar/zephyr,tidyjiang8/zephyr-doc,fractalclone/zephyr-riscv,fractalclone/zephyr-riscv,punitvara/zephyr,fbsder/zephyr,zephyriot/zephyr,kraj/zephyr,bboozzoo/zephyr,zephyriot/zephyr,ldts/zephyr,aceofall/zephyr-iotos,sharronliu/zephyr,holtmann/zephyr,erwango/zephyr,bigdinotech/zephyr,explora26/zephyr,tidyjiang8/zephyr-doc
22172bb584a97412e01d77f6cb3eb183aab06d56
extern void print_int(int x); extern void print_string(char c[]); int x; char c; void main(void){ /* check signed-ness of char -> int conversion */ x = -1; c = x; print_string("should get -1\ngot: "); print_int(c); print_string("\n\n"); x = -2147483647; print_string("should get -2147483647\ngot: "); print_int(x); print_string("\n\n"); /* check signed-ness of char -> int conversion */ x = -2147483648; print_string("should get -2147483648\ngot: "); print_int(x); print_string("\n\n"); }
extern void print_int(int x); extern void print_string(char c[]); int x; char c; void main(void){ // check signed-ness of char -> int conversion x = -1; c = x; print_string("should get -1\ngot: "); print_int(c); print_string("\n\n"); x = -2147483647; print_string("should get -2147483647\ngot: "); print_int(x); print_string("\n\n"); // check signed-ness of char -> int conversion x = -2147483648; print_string("should get -2147483648\ngot: "); print_int(x); print_string("\n\n"); }
--- +++ @@ -6,7 +6,7 @@ void main(void){ - // check signed-ness of char -> int conversion + /* check signed-ness of char -> int conversion */ x = -1; c = x; print_string("should get -1\ngot: "); @@ -18,7 +18,7 @@ print_int(x); print_string("\n\n"); - // check signed-ness of char -> int conversion + /* check signed-ness of char -> int conversion */ x = -2147483648; print_string("should get -2147483648\ngot: "); print_int(x);
Edit comments so they align with our C-- spec
unlicense
mgaut72/cmm-examples,mgaut72/cmm-examples
ed02ba882c16165e6d7241e4b59cb9bacd653a4e
#include <stdio.h> #include <stdlib.h> #include "turing.h" #define MAX_PROGRAM_LENGTH 32 #define turing_try(statement) status = statement;\ if (TURING_ERROR == status) {\ return 1;\ } int main() { int status; Turing *turing; status = 0; turing = init_turing(); status = execute_instruction(turing, "0 110\n1 110"); if (TURING_ERROR == status) { fprintf(stderr, "Exiting\n"); return 1; } else if (TURING_HALT) { printf("Program reached halt state!\n"); } free_turing(turing); return 0; }
#include <stdio.h> #include <stdlib.h> #include "turing.h" #define MAX_PROGRAM_LENGTH 32 int main() { int status; Turing *turing; status = 0; turing = init_turing(); status = execute_instruction(turing, "0 110\n1 110"); if (TURING_ERROR == status) { fprintf(stderr, "Exiting\n"); return 1; } else if (TURING_HALT) { printf("Program reached halt state!\n"); } free_turing(turing); return 0; }
--- +++ @@ -4,6 +4,12 @@ #include "turing.h" #define MAX_PROGRAM_LENGTH 32 + +#define turing_try(statement) status = statement;\ + if (TURING_ERROR == status) {\ + return 1;\ + } + int main() { int status;
Add turing_try function for handling errors
mit
mindriot101/turing-machine
28e721fd5907dd7807f35bccc48b177afdc2b2f9
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // Radar 8026855 int test (void *src) { register int w0 asm ("0"); // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* asm ("ldr %0, [%1]": "=r" (w0): "r" (src)); return w0; }
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // Radar 8026855 int test (void *src) { register int w0 asm ("0"); // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* %tmp) asm ("ldr %0, [%1]": "=r" (w0): "r" (src)); return w0; }
--- +++ @@ -3,7 +3,7 @@ int test (void *src) { register int w0 asm ("0"); - // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* %tmp) + // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* asm ("ldr %0, [%1]": "=r" (w0): "r" (src)); return w0; }
Rewrite match line to be friendlier to misc buildbots. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136169 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
0c14190ae46a470fe929a764e1ac8ada2236b330
#include "pebble_os.h" #include "pebble_app.h" #include "pebble_fonts.h" #define MY_UUID { 0xE3, 0x7B, 0xFC, 0xE9, 0x30, 0xD7, 0x4B, 0xC3, 0x96, 0x93, 0x15, 0x0C, 0x35, 0xDC, 0xB8, 0x58 } PBL_APP_INFO(MY_UUID, "Puddle", "Jon Speicher", 0, 1, /* App version */ DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP); Window window; void handle_init(AppContextRef ctx) { window_init(&window, "Puddle Main"); window_stack_push(&window, true /* Animated */); } void pbl_main(void *params) { PebbleAppHandlers handlers = { .init_handler = &handle_init }; app_event_loop(params, &handlers); }
#include "pebble_os.h" #include "pebble_app.h" #include "pebble_fonts.h" #define MY_UUID { 0xE3, 0x7B, 0xFC, 0xE9, 0x30, 0xD7, 0x4B, 0xC3, 0x96, 0x93, 0x15, 0x0C, 0x35, 0xDC, 0xB8, 0x58 } PBL_APP_INFO(MY_UUID, "Template App", "Your Company", 1, 0, /* App version */ DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP); Window window; void handle_init(AppContextRef ctx) { window_init(&window, "Window Name"); window_stack_push(&window, true /* Animated */); } void pbl_main(void *params) { PebbleAppHandlers handlers = { .init_handler = &handle_init }; app_event_loop(params, &handlers); }
--- +++ @@ -5,8 +5,8 @@ #define MY_UUID { 0xE3, 0x7B, 0xFC, 0xE9, 0x30, 0xD7, 0x4B, 0xC3, 0x96, 0x93, 0x15, 0x0C, 0x35, 0xDC, 0xB8, 0x58 } PBL_APP_INFO(MY_UUID, - "Template App", "Your Company", - 1, 0, /* App version */ + "Puddle", "Jon Speicher", + 0, 1, /* App version */ DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP); @@ -15,7 +15,7 @@ void handle_init(AppContextRef ctx) { - window_init(&window, "Window Name"); + window_init(&window, "Puddle Main"); window_stack_push(&window, true /* Animated */); }
Change framework app name, comopany, version, and window debug
mit
jonspeicher/Puddle,jonspeicher/Puddle,jonspeicher/Puddle
e8740f26827c1aed33005aac3862e6e7840ee72d
#include "power.h" void initializePower() { } void updatePower() { } void enterLowPowerMode() { }
#include "power.h" #define SLEEP_MODE_ENABLE_BIT 4 void initializePower() { } void updatePower() { } void enterLowPowerMode() { // When WAIT instruction is executed, go into SLEEP mode OSCCONSET = (1 << SLEEP_MODE_ENABLE_BIT); asm("wait"); // TODO if we wake up, do we resume with the PC right here? there's an RCON // register with bits to indicate if we woke up from sleep. we'll need to // re-run setup, potentially. //C1CONSET / C1CONbits.x }
--- +++ @@ -1,6 +1,4 @@ #include "power.h" - -#define SLEEP_MODE_ENABLE_BIT 4 void initializePower() { } @@ -9,11 +7,4 @@ } void enterLowPowerMode() { - // When WAIT instruction is executed, go into SLEEP mode - OSCCONSET = (1 << SLEEP_MODE_ENABLE_BIT); - asm("wait"); - // TODO if we wake up, do we resume with the PC right here? there's an RCON - // register with bits to indicate if we woke up from sleep. we'll need to - // re-run setup, potentially. - //C1CONSET / C1CONbits.x }
Remove "in progress" sleep mode code for PIC32 for now.
bsd-3-clause
openxc/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware
6bcbbabb47dd982641859a3b98905f5bda671ded
/* resource.h KNode, the KDE newsreader Copyright (c) 1999-2005 the KNode authors. See file AUTHORS for details This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US */ #ifndef RESSOURCE_H #define RESSOURCE_H #ifdef HAVE_CONFIG_H #include <config.h> #endif //========= KNode Version Information ============ #define KNODE_VERSION "0.9.90" //================= StatusBar ==================== #define SB_MAIN 4000005 #define SB_GROUP 4000010 #define SB_FILTER 4000030 //================== Folders ===================== #define FOLD_DRAFTS 200010 #define FOLD_SENT 200020 #define FOLD_OUTB 200030 #endif // RESOURCE_H
/* resource.h KNode, the KDE newsreader Copyright (c) 1999-2005 the KNode authors. See file AUTHORS for details This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US */ #ifndef RESSOURCE_H #define RESSOURCE_H #ifdef HAVE_CONFIG_H #include <config.h> #endif //========= KNode Version Information ============ #define KNODE_VERSION "0.9.50" //================= StatusBar ==================== #define SB_MAIN 4000005 #define SB_GROUP 4000010 #define SB_FILTER 4000030 //================== Folders ===================== #define FOLD_DRAFTS 200010 #define FOLD_SENT 200020 #define FOLD_OUTB 200030 #endif // RESOURCE_H
--- +++ @@ -24,7 +24,7 @@ //========= KNode Version Information ============ -#define KNODE_VERSION "0.9.50" +#define KNODE_VERSION "0.9.90" //================= StatusBar ====================
Increment version number for the upcoming alpha release. svn path=/branches/KDE/3.5/kdepim/; revision=442706
lgpl-2.1
lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi
cd58e2e8514d2f8abd4abbeb2003722adc10c883
#include "syshead.h" #include "tcp_socket.h" #define MAX_TCP_SOCKETS 128 static int cur_fd = 3; static struct tcp_socket tcp_sockets[MAX_TCP_SOCKETS]; void init_tcp_sockets() { memset(tcp_sockets, 0, sizeof(struct tcp_socket) * MAX_TCP_SOCKETS); } struct tcp_socket *alloc_tcp_socket() { struct tcp_socket *sock; for (int i = 0; i<MAX_TCP_SOCKETS; i++) { sock = &tcp_sockets[i]; if (sock->fd == 0) { sock->fd = cur_fd++; sock->state = CLOSED; return sock; } } /* No space left, error case */ return NULL; } void free_tcp_socket(struct tcp_socket *sock) { } struct tcp_socket *get_tcp_socket(int sockfd) { struct tcp_socket *sk; for (int i = 0; i<MAX_TCP_SOCKETS; i++) { sk = &tcp_sockets[i]; if (sk->fd == sockfd) return sk; } return NULL; }
#include "syshead.h" #include "tcp_socket.h" #define MAX_TCP_SOCKETS 128 static int cur_fd = 3; static struct tcp_socket tcp_sockets[MAX_TCP_SOCKETS]; void init_tcp_sockets() { memset(tcp_sockets, 0, sizeof(struct tcp_socket) * MAX_TCP_SOCKETS); } struct tcp_socket *alloc_tcp_socket() { struct tcp_socket *sock; for (int i = 0; i<MAX_TCP_SOCKETS; i++) { sock = &tcp_sockets[i]; if (sock->fd == 0) { sock->fd = cur_fd++; sock->state = CLOSED; return sock; } } /* No space left, error case */ return NULL; } void free_tcp_socket(struct tcp_socket *sock) { } struct tcp_socket *get_tcp_socket(int sockfd) { struct tcp_socket sk; for (int i = 0; i<MAX_TCP_SOCKETS; i++) { sk = tcp_sockets[i]; if (sk.fd == sockfd) return &sk; } return NULL; }
--- +++ @@ -33,11 +33,11 @@ struct tcp_socket *get_tcp_socket(int sockfd) { - struct tcp_socket sk; + struct tcp_socket *sk; for (int i = 0; i<MAX_TCP_SOCKETS; i++) { - sk = tcp_sockets[i]; + sk = &tcp_sockets[i]; - if (sk.fd == sockfd) return &sk; + if (sk->fd == sockfd) return sk; } return NULL;
Fix ugly pointer return bug
mit
saminiir/level-ip,saminiir/level-ip
35c85704a3e61eaf6e5c55dcf3cd66b09088d09b
#ifndef LOG2_H #define LOG2_H template <typename T> #ifdef __GNUC__ __attribute__((const)) #endif static inline bool IsPowerOfTwo(T x) { return (x & (x - 1)) == 0; } template<typename T> #ifdef __GNUC__ __attribute__((const)) #endif static inline unsigned ilog2(T n) { // returns the first power of two equal to // or greater than n. For example ilog2(1) = 0, ilog2(4) = 2, ilog2(5) = 3 unsigned l = 0; T r = 1; while (r < n) { l++; r *= 2; } return l; } #endif
#ifndef LOG2_H #define LOG2_H template <typename T> #ifdef __GNUC__ __attribute__((const)) #endif static bool IsPowerOfTwo(const T& x) { return (x & (x - 1)) == 0; } template<typename T> #ifdef __GNUC__ __attribute__((const)) #endif static inline unsigned ilog2(T n) { // returns the first power of two equal to // or greater than n. For example ilog2(1) = 0, ilog2(4) = 2, ilog2(5) = 3 unsigned l = 0; T r = 1; while (r < n) { l++; r *= 2; } return l; } #endif
--- +++ @@ -5,7 +5,7 @@ #ifdef __GNUC__ __attribute__((const)) #endif -static bool IsPowerOfTwo(const T& x) +static inline bool IsPowerOfTwo(T x) { return (x & (x - 1)) == 0; }
Work around an optimization bug in IsPowerOfTwo.
mit
Bitblade-org/mgsim,Bitblade-org/mgsim,Bitblade-org/mgsim,Bitblade-org/mgsim
05b970c5ed2b69076f340aa96724237883cff995
#ifndef __SIM_H_ #define __SIM_H_ 1 #define GEO_FLUID 0 #define GEO_WALL 1 #define GEO_INFLOW 2 #define LAT_H 180 #define LAT_W 420 #define BLOCK_SIZE 64 #ifdef USE_FLOATS #define double float #define __dadd_rn __fadd_rn #define __dmul_rn __fmul_rn #else #define float double #define __fadd_rn __dadd_rn #define __fmul_rn __dmul_rn #endif struct Dist { float *fC, *fE, *fW, *fS, *fN, *fSE, *fSW, *fNE, *fNW; }; struct SimState { int *map, *dmap; // macroscopic quantities on the video card float *dvx, *dvy, *drho; // macroscopic quantities in RAM float *vx, *vy, *rho; float *lat[9]; Dist d1, d2; }; void SimInit(struct SimState *state); void SimCleanup(struct SimState *state); void SimUpdate(int iter, struct SimState state); void SimUpdateMap(struct SimState state); #endif /* __SIM_H_ */
#ifndef __SIM_H_ #define __SIM_H_ 1 #define GEO_FLUID 0 #define GEO_WALL 1 #define GEO_INFLOW 2 #define LAT_H 180 #define LAT_W 420 #define BLOCK_SIZE 64 struct Dist { float *fC, *fE, *fW, *fS, *fN, *fSE, *fSW, *fNE, *fNW; }; struct SimState { int *map, *dmap; // macroscopic quantities on the video card float *dvx, *dvy, *drho; // macroscopic quantities in RAM float *vx, *vy, *rho; float *lat[9]; Dist d1, d2; }; void SimInit(struct SimState *state); void SimCleanup(struct SimState *state); void SimUpdate(int iter, struct SimState state); void SimUpdateMap(struct SimState state); #endif /* __SIM_H_ */
--- +++ @@ -8,6 +8,16 @@ #define LAT_H 180 #define LAT_W 420 #define BLOCK_SIZE 64 + +#ifdef USE_FLOATS +#define double float +#define __dadd_rn __fadd_rn +#define __dmul_rn __fmul_rn +#else +#define float double +#define __fadd_rn __dadd_rn +#define __fmul_rn __dmul_rn +#endif struct Dist { float *fC, *fE, *fW, *fS, *fN, *fSE, *fSW, *fNE, *fNW;
Use doubles instead of floats ny default
mit
Dwii/Master-Thesis,Dwii/Master-Thesis,Dwii/Master-Thesis,Dwii/Master-Thesis,Dwii/Master-Thesis,Dwii/Master-Thesis,Dwii/Master-Thesis
ac39ed3a80fd71af70de0222a9dd1545f4d59dea
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* Persistence module for emulator */ #include <unistd.h> #include <stdio.h> #include <string.h> #define BUF_SIZE 1024 static void get_storage_path(char *out) { char buf[BUF_SIZE]; int sz; sz = readlink("/proc/self/exe", buf, BUF_SIZE); buf[sz] = '\0'; if (snprintf(out, BUF_SIZE, "%s_persist", buf) >= BUF_SIZE) out[BUF_SIZE - 1] = '\0'; } FILE *get_persistent_storage(const char *tag, const char *mode) { char buf[BUF_SIZE]; char path[BUF_SIZE]; /* * The persistent storage with tag 'foo' for test 'bar' would * be named 'bar_persist_foo' */ get_storage_path(buf); if (snprintf(path, BUF_SIZE, "%s_%s", buf, tag) >= BUF_SIZE) path[BUF_SIZE - 1] = '\0'; return fopen(path, mode); } void release_persistent_storage(FILE *ps) { fclose(ps); }
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* Persistence module for emulator */ #include <unistd.h> #include <stdio.h> #include <string.h> #define BUF_SIZE 1024 static void get_storage_path(char *out) { char buf[BUF_SIZE]; readlink("/proc/self/exe", buf, BUF_SIZE); if (snprintf(out, BUF_SIZE, "%s_persist", buf) >= BUF_SIZE) out[BUF_SIZE - 1] = '\0'; } FILE *get_persistent_storage(const char *tag, const char *mode) { char buf[BUF_SIZE]; char path[BUF_SIZE]; /* * The persistent storage with tag 'foo' for test 'bar' would * be named 'bar_persist_foo' */ get_storage_path(buf); if (snprintf(path, BUF_SIZE, "%s_%s", buf, tag) >= BUF_SIZE) path[BUF_SIZE - 1] = '\0'; return fopen(path, mode); } void release_persistent_storage(FILE *ps) { fclose(ps); }
--- +++ @@ -14,8 +14,10 @@ static void get_storage_path(char *out) { char buf[BUF_SIZE]; + int sz; - readlink("/proc/self/exe", buf, BUF_SIZE); + sz = readlink("/proc/self/exe", buf, BUF_SIZE); + buf[sz] = '\0'; if (snprintf(out, BUF_SIZE, "%s_persist", buf) >= BUF_SIZE) out[BUF_SIZE - 1] = '\0'; }
Fix a bug in emulator persistent storage The path string is not terminated properly, causing occasional crashes. BUG=chrome-os-partner:19235 TEST=Dump the path and check it's correct. BRANCH=None Change-Id: I9ccbd565ce68ffdad98f2dd90ecf19edf9805ec0 Signed-off-by: Vic Yang <[email protected]> Reviewed-on: https://gerrit.chromium.org/gerrit/56700 Reviewed-by: Vincent Palatin <[email protected]>
bsd-3-clause
longsleep/ec,md5555/ec,longsleep/ec,mtk09422/chromiumos-platform-ec,coreboot/chrome-ec,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,eatbyte/chromium-ec,alterapraxisptyltd/chromium-ec,fourier49/BZ_DEV_EC,coreboot/chrome-ec,fourier49/BZ_DEV_EC,fourier49/BZ_DEV_EC,coreboot/chrome-ec,alterapraxisptyltd/chromium-ec,eatbyte/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics,thehobn/ec,gelraen/cros-ec,gelraen/cros-ec,akappy7/ChromeOS_EC_LED_Diagnostics,thehobn/ec,akappy7/ChromeOS_EC_LED_Diagnostics,mtk09422/chromiumos-platform-ec,gelraen/cros-ec,thehobn/ec,mtk09422/chromiumos-platform-ec,coreboot/chrome-ec,fourier49/BIZ_EC,fourier49/BZ_DEV_EC,eatbyte/chromium-ec,fourier49/BIZ_EC,longsleep/ec,md5555/ec,md5555/ec,fourier49/BIZ_EC,alterapraxisptyltd/chromium-ec,mtk09422/chromiumos-platform-ec,longsleep/ec,alterapraxisptyltd/chromium-ec,thehobn/ec,md5555/ec,eatbyte/chromium-ec,gelraen/cros-ec,fourier49/BIZ_EC,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics
a46d5e7f3700e126c6bc5c31f93a8f297e11074f
/* This file should provide inline versions of string functions. Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. This file should define __STRING_INLINES if functions are actually defined as inlines. */ #ifndef _BITS_STRING_H #define _BITS_STRING_H 1 #define _STRING_ARCH_unaligned 0 #if defined(__GNUC__) && !defined(__cplusplus) static __inline__ unsigned long __libc_detect_null(unsigned long w) { unsigned long mask = 0x7f7f7f7f; if (sizeof(long) == 8) mask = ((mask << 16) << 16) | mask; return ~(((w & mask) + mask) | w | mask); } #endif /* __GNUC__ && !__cplusplus */ #endif /* bits/string.h */
/* This file should provide inline versions of string functions. Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. This file should define __STRING_INLINES if functions are actually defined as inlines. */ #ifndef _BITS_STRING_H #define _BITS_STRING_H 1 #define _STRING_ARCH_unaligned 0 #if defined(__GNUC__) && !defined(__cplusplus) static inline unsigned long __libc_detect_null(unsigned long w) { unsigned long mask = 0x7f7f7f7f; if (sizeof(long) == 8) mask = ((mask << 16) << 16) | mask; return ~(((w & mask) + mask) | w | mask); } #endif /* __GNUC__ && !__cplusplus */ #endif /* bits/string.h */
--- +++ @@ -12,7 +12,7 @@ #if defined(__GNUC__) && !defined(__cplusplus) -static inline unsigned long __libc_detect_null(unsigned long w) +static __inline__ unsigned long __libc_detect_null(unsigned long w) { unsigned long mask = 0x7f7f7f7f; if (sizeof(long) == 8)
Change a "inline" to "__inline__" So "inline" isn't complient C, which means strict packages won't build with it. This uses "__inline__" instead, which is ANSI C. This patch is required to get freetype to build.
lgpl-2.1
manuelafm/riscv-gnu-toolchain,manuelafm/riscv-gnu-toolchain,manuelafm/riscv-gnu-toolchain
28b425c367f9efa9ed03c339788c936f4f5dc399