commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
46058a38137b55bace74a60ff9cdc1418e7ea440
tmpmon_base/config.h
tmpmon_base/config.h
// Global configuration information // // Connection information #define SERIAL_BAUD 115200
// Global configuration information // // Connection information #define SERIAL_BAUD 9600
FIX - Lowered baud rates to 9600
FIX - Lowered baud rates to 9600
C
mit
gauravmm/Remote-Temperature-Monitor,gauravmm/Remote-Temperature-Monitor,gauravmm/Remote-Temperature-Monitor,gauravmm/Remote-Temperature-Monitor
4f16756123d6203bc1ce4977032fb93c632a5a56
src/setjmp/longjmp.c
src/setjmp/longjmp.c
/* libunwind - a platform-independent unwind library Copyright (C) 2003-2004 Hewlett-Packard Co Contributed by David Mosberger-Tang <[email protected]> This file is part of libunwind. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define UNW_LOCAL_ONLY #include <assert.h> #include <libunwind.h> #include <setjmp.h> #include <signal.h> #include <stdlib.h> #include "jmpbuf.h" #include "setjmp_i.h" void _longjmp (jmp_buf env, int val) { extern int _UI_longjmp_cont; unw_context_t uc; unw_cursor_t c; unw_word_t sp; unw_word_t *wp = (unw_word_t *) env; if (unw_getcontext (&uc) < 0 || unw_init_local (&c, &uc) < 0) abort (); do { if (unw_get_reg (&c, UNW_REG_SP, &sp) < 0) abort (); if (sp != wp[JB_SP]) continue; if (!bsp_match (&c, wp)) continue; /* found the right frame: */ assert (UNW_NUM_EH_REGS >= 2); if (unw_set_reg (&c, UNW_REG_EH + 0, wp[JB_RP]) < 0 || unw_set_reg (&c, UNW_REG_EH + 1, val) < 0 || unw_set_reg (&c, UNW_REG_IP, (unw_word_t) &_UI_longjmp_cont)) abort (); unw_resume (&c); abort (); } while (unw_step (&c) >= 0); abort (); } #ifdef __GNUC__ void longjmp (jmp_buf env, int val) __attribute__ ((alias ("_longjmp"))); #else void longjmp (jmp_buf env, int val) { _longjmp (env, val); } #endif
Include "setjmp_i.h". Abstract ia64-specific code into bsp_match() routine. Support any platform with at least 2 EH argument registers.
Include "setjmp_i.h". Abstract ia64-specific code into bsp_match() routine. Support any platform with at least 2 EH argument registers. 2004/12/06 01:33:16-08:00 mostang.com!davidm Rename: src/longjmp.c -> src/setjmp/longjmp.c (Logical change 1.290)
C
mit
bo-on-software/libunwind,geekboxzone/mmallow_external_libunwind,zeldin/platform_external_libunwind,fillexen/libunwind,lat/libunwind,ehsan/libunwind,djwatson/libunwind,rantala/libunwind,bo-on-software/libunwind,fdoray/libunwind,maltek/platform_external_libunwind,tkelman/libunwind,maltek/platform_external_libunwind,project-zerus/libunwind,dagar/libunwind,libunwind/libunwind,project-zerus/libunwind,joyent/libunwind,CyanogenMod/android_external_libunwind,dropbox/libunwind,joyent/libunwind,androidarmv6/android_external_libunwind,geekboxzone/mmallow_external_libunwind,yuyichao/libunwind,pathscale/libunwind,krytarowski/libunwind,tkelman/libunwind,rantala/libunwind,olibc/libunwind,android-ia/platform_external_libunwind,vtjnash/libunwind,dreal-deps/libunwind,dreal-deps/libunwind,adsharma/libunwind,DroidSim/platform_external_libunwind,Keno/libunwind,dagar/libunwind,cms-externals/libunwind,rantala/libunwind,CyanogenMod/android_external_libunwind,unkadoug/libunwind,cms-externals/libunwind,martyone/libunwind,Chilledheart/libunwind,0xlab/0xdroid-external_libunwind,jrmuizel/libunwind,bo-on-software/libunwind,atanasyan/libunwind,Chilledheart/libunwind,atanasyan/libunwind-android,evaautomation/libunwind,djwatson/libunwind,0xlab/0xdroid-external_libunwind,jrmuizel/libunwind,ehsan/libunwind,atanasyan/libunwind,olibc/libunwind,djwatson/libunwind,CyanogenMod/android_external_libunwind,tony/libunwind,project-zerus/libunwind,dropbox/libunwind,android-ia/platform_external_libunwind,libunwind/libunwind,SyndicateRogue/libunwind,zliu2014/libunwind-tilegx,tkelman/libunwind,geekboxzone/lollipop_external_libunwind,unkadoug/libunwind,ehsan/libunwind,mpercy/libunwind,joyent/libunwind,vegard/libunwind,wdv4758h/libunwind,igprof/libunwind,androidarmv6/android_external_libunwind,tronical/libunwind,android-ia/platform_external_libunwind,dropbox/libunwind,unkadoug/libunwind,fdoray/libunwind,fillexen/libunwind,geekboxzone/lollipop_external_libunwind,rntz/libunwind,SyndicateRogue/libunwind,DroidSim/platform_external_libunwind,libunwind/libunwind,cms-externals/libunwind,mpercy/libunwind,vtjnash/libunwind,wdv4758h/libunwind,dreal-deps/libunwind,wdv4758h/libunwind,martyone/libunwind,geekboxzone/mmallow_external_libunwind,geekboxzone/lollipop_external_libunwind,krytarowski/libunwind,adsharma/libunwind,vegard/libunwind,Keno/libunwind,yuyichao/libunwind,SyndicateRogue/libunwind,evaautomation/libunwind,pathscale/libunwind,yuyichao/libunwind,evaautomation/libunwind,tony/libunwind,DroidSim/platform_external_libunwind,tony/libunwind,lat/libunwind,zliu2014/libunwind-tilegx,zeldin/platform_external_libunwind,lat/libunwind,mpercy/libunwind,Chilledheart/libunwind,maltek/platform_external_libunwind,frida/libunwind,tronical/libunwind,igprof/libunwind,fillexen/libunwind,dagar/libunwind,pathscale/libunwind,rogwfu/libunwind,krytarowski/libunwind,adsharma/libunwind,frida/libunwind,olibc/libunwind,cloudius-systems/libunwind,tronical/libunwind,vtjnash/libunwind,zeldin/platform_external_libunwind,androidarmv6/android_external_libunwind,0xlab/0xdroid-external_libunwind,fdoray/libunwind,frida/libunwind,Keno/libunwind,martyone/libunwind,zliu2014/libunwind-tilegx,igprof/libunwind,cloudius-systems/libunwind,cloudius-systems/libunwind,rogwfu/libunwind,jrmuizel/libunwind,rntz/libunwind,vegard/libunwind,atanasyan/libunwind-android,rntz/libunwind,atanasyan/libunwind,rogwfu/libunwind,atanasyan/libunwind-android
bcb54520eb9aaf2c25660380f7301ff3f4d284d5
test/CodeGen/pr9614.c
test/CodeGen/pr9614.c
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s extern void foo_alias (void) __asm ("foo"); inline void foo (void) { return foo_alias (); } extern void bar_alias (void) __asm ("bar"); inline __attribute__ ((__always_inline__)) void bar (void) { return bar_alias (); } void f(void) { foo(); bar(); } // CHECK: define void @f() // CHECK-NEXT: entry: // CHECK-NEXT: call void @foo() // CHECK-NEXT: call void @bar() // CHECK-NEXT: ret void // CHECK: declare void @foo() // CHECK: declare void @bar()
// RUN: %clang_cc1 -emit-llvm %s -O1 -o - | FileCheck %s extern void foo_alias (void) __asm ("foo"); inline void foo (void) { return foo_alias (); } extern void bar_alias (void) __asm ("bar"); inline __attribute__ ((__always_inline__)) void bar (void) { return bar_alias (); } void f(void) { foo(); bar(); } // CHECK: define void @f() // CHECK: call void @foo() // CHECK-NEXT: call void @bar() // CHECK-NEXT: ret void // CHECK: declare void @foo() // CHECK: declare void @bar()
Fix this on the bots and make the test more complete by enabling optimizations.
Fix this on the bots and make the test more complete by enabling optimizations. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@143223 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,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
a23dcce1d04354a1fa4bd0a794e60ff74521db1b
test/Sema/128bitint.c
test/Sema/128bitint.c
// RUN: clang-cc -fsyntax-only -verify %s typedef int i128 __attribute__((__mode__(TI))); typedef unsigned u128 __attribute__((__mode__(TI))); int a[((i128)-1 ^ (i128)-2) == 1 ? 1 : -1]; int a[(u128)-1 > 1LL ? 1 : -1]; // PR5435 __uint128_t b = (__uint128_t)-1;
// RUN: clang-cc -fsyntax-only -verify -triple x86_64-apple-darwin9 %s typedef int i128 __attribute__((__mode__(TI))); typedef unsigned u128 __attribute__((__mode__(TI))); int a[((i128)-1 ^ (i128)-2) == 1 ? 1 : -1]; int a[(u128)-1 > 1LL ? 1 : -1]; // PR5435 __uint128_t b = (__uint128_t)-1;
Add a triple to try to fix the buildbot error.
Add a triple to try to fix the buildbot error. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@86563 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,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,apple/swift-clang,apple/swift-clang
65a04e22843f7777fe8e20a1433c033a44a30198
DMNotificationObserver.h
DMNotificationObserver.h
// // DMNotificationObserver.h // Library // // Created by Jonathon Mah on 2011-07-11. // Copyright 2011 Delicious Monster Software. All rights reserved. // #import <Foundation/Foundation.h> /* The action block is passed the notification, the owner as a parameter (to avoid retain cycles), * and the triggering observer (so it can easiliy invalidate it if it needs to). */ @class DMNotificationObserver; typedef void(^DMNotificationActionBlock)(NSNotification *notification, id localOwner, DMNotificationObserver *observer); @interface DMNotificationObserver : NSObject + (id)observerForName:(NSString *)notificationName object:(id)notificationSender owner:(id)owner action:(DMNotificationActionBlock)actionBlock __attribute__((__nonnull__(1,3,4))); - (id)initWithName:(NSString *)notificationName object:(id)notificationSender owner:(id)owner action:(DMNotificationActionBlock)actionBlock __attribute__((__nonnull__(1,3,4))); - (void)fireAction:(NSNotification *)notification; - (void)invalidate; @end
// // DMNotificationObserver.h // Library // // Created by Jonathon Mah on 2011-07-11. // Copyright 2011 Delicious Monster Software. All rights reserved. // #import <Foundation/Foundation.h> /* The action block is passed the notification, the owner as a parameter (to avoid retain cycles), * and the triggering observer (so it can easiliy invalidate it if it needs to). */ @class DMNotificationObserver; typedef void(^DMNotificationActionBlock)(NSNotification *notification, id localOwner, DMNotificationObserver *observer); @interface DMNotificationObserver : NSObject + (id)observerForName:(NSString *)notificationName object:(id)notificationSender owner:(id)owner action:(DMNotificationActionBlock)actionBlock __attribute__((nonnull(1,3,4))); - (id)initWithName:(NSString *)notificationName object:(id)notificationSender owner:(id)owner action:(DMNotificationActionBlock)actionBlock __attribute__((nonnull(1,3,4))); - (void)fireAction:(NSNotification *)notification; - (void)invalidate; @end
Standardize on nonnull attribute (vs __nonnull__)
Standardize on nonnull attribute (vs __nonnull__)
C
apache-2.0
delicious-monster/DMAutoInvalidation
f55431e897ce62a2f4697a488467e8b7a1bdedcd
hello.c
hello.c
/* hello.c build with: gcc -nostartfiles -fno-asynchronous-unwind-tables -Os -static -o hello hello.c strip -R .comment -s hello */ #include <unistd.h> const char message[] = "\n" "Hello from Docker.\n" "This message shows that your installation appears to be working correctly.\n" "\n" "To generate this message, Docker took the following steps:\n" " 1. The Docker client contacted the Docker daemon.\n" " 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n" " 3. The Docker daemon created a new container from that image which runs the\n" " executable that produces the output you are currently reading.\n" " 4. The Docker daemon streamed that output to the Docker client, which sent it\n" " to your terminal.\n" "\n" "To try something more ambitious, you can run an Ubuntu container with:\n" " $ docker run -it ubuntu bash\n" "\n" "Share images, automate workflows, and more with a free Docker Hub account:\n" " https://hub.docker.com\n" "\n" "For more examples and ideas, visit:\n" " https://docs.docker.com/userguide/\n" "\n"; void _start() { write(1, message, sizeof(message)-1); _exit(0); }
Replace with portable version in C
Replace with portable version in C Build a minimal version in C instead of assembly so it easily can be ported to other archs. This statically linked C version builds a binary that is 1472 bytes. fixes #7
C
mit
infosiftr/hello-world,Posytron/teste,docker-library/hello-world,docker-library/hello-world,infosiftr/hello-world,Posytron/teste
0b963c5a4eccde9050903d6859faee9096d3ce2b
test/entrytestsuite.h
test/entrytestsuite.h
#ifndef ENTRYTESTSUITE #define ENTRYTESTSUITE #include <cxxtest/TestSuite.h> #include "../src/entry.h" class EntryTestSuite : public CxxTest::TestSuite { public: void testEntryHasGivenTitle(void) { testEntry.setTitle("testTitle"); TS_ASSERT_SAME_DATA(testEntry.title().c_str(), "testTitle", 9); } diaryengine::Entry testEntry; }; #endif // ENTRYTESTSUITE
#ifndef ENTRYTESTSUITE #define ENTRYTESTSUITE #include <cxxtest/TestSuite.h> #include <qt5/QtCore/QDateTime> #include "../src/entry.h" class EntryTestSuite : public CxxTest::TestSuite { public: void testTitleCanBeSetCorrectly(void) { testEntry.setTitle("testTitle"); TS_ASSERT_SAME_DATA(testEntry.title().c_str(), "testTitle", 9); } void testDateCanBeSetCorrectlyWithISOString(void) { testEntry.setDate("2007-03-01T13:00:00Z"); TS_ASSERT(testEntry.date() == "2007-03-01T13:00:00Z"); } void testDateUnderstandsTimeZone(void) { testEntry.setDate("2007-03-01T13:00:00+02:00"); TS_ASSERT(testEntry.date() == "2007-03-01T13:00:00+02:00"); } void testIdRegenerationGeneratesDifferentUUID() { testEntry.regenerateId(); long id = testEntry.id(); testEntry.regenerateId(); TS_ASSERT_DIFFERS(testEntry.id(), id); } diaryengine::Entry testEntry; }; #endif // ENTRYTESTSUITE
Add tests for id generation and ISO date strings
Add tests for id generation and ISO date strings
C
bsd-3-clause
Acce0ss/diary-engine
543e3925dae7dbe3fb2d5f81b193f2f796e0cd8f
tree/treeplayer/inc/DataFrameLinkDef.h
tree/treeplayer/inc/DataFrameLinkDef.h
/************************************************************************* * 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 __ROOTCLING__ // All these are there for the autoloading #pragma link C++ class ROOT::Experimental::TDataFrame-; #pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>-; #pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>-; #endif
/************************************************************************* * 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 __ROOTCLING__ // All these are there for the autoloading #pragma link C++ class ROOT::Experimental::TDataFrame-; #pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>-; #pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>-; #pragma link C++ class ROOT::Detail::TDataFrameImpl-; #endif
Add another autoload key for TDataFrameImpl'
[TDF] Add another autoload key for TDataFrameImpl'
C
lgpl-2.1
olifre/root,root-mirror/root,BerserkerTroll/root,bbockelm/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,simonpf/root,olifre/root,simonpf/root,bbockelm/root,bbockelm/root,zzxuanyuan/root,BerserkerTroll/root,zzxuanyuan/root,mhuwiler/rootauto,bbockelm/root,zzxuanyuan/root,agarciamontoro/root,mhuwiler/rootauto,simonpf/root,olifre/root,mhuwiler/rootauto,olifre/root,mhuwiler/rootauto,beniz/root,davidlt/root,mhuwiler/rootauto,mhuwiler/rootauto,bbockelm/root,karies/root,zzxuanyuan/root-compressor-dummy,simonpf/root,mhuwiler/rootauto,olifre/root,buuck/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,mhuwiler/rootauto,beniz/root,zzxuanyuan/root,davidlt/root,zzxuanyuan/root,buuck/root,BerserkerTroll/root,satyarth934/root,bbockelm/root,karies/root,beniz/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,satyarth934/root,zzxuanyuan/root-compressor-dummy,davidlt/root,olifre/root,karies/root,buuck/root,davidlt/root,root-mirror/root,root-mirror/root,karies/root,agarciamontoro/root,simonpf/root,buuck/root,root-mirror/root,simonpf/root,bbockelm/root,satyarth934/root,mhuwiler/rootauto,davidlt/root,karies/root,zzxuanyuan/root,bbockelm/root,zzxuanyuan/root,simonpf/root,satyarth934/root,satyarth934/root,satyarth934/root,buuck/root,satyarth934/root,BerserkerTroll/root,satyarth934/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,satyarth934/root,karies/root,agarciamontoro/root,satyarth934/root,BerserkerTroll/root,bbockelm/root,root-mirror/root,olifre/root,karies/root,zzxuanyuan/root-compressor-dummy,buuck/root,buuck/root,simonpf/root,BerserkerTroll/root,mhuwiler/rootauto,karies/root,agarciamontoro/root,bbockelm/root,davidlt/root,agarciamontoro/root,beniz/root,bbockelm/root,agarciamontoro/root,zzxuanyuan/root,simonpf/root,beniz/root,root-mirror/root,zzxuanyuan/root,karies/root,zzxuanyuan/root,satyarth934/root,buuck/root,davidlt/root,olifre/root,zzxuanyuan/root-compressor-dummy,beniz/root,olifre/root,davidlt/root,zzxuanyuan/root-compressor-dummy,beniz/root,agarciamontoro/root,davidlt/root,olifre/root,karies/root,agarciamontoro/root,root-mirror/root,root-mirror/root,root-mirror/root,BerserkerTroll/root,agarciamontoro/root,root-mirror/root,simonpf/root,beniz/root,agarciamontoro/root,BerserkerTroll/root,root-mirror/root,davidlt/root,olifre/root,zzxuanyuan/root,beniz/root,buuck/root,simonpf/root,beniz/root,buuck/root,karies/root,beniz/root,davidlt/root,BerserkerTroll/root,buuck/root,BerserkerTroll/root
7638cf06ae8312e7f8407354b5aae2eba318fa84
test/Analysis/html-diags-multifile.c
test/Analysis/html-diags-multifile.c
// RUN: mkdir -p %t.dir // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir // RUN: ls %t.dir | not grep report // RUN: rm -fR %t.dir // This tests that we do not currently emit HTML diagnostics for reports that // cross file boundaries. #include "html-diags-multifile.h" #define CALL_HAS_BUG(q) has_bug(q) void test_call_macro() { CALL_HAS_BUG(0); }
// RUN: mkdir -p %t.dir // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir %s // RUN: ls %t.dir | not grep report // RUN: rm -fR %t.dir // This tests that we do not currently emit HTML diagnostics for reports that // cross file boundaries. #include "html-diags-multifile.h" #define CALL_HAS_BUG(q) has_bug(q) void test_call_macro() { CALL_HAS_BUG(0); }
Fix test that wasn't testing anything
Fix test that wasn't testing anything git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@194069 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
805fc1080042295111421907863163f362b856d6
IMU/readImuDMP/blinkio.c
IMU/readImuDMP/blinkio.c
#include <stdio.h> #include <unistd.h> #include <errno.h> #include <signal.h> #include <stdlib.h> #include "mraa.h" #define thumb_f 8 #define index_f 9 #define middle_f 10 #define ring_f 11 #define pinky_f 12 int running = 0; int main(int argc, char** argv) { mraa_result_t r = MRAA_SUCCESS; mraa_init(); fprintf(stdout, "MRAA Version: %s\n", mraa_get_version()); mraa_gpio_context gpio[5]; gpio[0] = mraa_gpio_init(thumb_f); gpio[1] = mraa_gpio_init(index_f); gpio[2] = mraa_gpio_init(middle_f); gpio[3] = mraa_gpio_init(ring_f); gpio[4] = mraa_gpio_init(pinky_f); // set direction to OUT r = mraa_gpio_dir(gpio[0], MRAA_GPIO_OUT); r = mraa_gpio_dir(gpio[1], MRAA_GPIO_OUT); r = mraa_gpio_dir(gpio[2], MRAA_GPIO_OUT); r = mraa_gpio_dir(gpio[3], MRAA_GPIO_OUT); r = mraa_gpio_dir(gpio[4], MRAA_GPIO_OUT); while (running == 0) { mraa_gpio_write(gpio[0], 0); mraa_gpio_write(gpio[1], 0); mraa_gpio_write(gpio[2], 0); mraa_gpio_write(gpio[3], 0); mraa_gpio_write(gpio[4], 0); printf("off\n"); sleep(1); mraa_gpio_write(gpio[0], 1); mraa_gpio_write(gpio[1], 1); mraa_gpio_write(gpio[2], 1); mraa_gpio_write(gpio[3], 1); mraa_gpio_write(gpio[4], 1); printf("on\n"); sleep(1); } return r; }
ADD - Added functional GPIO code to IMU folder
ADD - Added functional GPIO code to IMU folder
C
mit
danielholanda/Tactile-Glove,danielholanda/Tactile-Glove,danielholanda/Tactile-Glove
3340e66e82e74a89a5d81763b4ed7b21acb810ff
PKRevealController/PKAppDelegate.h
PKRevealController/PKAppDelegate.h
/* PKRevealController - Copyright (C) 2012 Philip Kluz ([email protected]) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <UIKit/UIKit.h> @class PKRevealController; @interface PKAppDelegate : UIResponder <UIApplicationDelegate> @property (nonatomic, strong, readwrite) PKRevealController *revealController; @property (strong, nonatomic) UIWindow *window; @end
/* PKRevealController - Copyright (C) 2012 Philip Kluz ([email protected]) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <UIKit/UIKit.h> @class PKRevealController; @interface PKAppDelegate : UIResponder <UIApplicationDelegate> @property (nonatomic, strong, readwrite) PKRevealController *revealController; @property (nonatomic, strong) UIWindow *window; @end
Use right order of nonatomic and strong
Use right order of nonatomic and strong
C
mit
xiaotaijun/PKRevealController,ramoslin02/PKRevealController,SuPair/PKRevealController,wjszf/PKRevealController,adonoho/PKRevealController,BlessNeo/PKRevealController,SummerHF/PKRevealController,duanhjlt/PKRevealController,AlanJN/PKRevealController,pkluz/PKRevealController,cnbin/PKRevealController,andyFang1688/PKRevealController,libiao88/PKRevealController,wpostma/PKRevealControllerWP,adonoho/PKRevealController,policp/PKRevealController,RyanTech/PKRevealController,wayne798/PKRevealController,leasual/PKRevealController,emodeqidao/PKRevealController,chengkaizone/PKRevealController,adonoho/PKRevealController,hanangellove/PKRevealController,SanChain/PKRevealController,AbooJan/PKRevealController,chieryw/PKRevealController,wubangjunjava/PKRevealController,xingyuniu/PKRevealController,nitxc/PKRevealController,pengleelove/PKRevealController
b194a61515f0585ef632e934f05d4b4bbac8b50d
pgf+/include/gf/stringutil.h
pgf+/include/gf/stringutil.h
// // string.h // pgf+ // // Created by Emil Djupfeldt on 2012-06-25. // Copyright (c) 2012 Chalmers University of Technology. All rights reserved. // #ifndef pgf__string_h #define pgf__string_h #include <string> #include <vector> namespace gf { static inline std::vector<std::string> split(const std::string& str, char ch) { std::vector<std::string> ret; size_t last; size_t next; last = 0; while (true) { next = str.find(ch, last); if (next == std::string::npos) { ret.push_back(str.substr(last)); break; } ret.push_back(str.substr(last, next - last)); last = next + 1; } return ret; } static inline bool isWhiteSpace(char ch) { return ch == '\r' || ch == '\n' || ch == '\t' || ch == ' '; } static inline std::string trim(const std::string& str) { size_t start; size_t end; for (start = 0; start < str.size() ; start++) { if (!isWhiteSpace(str.at(start))) { break; } } for (end = str.size(); end > start; end--) { if (!isWhiteSpace(str.at(end - 1))) { end--; break; } } return str.substr(start, end - start); } } #endif
Add some string utility functions.
Add some string utility functions.
C
bsd-2-clause
egladil/mscthesis,egladil/mscthesis,egladil/mscthesis
3f431df8ec46b86090ad59ee153872c45d4d429d
usr.bin/systat/devs.h
usr.bin/systat/devs.h
int dsinit(int, struct statinfo *, struct statinfo *, struct statinfo *); int dscmd(char *, char *, int, struct statinfo *);
/*- * Copyright (c) 1998 David E. O'Brien * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id$ */ int dsinit(int, struct statinfo *, struct statinfo *, struct statinfo *); int dscmd(char *, char *, int, struct statinfo *);
Add copyright and RCS/CVS Id.
Add copyright and RCS/CVS Id. Noticed by: ken
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
6df016fb205bec2c07872597ad126856b341cff7
src/java/org_bitcoin_NativeSecp256k1.c
src/java/org_bitcoin_NativeSecp256k1.c
#include "org_bitcoin_NativeSecp256k1.h" #include "include/secp256k1.h" JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify (JNIEnv* env, jclass classObject, jobject byteBufferObject) { unsigned char* data = (unsigned char*) env->GetDirectBufferAddress(byteBufferObject); int sigLen = *((int*)(data + 32)); int pubLen = *((int*)(data + 32 + 4)); return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen); } static void __javasecp256k1_attach(void) __attribute__((constructor)); static void __javasecp256k1_detach(void) __attribute__((destructor)); static void __javasecp256k1_attach(void) { secp256k1_start(); } static void __javasecp256k1_detach(void) { secp256k1_stop(); }
#include "org_bitcoin_NativeSecp256k1.h" #include "include/secp256k1.h" JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify (JNIEnv* env, jclass classObject, jobject byteBufferObject) { unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); int sigLen = *((int*)(data + 32)); int pubLen = *((int*)(data + 32 + 4)); return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen); } static void __javasecp256k1_attach(void) __attribute__((constructor)); static void __javasecp256k1_detach(void) __attribute__((destructor)); static void __javasecp256k1_attach(void) { secp256k1_start(); } static void __javasecp256k1_detach(void) { secp256k1_stop(); }
Fix JNI for C instead of C++
Fix JNI for C instead of C++ (because apparently there is a significant difference...)
C
mit
ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu,BWallet/secp256k1,ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu,kleetus/secp256k1,ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu,Gustav-Simonsson/secp256k1,pmienk/secp256k1,01BTC10/secp256k1,pmienk/secp256k1,voisine/secp256k1,sipa/secp256k1-zkp,01BTC10/secp256k1,kleetus/secp256k1,martindale/secp256k1,chfast/secp256k1,martindale/secp256k1-zkp,Bitcoin-com/BUcash,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,bitcoin/secp256k1,BitcoinUnlimited/BitcoinUnlimited,libbitcoin/secp256k1,Justaphf/BitcoinUnlimited,sipa/secp256k1-zkp,krzysztofwos/BitcoinUnlimited,ryancdotorg/secp256k1,marcusdiaz/BitcoinUnlimited,cddjr/BitcoinUnlimited,shea256/secp256k1-zkp,krzysztofwos/BitcoinUnlimited,marcusdiaz/BitcoinUnlimited,ryancdotorg/secp256k1,libmetrocoin/secp256k1,GSongHashrate/secp256k1,cddjr/BitcoinUnlimited,randy-waterhouse/secp256k1,martindale/secp256k1,bitcoin/secp256k1,BitcoinUnlimited/BitcoinUnlimited,afk11/secp256k1,vlajos/secp256k1,Gustav-Simonsson/secp256k1,digitalbitbox/secp256k1,bitcoin-core/secp256k1,jonasschnelli/secp256k1,sipa/secp256k1-zkp,ChrisXin/secp256k1,ryancdotorg/secp256k1,01BTC10/secp256k1,krzysztofwos/BitcoinUnlimited,libmetrocoin/secp256k1,cddjr/BitcoinUnlimited,ChrisXin/secp256k1,martindale/secp256k1,Justaphf/BitcoinUnlimited,randy-waterhouse/secp256k1,digitalbitbox/secp256k1,instagibbs/secp256k1,evoskuil/secp256k1,BWallet/secp256k1,bitcoin/secp256k1,Gustav-Simonsson/secp256k1,Bitcoin-com/BUcash,libbitcoin/secp256k1,instagibbs/secp256k1,luke-jr/secp256k1,Justaphf/BitcoinUnlimited,evoskuil/secp256k1,Justaphf/BitcoinUnlimited,ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu,pmienk/secp256k1,sipa/secp256k1,apoelstra/secp256k1,evoskuil/secp256k1,rustyrussell/secp256k1,evoskuil/secp256k1,ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu,martindale/secp256k1-zkp,ChrisXin/secp256k1,pmienk/secp256k1,ElementsProject/secp256k1-zkp,BWallet/secp256k1,bitcoin-core/secp256k1,BWallet/secp256k1,Bitcoin-com/BUcash,instagibbs/secp256k1,ChrisXin/secp256k1,krzysztofwos/BitcoinUnlimited,afk11/secp256k1,cddjr/BitcoinUnlimited,peterdettman/secp256k1,krzysztofwos/BitcoinUnlimited,apoelstra/secp256k1,libmetrocoin/secp256k1,Bitcoin-com/BUcash,sipa/secp256k1,GSongHashrate/secp256k1,ryancdotorg/secp256k1,voisine/secp256k1,chfast/secp256k1,voisine/secp256k1,BTCfork/hardfork_prototype_1_mvf-bu,martindale/secp256k1-zkp,sipa/secp256k1-zkp,apoelstra/secp256k1,bitcoin/secp256k1,ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu,voisine/secp256k1,libmetrocoin/secp256k1,instagibbs/secp256k1,evoskuil/secp256k1,pmienk/secp256k1,01BTC10/secp256k1,libbitcoin/secp256k1,afk11/secp256k1,GSongHashrate/secp256k1,sipa/secp256k1,Gustav-Simonsson/secp256k1,libbitcoin/secp256k1,vlajos/secp256k1,vlajos/secp256k1,cddjr/BitcoinUnlimited,sipa/secp256k1,chfast/secp256k1,GSongHashrate/secp256k1,digitalbitbox/secp256k1,jonasschnelli/secp256k1,BTCfork/hardfork_prototype_1_mvf-bu,apoelstra/secp256k1,BTCfork/hardfork_prototype_1_mvf-bu,shea256/secp256k1-zkp,rustyrussell/secp256k1,jonasschnelli/secp256k1,ElementsProject/secp256k1-zkp,chfast/secp256k1,randy-waterhouse/secp256k1,afk11/secp256k1,BitcoinUnlimited/BitcoinUnlimited,shea256/secp256k1-zkp,martindale/secp256k1,BTCfork/hardfork_prototype_1_mvf-bu,peterdettman/secp256k1,sipa/secp256k1-zkp,jonasschnelli/secp256k1,marcusdiaz/BitcoinUnlimited,rustyrussell/secp256k1,bitcoin/secp256k1,kleetus/secp256k1,shea256/secp256k1-zkp,randy-waterhouse/secp256k1,vlajos/secp256k1,BitcoinUnlimited/BitcoinUnlimited,apoelstra/secp256k1,rustyrussell/secp256k1,marcusdiaz/BitcoinUnlimited,luke-jr/secp256k1,martindale/secp256k1-zkp,luke-jr/secp256k1,BTCfork/hardfork_prototype_1_mvf-bu,krzysztofwos/BitcoinUnlimited,voisine/secp256k1,kleetus/secp256k1,marcusdiaz/BitcoinUnlimited,kleetus/secp256k1,digitalbitbox/secp256k1,Bitcoin-com/BUcash,BitcoinUnlimited/BitcoinUnlimited,cddjr/BitcoinUnlimited,Bitcoin-com/BUcash,digitalbitbox/secp256k1,BTCfork/hardfork_prototype_1_mvf-bu,afk11/secp256k1,marcusdiaz/BitcoinUnlimited,libbitcoin/secp256k1,instagibbs/secp256k1,chfast/secp256k1
a97b433223d22e3050a16d0473dc52d247b74dab
include/PixelProcessing.h
include/PixelProcessing.h
#pragma once #include "MyImage.h" #define MASK_SIZE 5 class Pixel { private: BYTE blue; BYTE green; BYTE red; public: Pixel(){ blue; green; red; } ~Pixel(){} BYTE GetBlue() { return blue; } BYTE GetGreen() { return green; } BYTE GetRed() { return red; } void Set(int _b, int _g, int _r) { blue = _b; green = _g; red = _r; } }; class CPixelProcessing { public: CPixelProcessing(CMyImage*, int, BYTE, BYTE); ~CPixelProcessing(void){} CMyImage* start(BYTE**); private: int nWidth; int nHeight; int nBitDepth; int nOutput; BYTE nHotVal; BYTE nDeadVal; CMyImage *pResult; BYTE** szResult; BYTE *temp; void _8bitImageCorrection(BYTE**); void _24bitImageCorrection(BYTE**); int GetMedian(vector<BYTE>); bool GetPixelState(int, int, int); bool GetPixelState(int, int, Pixel); };
#pragma once #include "MyImage.h" #define MASK_SIZE 3 class Pixel { private: BYTE blue; BYTE green; BYTE red; public: Pixel(){ blue; green; red; } ~Pixel(){} BYTE GetBlue() { return blue; } BYTE GetGreen() { return green; } BYTE GetRed() { return red; } void Set(int _b, int _g, int _r) { blue = _b; green = _g; red = _r; } }; class CPixelProcessing { public: CPixelProcessing(CMyImage*, int, BYTE, BYTE); ~CPixelProcessing(void){} CMyImage* start(BYTE**); private: int nWidth; int nHeight; int nBitDepth; int nOutput; BYTE nHotVal; BYTE nDeadVal; CMyImage *pResult; BYTE** szResult; BYTE *temp; void _8bitImageCorrection(BYTE**); void _24bitImageCorrection(BYTE**); int GetMedian(vector<BYTE>); bool GetPixelState(int, int, int); bool GetPixelState(int, int, Pixel); };
Change mask size from 5 to 3
Change mask size from 5 to 3
C
bsd-3-clause
mystesPF/Defect-Pixel-Corrector,mystesPF/Defect-Pixel-Corrector
7662ebe6de73bbada1f216590f3e8b15b496a46b
Src/lib/utils/swap.c
Src/lib/utils/swap.c
#include "swap.h" #include <string.h> /* Swap generic function */ void swap(void *vp1, void *vp2, int size) { char buffer[size]; memcpy(buffer, vp1, size); memcpy(vp1,vp2,size); memcpy(vp2,buffer,size); }
#include "swap.h" #include <stdlib.h> #include <string.h> /* Swap generic function */ void swap(void *vp1, void *vp2, int size) { char* buffer = (char*) malloc(size*sizeof(char)); memcpy(buffer, vp1, size); memcpy(vp1,vp2,size); memcpy(vp2,buffer,size); free(buffer); }
Use malloc/free as compile failed under MSVC. Ask rpmuller to check if okay.
Use malloc/free as compile failed under MSVC. Ask rpmuller to check if okay. git-svn-id: 6e15fd90c9d760a7473dfa00402abf17076c345c@188 64417113-1622-0410-aef8-ef15d1a3721e
C
bsd-3-clause
berquist/PyQuante,berquist/PyQuante,berquist/PyQuante,berquist/PyQuante,berquist/PyQuante,berquist/PyQuante
58825b976bd868c9006e12f39e350f1bd42e116d
tests/regression/06-symbeq/34-var_eq-exponential-context.c
tests/regression/06-symbeq/34-var_eq-exponential-context.c
// SKIP PARAM: --set ana.activated[+] var_eq void level0(int *p) { } void level1(int *p, int *q) { level0(p); level0(q); } void level2(int *p, int *q) { level1(p, q); level1(q, p); } void level3(int *p, int *q) { level2(p, q); level2(q, p); } void level4(int *p, int *q) { level3(p, q); level3(q, p); } void level5(int *p, int *q) { level4(p, q); level4(q, p); } void level6(int *p, int *q) { level5(p, q); level5(q, p); } void level7(int *p, int *q) { level6(p, q); level6(q, p); } void level8(int *p, int *q) { level7(p, q); level7(q, p); } void level9(int *p, int *q) { level8(p, q); level8(q, p); } int main() { int i = 0; int j = 0; level9(&i, &j); return 0; }
Add skipped test where var_eq gets exponentially many contexts
Add skipped test where var_eq gets exponentially many contexts See https://github.com/goblint/bench/issues/16#issuecomment-1100067978.
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
610ff601af40fe5fb1978a7717eafe966b120dee
include/SafariServices/SFSafariViewControllerDelegate.h
include/SafariServices/SFSafariViewControllerDelegate.h
//****************************************************************************** // // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once #import <SafariServices/SafariServicesExport.h> #import <Foundation/NSObjCRuntime.h> @class SFSafariViewController; @class NSURL; @class NSString; @class NSArray; @protocol SFSafariViewControllerDelegate <NSObject> - (void)safariViewController:(SFSafariViewController*)controller didCompleteInitialLoad:(BOOL)didLoadSuccessfully; - (NSArray*)safariViewController:(SFSafariViewController*)controller activityItemsForURL:(NSURL*)URL title:(NSString*)title; - (void)safariViewControllerDidFinish:(SFSafariViewController*)controller; @end
//****************************************************************************** // // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once #import <SafariServices/SafariServicesExport.h> #import <Foundation/NSObject.h> @class SFSafariViewController; @class NSURL; @class NSString; @class NSArray; @protocol SFSafariViewControllerDelegate <NSObject> - (void)safariViewController:(SFSafariViewController*)controller didCompleteInitialLoad:(BOOL)didLoadSuccessfully; - (NSArray*)safariViewController:(SFSafariViewController*)controller activityItemsForURL:(NSURL*)URL title:(NSString*)title; - (void)safariViewControllerDidFinish:(SFSafariViewController*)controller; @end
Add missing NSObject protocol declaration.
Add missing NSObject protocol declaration.
C
mit
nathpete-msft/WinObjC,MSFTFox/WinObjC,Microsoft/WinObjC,pradipd/WinObjC,bbowman/WinObjC,rajsesh-msft/WinObjC,nathpete-msft/WinObjC,MSFTFox/WinObjC,rajsesh-msft/WinObjC,yweijiang/WinObjC,yweijiang/WinObjC,ehren/WinObjC,ehren/WinObjC,yweijiang/WinObjC,bbowman/WinObjC,Microsoft/WinObjC,autodesk-forks/WinObjC,rajsesh-msft/WinObjC,bbowman/WinObjC,vkvenkat/WinObjC,vkvenkat/WinObjC,pradipd/WinObjC,ehren/WinObjC,vkvenkat/WinObjC,nathpete-msft/WinObjC,Microsoft/WinObjC,Microsoft/WinObjC,autodesk-forks/WinObjC,yweijiang/WinObjC,bbowman/WinObjC,autodesk-forks/WinObjC,bbowman/WinObjC,ehren/WinObjC,nathpete-msft/WinObjC,pradipd/WinObjC,MSFTFox/WinObjC,nathpete-msft/WinObjC,rajsesh-msft/WinObjC,MSFTFox/WinObjC,pradipd/WinObjC,autodesk-forks/WinObjC,ehren/WinObjC,pradipd/WinObjC,vkvenkat/WinObjC
acc060f6ee491b1eed93b45df2f1b37fb710aa7a
test/CodeGen/wchar-const.c
test/CodeGen/wchar-const.c
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s // This should pass for any endianness combination of host and target. // This bit is taken from Sema/wchar.c so we can avoid the wchar.h include. typedef __WCHAR_TYPE__ wchar_t; #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \ || defined(_M_X64) || defined(SHORT_WCHAR) #define WCHAR_T_TYPE unsigned short #elif defined(__sun) || defined(__AuroraUX__) #define WCHAR_T_TYPE long #else /* Solaris or AuroraUX. */ #define WCHAR_T_TYPE int #endif // CHECK: @.str = private unnamed_addr constant [72 x i8] c" extern void foo(const wchar_t* p); int main (int argc, const char * argv[]) { foo(L"This is some text"); return 0; }
// RUN: %clang_cc1 -emit-llvm %s -o - -triple i386-pc-win32 | FileCheck %s --check-prefix=WIN // RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-apple-darwin | FileCheck %s --check-prefix=DAR // This should pass for any endianness combination of host and target. // This bit is taken from Sema/wchar.c so we can avoid the wchar.h include. typedef __WCHAR_TYPE__ wchar_t; #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \ || defined(_M_X64) || defined(SHORT_WCHAR) #define WCHAR_T_TYPE unsigned short #elif defined(__sun) || defined(__AuroraUX__) #define WCHAR_T_TYPE long #else /* Solaris or AuroraUX. */ #define WCHAR_T_TYPE int #endif // CHECK-DAR: private unnamed_addr constant [72 x i8] c" // CHECK-WIN: private unnamed_addr constant [36 x i8] c" extern void foo(const wchar_t* p); int main (int argc, const char * argv[]) { foo(L"This is some text"); return 0; }
Handle different sized wchar_t for windows.
Handle different sized wchar_t for windows. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136192 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
9ed5a4910c477f418ba200252cd6696339ee5ba5
include/tablet_mode.h
include/tablet_mode.h
/* Copyright 2016 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. */ /* Header for tablet_mode.c */ #ifdef CONFIG_TABLET_MODE /* Return 1 if in tablet mode, 0 otherwise */ int tablet_get_mode(void); void tablet_set_mode(int mode); /** * Interrupt service routine for hall sensor. * * HALL_SENSOR_GPIO_L must be defined. * * @param signal: GPIO signal */ void hall_sensor_isr(enum gpio_signal signal); /** * Disables the interrupt on GPIO connected to hall sensor. Additionally, it * disables the tablet mode switch sub-system and turns off tablet mode. This is * useful when the same firmware is shared between convertible and clamshell * devices to turn off hall sensor and tablet mode detection on clamshell. */ void hall_sensor_disable(void); /* * This must be defined when CONFIG_HALL_SENSOR_CUSTOM is defined. This allows * a board to override the default behavior that determines if the 360 sensor is * active: !gpio_get_level(HALL_SENSOR_GPIO_L). * * Returns 1 if the 360 sensor is active; otherwise 0. */ int board_sensor_at_360(void); #endif
/* Copyright 2016 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. */ #ifndef __CROS_EC_TABLET_MODE_H #define __CROS_EC_TABLET_MODE_H /** * Get tablet mode state * * Return 1 if in tablet mode, 0 otherwise */ int tablet_get_mode(void); /** * Set tablet mode state * * @param mode 1: tablet mode. 0 clamshell mode. */ void tablet_set_mode(int mode); /** * Interrupt service routine for hall sensor. * * HALL_SENSOR_GPIO_L must be defined. * * @param signal: GPIO signal */ void hall_sensor_isr(enum gpio_signal signal); /** * Disables the interrupt on GPIO connected to hall sensor. Additionally, it * disables the tablet mode switch sub-system and turns off tablet mode. This is * useful when the same firmware is shared between convertible and clamshell * devices to turn off hall sensor and tablet mode detection on clamshell. */ void hall_sensor_disable(void); /** * This must be defined when CONFIG_HALL_SENSOR_CUSTOM is defined. This allows * a board to override the default behavior that determines if the 360 sensor is * active: !gpio_get_level(HALL_SENSOR_GPIO_L). * * Returns 1 if the 360 sensor is active; otherwise 0. */ int board_sensor_at_360(void); #endif /* __CROS_EC_TABLET_MODE_H */
Fix header file guard and API definitions
tablet-mode: Fix header file guard and API definitions This patch adds a usual inclusion guard (#ifdef __CROS_EC_*_H) and fixes API descriptions. Signed-off-by: Daisuke Nojiri <[email protected]> BUG=none BRANCH=none TEST=buildall Change-Id: I96149cfe76cff7ab85be4785252a600b565e4a92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1696913 Reviewed-by: Daisuke Nojiri <[email protected]> Commit-Queue: Daisuke Nojiri <[email protected]> Tested-by: Daisuke Nojiri <[email protected]> Auto-Submit: Daisuke Nojiri <[email protected]>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
bac1e84578c9b1a9ddc961814db6d46cc03bfa6a
demo/src/input.h
demo/src/input.h
// Copyright 2020 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. #pragma once #include <cstdint> uint32_t DoMath(uint32_t a); uint32_t DoMath(uint32_t a) { return a * 3; }
// Copyright 2020 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. #pragma once #include <cstdint> uint32_t DoMath(uint32_t a); inline uint32_t DoMath(uint32_t a) { return a * 3; }
Fix another bug in demo
Fix another bug in demo
C
apache-2.0
google/autocxx,google/autocxx,google/autocxx,google/autocxx
87a6b78f84d1cc363fe7482ff0d7424a0477e26f
include/cssys/mac/osdefs.h
include/cssys/mac/osdefs.h
/* This header file contains all definitions needed for compatibility issues Most of them should be defined only if corresponding SYSDEF_XXX macro is defined (see system/sysdef.h) */ #ifndef OSDEFS_H #define OSDEFS_H int strcasecmp (const char *str1, const char *str2); int strncasecmp (char const *dst, char const *src, int maxLen); char *strdup (const char *str); #ifdef SYSDEF_ACCESS int access (const char *path, int mode); #endif // The 2D graphics driver used by software renderer on this platform #define SOFTWARE_2D_DRIVER "crystalspace.graphics2d.mac" #define OPENGL_2D_DRIVER "crystalspace.graphics2d.defaultgl" #define GLIDE_2D_DRIVER "crystalspace.graphics3d.glide.2x" // Sound driver #define SOUND_DRIVER "crystalspace.sound.driver.mac" #if defined (SYSDEF_DIR) # define __NEED_GENERIC_ISDIR #endif #define PORT_BYTESEX_BIG_ENDIAN 1 #endif // OSDEFS_H
/* This header file contains all definitions needed for compatibility issues Most of them should be defined only if corresponding SYSDEF_XXX macro is defined (see system/sysdef.h) */ #ifndef OSDEFS_H #define OSDEFS_H int strcasecmp (const char *str1, const char *str2); int strncasecmp (char const *dst, char const *src, int maxLen); char *strdup (const char *str); #ifdef SYSDEF_ACCESS int access (const char *path, int mode); #endif // The 2D graphics driver used by software renderer on this platform #define SOFTWARE_2D_DRIVER "crystalspace.graphics2d.mac" #define OPENGL_2D_DRIVER "crystalspace.graphics2d.defaultgl" #define GLIDE_2D_DRIVER "crystalspace.graphics3d.glide.2x" // Sound driver #define SOUND_DRIVER "crystalspace.sound.driver.mac" #if defined (SYSDEF_DIR) # define __NEED_GENERIC_ISDIR #endif #define PORT_BYTESEX_BIG_ENDIAN 1 #ifdef SYSDEF_2DDRIVER_DEFS #define kArrowCursor 128 #define kGeneralErrorDialog 1026 #define kAskForDepthChangeDialog 1027 #define kErrorStrings 1025 #define kBadDepthString 1 #define kNoDSContext 2 #define kUnableToOpenDSContext 3 #define kUnableToReserveDSContext 4 #define kFatalErrorInGlide 5 #define kFatalErrorInOpenGL2D 6 #define kFatalErrorInOpenGL3D 7 #define kFatalErrorOutOfMemory 8 #define kFatalErrorInDriver2D 9 #endif #endif // OSDEFS_H
Move defines for error strings and dialogs into this file for central tracking of ids.
Move defines for error strings and dialogs into this file for central tracking of ids. git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@483 8cc4aa7f-3514-0410-904f-f2cc9021211c
C
lgpl-2.1
crystalspace/CS,crystalspace/CS,crystalspace/CS,crystalspace/CS,crystalspace/CS,crystalspace/CS,crystalspace/CS,crystalspace/CS
887dcc7e13093e76d9d5adba4c16d9a376926940
gyro-debug.c
gyro-debug.c
#pragma config(Sensor, S1, gyro, sensorI2CHiTechnicGyro) #define TIME_MAX 0xFFFF bool initialized = false; unsigned long lastUpdate = 0; long getTimeDelta() { if (!initialized) { initialized = true; lastUpdate = nSysTime; return 0; } long delta; if (nSysTime < lastUpdate) { // The time has looped around delta = TIME_MAX - lastUpdate + nSysTime; lastUpdate = nSysTime; } else { delta = nSysTime - lastUpdate; lastUpdate = nSysTime; } return delta; } task main() { int zero = 0; float angle = 0; // Find the zero for (int i = 0; i < 10; i++) { zero += SensorValue[gyro]; wait1Msec(100); } zero /= 10; while(true) { angle += ((SensorValue[gyro]) - zero) * getTimeDelta() / 1000.0; nxtDisplayTextLine(0, "%d", SensorValue[gyro]); nxtDisplayTextLine(1, "%.4f", angle); nxtDisplayTextLine(2, "%d", zero); } }
Add gyro sensor debug program
Add gyro sensor debug program
C
mit
patrickmess/ftc-2013,patrickmess/ftc-2013
96dea463e3cb261eb2625dc96a90b4993178580b
usr.sbin/nologin/nologin.c
usr.sbin/nologin/nologin.c
/*- * This program is in the public domain. I couldn't bring myself to * declare Copyright on a variant of Hello World. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/uio.h> #include <syslog.h> #include <unistd.h> #define MESSAGE "This account is currently not available.\n" int main(int argc, char *argv[]) { #ifndef NO_NOLOGIN_LOG char *user, *tt; if ((tt = ttyname(0)) == NULL) tt = "UNKNOWN"; if ((user = getlogin()) == NULL) user = "UNKNOWN"; openlog("nologin", LOG_CONS, LOG_AUTH); syslog(LOG_CRIT, "Attempted login by %s on %s", user, tt); closelog(); #endif /* NO_NOLOGIN_LOG */ write(STDOUT_FILENO, MESSAGE, sizeof(MESSAGE) - 1); _exit(1); }
/*- * Copyright (c) 2004 The FreeBSD Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <stdio.h> #include <syslog.h> #include <unistd.h> #define MESSAGE "This account is currently not available.\n" int main(int argc, char *argv[]) { char *user, *tt; if ((tt = ttyname(0)) == NULL) tt = "UNKNOWN"; if ((user = getlogin()) == NULL) user = "UNKNOWN"; openlog("nologin", LOG_CONS, LOG_AUTH); syslog(LOG_CRIT, "Attempted login by %s on %s", user, tt); closelog(); printf("%s", MESSAGE); return 1; }
Add standard copyright notice; fix style bugs. (Reported by bde) Remove NO_NOLOGIN_LOG option now that we're off the root partition.
Add standard copyright notice; fix style bugs. (Reported by bde) Remove NO_NOLOGIN_LOG option now that we're off the root partition.
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
38ee400049d579c60f3e0ddfb6c388093d53ac7a
Josh_Zane_Sebastian/src/parser/parser.c
Josh_Zane_Sebastian/src/parser/parser.c
#include types.c #include <string.h> /* We can: Set something equal to something Function calls Function definitions Returning things -- delimiter '<' Printing things Iffing */ struct call parseCall(char* statement); struct function parseFunction(char* statement); char* fixSpacing(char* code) { char* fixedCode = calloc(sizeof(char), strlen(code) + 1); fixedCode = strcpy(fixedCode, code); int n = strlen(fixedCode); char* doubleSpace = strstr(fixedCode, " "); char* movingIndex; for( ; doubleSpace; doubleSpace = strstr(fixedCode, " ")) { for(movingIndex = doubleSpace; movingIndex&; movingIndex++) { movingIndex[0] = movingIndex[1]; } } return fixedCode; }
#include <stdlib.h> #include <stdio.h> #include types.c #include <string.h> /* We can: Set something equal to something Function calls Function definitions Returning things -- delimiter '<' Printing things Iffing */ struct call parseCall(char* statement); struct function parseFunction(char* statement); char* fixSpacing(char* code) { char* fixedCode = calloc(sizeof(char), strlen(code) + 1); fixedCode = strcpy(fixedCode, code); char* doubleSpace = strstr(fixedCode, " "); char* movingIndex; for( ; doubleSpace; doubleSpace = strstr(fixedCode, " ")) { for(movingIndex = doubleSpace; movingIndex&; movingIndex++) { movingIndex[0] = movingIndex[1]; } } return fixedCode; } struct statement* parse(char* code) { char* regCode = fixSpacing(code); int n = 0; int i; for(i = 0; regCode[i]; i++) { if(regCode[i] == ' ') { n++; } } char** spcTokens = calloc(sizeof(char*), n+1);
Make parse() count the spaces in the regularized code string.
Make parse() count the spaces in the regularized code string.
C
mit
aacoppa/final,aacoppa/final
2567fa8188b27b97d550c546f7a83211940e91a1
src/feng_utils.h
src/feng_utils.h
/* * * This file is part of Feng * * Copyright (C) 2009 by LScube team <[email protected]> * See AUTHORS for more details * * feng is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * feng is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with feng; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * */ #ifndef FN_UTILS_H #define FN_UTILS_H #include "config.h" #include <time.h> #include <sys/time.h> #include <ctype.h> #include <stdint.h> #include <sys/types.h> #include <math.h> #include <string.h> /*! autodescriptive error values */ #define ERR_NOERROR 0 #define ERR_GENERIC -1 #define ERR_ALLOC -4 #endif // FN_UTILS_H
/* * * This file is part of Feng * * Copyright (C) 2009 by LScube team <[email protected]> * See AUTHORS for more details * * feng is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * feng is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with feng; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * */ #ifndef FN_UTILS_H #define FN_UTILS_H #include "config.h" #include <time.h> #include <sys/time.h> #include <ctype.h> #include <stdint.h> #include <sys/types.h> #include <math.h> #include <string.h> #endif // FN_UTILS_H
Remove the remaining ERR_ constants that are never used or tested for.
Remove the remaining ERR_ constants that are never used or tested for.
C
lgpl-2.1
winlinvip/feng,lscube/feng,winlinvip/feng,lscube/feng,winlinvip/feng,lscube/feng
ba6d38ac0611239a1fa7d05b9c915dbff201c082
ext/librtlsdr/librtlsdr.c
ext/librtlsdr/librtlsdr.c
#include "ruby.h" #include "rtl-sdr.h" VALUE m_turtleshell = Qnil; static VALUE m_rtlsdr; static VALUE turtleshell_count() { return INT2NUM(rtlsdr_get_device_count()); } static VALUE turtleshell_new_device() { char *name; rtlsdr_dev_t *device = NULL; int count = rtlsdr_get_device_count(); // ensure we have at least one device if (!count) { return Qnil; } name = rtlsdr_get_device_name(0); device = rtlsdr_open(&device, 0); VALUE device_hash = rb_hash_new(); rb_hash_aset(device_hash, rb_str_new2("name"), rb_str_new2(rtlsdr_get_device_name(0))); rb_hash_aset(device_hash, rb_str_new2("device_handle"), device); return device_hash; } void Init_librtlsdr() { m_turtleshell = rb_define_module("TurtleShell"); m_rtlsdr = rb_define_module_under(m_turtleshell, "RTLSDR"); rb_define_module_function(m_rtlsdr, "count", turtleshell_count, 0); rb_define_module_function(m_rtlsdr, "first_device", turtleshell_new_device, 0); }
#include "ruby.h" #include "rtl-sdr.h" VALUE m_turtleshell = Qnil; VALUE c_device; static VALUE m_rtlsdr; static VALUE turtleshell_count() { return INT2NUM(rtlsdr_get_device_count()); } static VALUE turtleshell_new_device() { rtlsdr_dev_t *device = NULL; VALUE wrapped_device; VALUE hash; int count = rtlsdr_get_device_count(); // ensure we have at least one device if (!count) { return Qnil; } device = rtlsdr_open(&device, 0); wrapped_device = Data_Wrap_Struct(c_device, NULL, NULL, device); hash = rb_hash_new(); rb_hash_aset(hash, rb_str_new2("name"), rb_str_new2(rtlsdr_get_device_name(0))); rb_hash_aset(hash, rb_str_new2("device_handle"), wrapped_device); return hash; } void Init_librtlsdr() { m_turtleshell = rb_define_module("TurtleShell"); m_rtlsdr = rb_define_module_under(m_turtleshell, "RTLSDR"); c_device = rb_define_class_under(m_rtlsdr, "Device", rb_cObject); rb_define_module_function(m_rtlsdr, "count", turtleshell_count, 0); rb_define_module_function(m_rtlsdr, "first_device", turtleshell_new_device, 0); }
Fix a few warnings that prevented Travis from compiling
Fix a few warnings that prevented Travis from compiling
C
mit
tjarratt/turtleshell,tjarratt/turtleshell
e4cb644925142ac45cdfb70244a2751f6cab1e21
backend-test.c
backend-test.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "expression.h" #include "stream.h" #include "parser.h" #include "analyze.h" #include "generator.h" #include "backend.h" #include "optimize.h" int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "usage: backend-test <input-file> <output-file>\n"); exit(1); } FILE *src = fopen(argv[1], "r"); if (src == NULL) { fprintf(stderr, "backend-test: no such file or directory\n"); return 1; } stream *in = open_stream(src); block_statement *block = parse(in); close_stream(in); fclose(src); analyze(block); code_system *system = generate(block); optimize(system); FILE *out = fopen(argv[2], "w"); if (out == NULL) { fprintf(stderr, "backend-test: error opening output-file\n"); return 1; } backend_write(system, out); fflush(out); fclose(out); return 0; }
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "expression.h" #include "stream.h" #include "parser.h" #include "analyze.h" #include "generator.h" #include "backend.h" #include "optimize.h" int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "usage: backend-test <input-file> <output-file>\n"); return 1; } FILE *src = fopen(argv[1], "r"); if (src == NULL) { fprintf(stderr, "backend-test: no such file or directory\n"); return 1; } stream *in = open_stream(src); block_statement *block = parse(in); close_stream(in); fclose(src); analyze(block); code_system *system = generate(block); optimize(system); FILE *out = fopen(argv[2], "w"); if (out == NULL) { fprintf(stderr, "backend-test: error opening output-file\n"); return 1; } backend_write(system, out); fflush(out); fclose(out); return 0; }
Return with exit code from main functions
Return with exit code from main functions Signed-off-by: Eli Skeggs <[email protected]>
C
mit
bearhub/cub,bearhub/cub,bearhub/cub,bearhub/cub
5b84323c7ee21aa7f54fc912d8ef5c8d128ff3ca
compat.h
compat.h
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_STRCASECMP extern int strcasecmp(const char*, const char*); #endif #ifndef HAVE_STRNCASECMP extern int strncasecmp(const char*, const char*, unsigned int); #endif #endif
Add include file for standard unix functions we have to provide for systems like Windows
Add include file for standard unix functions we have to provide for systems like Windows
C
epl-1.0
tkelman/graphviz,BMJHayward/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,pixelglow/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,ellson/graphviz,tkelman/graphviz,ellson/graphviz,pixelglow/graphviz,kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz,jho1965us/graphviz,kbrock/graphviz,MjAbuz/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,kbrock/graphviz,ellson/graphviz,MjAbuz/graphviz,ellson/graphviz,jho1965us/graphviz,kbrock/graphviz,tkelman/graphviz,MjAbuz/graphviz,ellson/graphviz,pixelglow/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,kbrock/graphviz,MjAbuz/graphviz,tkelman/graphviz,pixelglow/graphviz,MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,kbrock/graphviz,ellson/graphviz,kbrock/graphviz,pixelglow/graphviz,tkelman/graphviz,pixelglow/graphviz,ellson/graphviz,BMJHayward/graphviz,tkelman/graphviz,pixelglow/graphviz,MjAbuz/graphviz,jho1965us/graphviz,ellson/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,ellson/graphviz
4b6c83f57874c2ac10b450ba0f57db0a0f22db67
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2006 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k1"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2006 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k2"
Update driver version to 5.02.00-k2
[SCSI] qla4xxx: Update driver version to 5.02.00-k2 Signed-off-by: Vikas Chaudhary <[email protected]> Signed-off-by: Ravi Anand <[email protected]> Signed-off-by: James Bottomley <[email protected]>
C
mit
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,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
3706f0cdb921e128043dcb2c9c2017af237d44ae
gen-system.c
gen-system.c
#include <stdio.h> #include <stdint.h> #include <stdlib.h> int main(int argc, char **argv) { printf("#include <stdint.h>\n" "#include \"mako-vm.h\"\n" "char *argv0;\n" "int32_t mem[] = {"); while(!feof(stdin)) { uint8_t buf[4]; int n = fread(buf, sizeof *buf, 4, stdin); if(ferror(stdin)) goto onerr; if(n == 0) break; if(n != 4) { fprintf(stderr, "%s: The file was invalid.\n", argv[0]); exit(1); } printf("0x%04X,", (int32_t)buf[0] << 24 | (int32_t)buf[1] << 16 | (int32_t)buf[2] << 8 | (int32_t)buf[3]); } printf("0};\n" "int main(int argc, char **argv)\n" "{\n" "\targv0 = argv[0];\n" "\trun_vm(mem);\n" "}\n"); exit(0); onerr: perror(argv[0]); exit(1); }
Add simple program to generate binaries with a baked-in ROM
Add simple program to generate binaries with a baked-in ROM
C
mit
pikhq/cmako,pikhq/cmako
6d34325292e78812b1ba06ebb711aa5941a2212a
src/soft/float/extenddftf2.c
src/soft/float/extenddftf2.c
/* This file is part of Metallic, a runtime library for WebAssembly. * * Copyright (C) 2018 Chen-Pang He <[email protected]> * * This Source Code Form is subject to the terms of the Mozilla * Public License v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at http://mozilla.org/MPL/2.0/ */ #include "../../math/reinterpret.h" #include "../../math/double/normalize.h" #include <math.h> #include <stdint.h> static __int128 _magnitude(int64_t i) { if (i >= 0x7FF0000000000000) return (__int128)0x78 << 120 | (__int128)i << 60; return i ? ((__int128)0x3C << 120) + ((__int128)_normalize(i) << 60) : 0; } long double __extenddftf2(double x) { int64_t i = reinterpret(int64_t, fabs(x)); return copysignl(reinterpret(long double, _magnitude(i)), x); }
Implement double to long double conversion
Implement double to long double conversion
C
mit
jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic
73cfbf47cc0f13db91e461d98081503597d3d50b
Kiwi/KWFutureObject.h
Kiwi/KWFutureObject.h
// // KWFutureObject.h // iOSFalconCore // // Created by Luke Redpath on 13/01/2011. // Copyright 2011 LJR Software Limited. All rights reserved. // #import <Foundation/Foundation.h> typedef id (^KWFutureObjectBlock)(void); @interface KWFutureObject : NSObject { __weak id *objectPointer; KWFutureObjectBlock block; } + (id)objectWithObjectPointer:(id *)pointer; + (id)objectWithReturnValueOfBlock:(KWFutureObjectBlock)block; - (id)initWithObjectPointer:(id *)pointer; - (id)initWithBlock:(KWFutureObjectBlock)aBlock; - (id)object; @end
// // KWFutureObject.h // iOSFalconCore // // Created by Luke Redpath on 13/01/2011. // Copyright 2011 LJR Software Limited. All rights reserved. // #import <Foundation/Foundation.h> #ifdef __weak #undef __weak #define __weak __unsafe_unretained #endif typedef id (^KWFutureObjectBlock)(void); @interface KWFutureObject : NSObject { __weak id *objectPointer; KWFutureObjectBlock block; } + (id)objectWithObjectPointer:(id *)pointer; + (id)objectWithReturnValueOfBlock:(KWFutureObjectBlock)block; - (id)initWithObjectPointer:(id *)pointer; - (id)initWithBlock:(KWFutureObjectBlock)aBlock; - (id)object; @end
Work arounf use of weak when deployment target it iOS 4
Work arounf use of weak when deployment target it iOS 4
C
bsd-3-clause
carezone/Kiwi,carezone/Kiwi,tcirwin/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,tcirwin/Kiwi,unisontech/Kiwi,tangwei6423471/Kiwi,iosRookie/Kiwi,TaemoonCho/Kiwi,ecaselles/Kiwi,indiegogo/Kiwi,ashfurrow/Kiwi,TaemoonCho/Kiwi,unisontech/Kiwi,LiuShulong/Kiwi,weslindsay/Kiwi,ecaselles/Kiwi,depop/Kiwi,JoistApp/Kiwi,indiegogo/Kiwi,iosRookie/Kiwi,ecaselles/Kiwi,alloy/Kiwi,allending/Kiwi,depop/Kiwi,LiuShulong/Kiwi,TaemoonCho/Kiwi,hyperoslo/Tusen,emodeqidao/Kiwi,tcirwin/Kiwi,howandhao/Kiwi,emodeqidao/Kiwi,PaulTaykalo/Kiwi,emodeqidao/Kiwi,tangwei6423471/Kiwi,weslindsay/Kiwi,tangwei6423471/Kiwi,iosRookie/Kiwi,PaulTaykalo/Kiwi,tonyarnold/Kiwi,PaulTaykalo/Kiwi,hyperoslo/Tusen,carezone/Kiwi,JoistApp/Kiwi,samkrishna/Kiwi,cookov/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,PaulTaykalo/Kiwi,alloy/Kiwi,allending/Kiwi,LiuShulong/Kiwi,LiuShulong/Kiwi,cookov/Kiwi,tonyarnold/Kiwi,hyperoslo/Tusen,tonyarnold/Kiwi,samkrishna/Kiwi,tangwei6423471/Kiwi,unisontech/Kiwi,depop/Kiwi,emodeqidao/Kiwi,iosRookie/Kiwi,JoistApp/Kiwi,cookov/Kiwi,samkrishna/Kiwi,alloy/Kiwi,howandhao/Kiwi,ecaselles/Kiwi,hyperoslo/Tusen,unisontech/Kiwi,ashfurrow/Kiwi,ashfurrow/Kiwi,indiegogo/Kiwi,weslindsay/Kiwi,JoistApp/Kiwi,weslindsay/Kiwi,howandhao/Kiwi,indiegogo/Kiwi,allending/Kiwi,cookov/Kiwi,allending/Kiwi,depop/Kiwi,samkrishna/Kiwi,tcirwin/Kiwi
6a5c8ff1c43fcd7ff227bd08b283f1d3d34d28d8
cpu/avr/dev/uart1.h
cpu/avr/dev/uart1.h
/* Copied from mc1322x/dev/cpu. This file exists as a work-around for the hardware dependant calls to slip_arch_init. Current the prototype for slip_arch_init is slip_arch_init(urb) and a typical call is something like slip_arch_init(BAUD2URB(115200)) BAUD2UBR is hardware specific, however. Furthermore, for the sky platform it's typically defined with #include "dev/uart1.h" (see rpl-boarder-router/slip-bridge.c), a sky specific file. dev/uart1.h includes msp430.h which includes the sky contiki-conf.h which defines BAUD2UBR. To me, the correct think to pass is simply the baudrate and have the hardware specific conversion happen inside slip_arch_init. Notably, most implementations just ignore the passed parameter anyway. (except AVR) */ #ifndef DEV_UART1_H #define DEV_UART1_H #define BAUD2UBR(x) x #endif
Include file needed for slip rpl-border-router build
Include file needed for slip rpl-border-router build
C
bsd-3-clause
bluerover/6lbr,bluerover/6lbr,arurke/contiki,bluerover/6lbr,bluerover/6lbr,MohamedSeliem/contiki,bluerover/6lbr,MohamedSeliem/contiki,MohamedSeliem/contiki,arurke/contiki,MohamedSeliem/contiki,arurke/contiki,arurke/contiki,bluerover/6lbr,bluerover/6lbr,MohamedSeliem/contiki,arurke/contiki,MohamedSeliem/contiki,arurke/contiki,arurke/contiki,MohamedSeliem/contiki
9e03ac35be0c5cf0a420b529752bbde619d60bac
src/collectionhashing.h
src/collectionhashing.h
// Copyright (c) 2017-2019 The Swipp developers // Copyright (c) 2019-2020 The Neutron Developers // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING.daemon or http://www.opensource.org/licenses/mit-license.php. #ifndef NEUTRON_COLLECTIONHASHING_H #define NEUTRON_COLLECTIONHASHING_H #include <cstddef> #include <utility> #include <tr1/functional> #include <boost/functional/hash.hpp> #include "robinhood.h" #include "uint256.h" namespace std { template<> struct hash<uint256> { size_t operator()(const uint256& v) const { return robin_hood::hash_bytes(v.begin(), v.size()); } }; } #endif
// Copyright (c) 2017-2019 The Swipp developers // Copyright (c) 2019-2020 The Neutron Developers // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING.daemon or http://www.opensource.org/licenses/mit-license.php. #ifndef NEUTRON_COLLECTIONHASHING_H #define NEUTRON_COLLECTIONHASHING_H #include <cstddef> #include <utility> #include <functional> #include <boost/functional/hash.hpp> #include "robinhood.h" #include "uint256.h" namespace std { template<> struct hash<uint256> { size_t operator()(const uint256& v) const { return robin_hood::hash_bytes(v.begin(), v.size()); } }; } #endif
Use <functional> instead of <tr/functional>
Use <functional> instead of <tr/functional> This is deprecated and adopted by the standard since a long time.
C
mit
neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron
e7144a38b98164e74062c764747ce0ab1cbc514c
alura/c/adivinhacao.c
alura/c/adivinhacao.c
#include <stdio.h> #define NUMERO_DE_TENTATIVAS 5 int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; for(int i = 1; i <= NUMERO_DE_TENTATIVAS; i++) { printf("Tentativa %d de %d\n", i, NUMERO_DE_TENTATIVAS); printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); if(chute < 0) { printf("Você não pode chutar números negativos!\n"); i--; continue; } int acertou = chute == numerosecreto; int maior = chute > numerosecreto; int menor = chute < numerosecreto; if(acertou) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); break; } else if(maior) { printf("Seu chute foi maior que o número secreto\n"); } else { printf("Seu chute foi menor que o número secreto\n"); } } printf("Fim de jogo!\n"); }
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; int tentativas = 1; while(1) { printf("Tentativa %d\n", tentativas); printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); if(chute < 0) { printf("Você não pode chutar números negativos!\n"); continue; } int acertou = chute == numerosecreto; int maior = chute > numerosecreto; if(acertou) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); break; } else if(maior) { printf("Seu chute foi maior que o número secreto\n"); } else { printf("Seu chute foi menor que o número secreto\n"); } tentativas++; } printf("Fim de jogo!\n"); printf("Você acertou em %d tentativas!\n", tentativas); }
Update files, Alura, Introdução a C, Aula 2.10
Update files, Alura, Introdução a C, Aula 2.10
C
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
0205d0b2e73e5bda5c045ae31edd05d5b9b688ec
ossfuzz/matio_wrap.h
ossfuzz/matio_wrap.h
// Copyright 2019 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that // require a file instead of an input buffer. #include <cstddef> #include <cstdint> #include <cstdlib> #include "matio.h" int MatioRead(const char* file_name) { mat_t* matfd = Mat_Open(file_name, MAT_ACC_RDONLY); if (matfd == nullptr) { return 0; } size_t n = 0; Mat_GetDir(matfd, &n); Mat_Rewind(matfd); matvar_t* matvar = nullptr; while ((matvar = Mat_VarReadNextInfo(matfd)) != nullptr) { Mat_VarReadDataAll(matfd, matvar); Mat_VarGetSize(matvar); Mat_VarFree(matvar); } Mat_Close(matfd); return 0; }
// Copyright 2019 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef MATIO_WRAP_H_ #define MATIO_WRAP_H_ #include <cstddef> #include <cstdint> #include <cstdlib> #include "matio.h" int MatioRead(const char* file_name) { mat_t* matfd = Mat_Open(file_name, MAT_ACC_RDONLY); if (matfd == nullptr) { return 0; } size_t n = 0; Mat_GetDir(matfd, &n); Mat_Rewind(matfd); matvar_t* matvar = nullptr; while ((matvar = Mat_VarReadNextInfo(matfd)) != nullptr) { Mat_VarReadDataAll(matfd, matvar); Mat_VarGetSize(matvar); Mat_VarFree(matvar); } Mat_Close(matfd); return 0; } #endif
Remove comment and add include guard
Remove comment and add include guard
C
bsd-2-clause
tbeu/matio,MaartenBent/matio,tbeu/matio,tbeu/matio,MaartenBent/matio,tbeu/matio,MaartenBent/matio,MaartenBent/matio
980438ded0a0178799394a732c80c2d66817fe82
xchainer/cuda/cuda_runtime.h
xchainer/cuda/cuda_runtime.h
#pragma once #include <cuda_runtime.h> #include "xchainer/error.h" namespace xchainer { namespace cuda { class RuntimeError : public XchainerError { public: explicit RuntimeError(cudaError_t error); cudaError_t error() const noexcept { return error_; } private: cudaError_t error_; }; void CheckError(cudaError_t error); // Occupancy #ifdef __CUDACC__ struct GridBlockSize { int grid_size; int block_size; }; template <typename T> GridBlockSize CudaOccupancyMaxPotentialBlockSize(T&& func, size_t dynamic_smem_size = 0, int block_size_limit = 0) { GridBlockSize ret; CheckError( cudaOccupancyMaxPotentialBlockSize(&ret.grid_size, &ret.block_size, std::forward<T>(func), dynamic_smem_size, block_size_limit)); return ret; } #endif // __CUDACC__ } // namespace cuda } // namespace xchainer
#pragma once #include <cuda_runtime.h> #include "xchainer/error.h" namespace xchainer { namespace cuda { class RuntimeError : public XchainerError { public: explicit RuntimeError(cudaError_t error); cudaError_t error() const noexcept { return error_; } private: cudaError_t error_; }; void CheckError(cudaError_t error); // Occupancy #ifdef __CUDACC__ struct GridBlockSize { int grid_size; int block_size; }; template <typename T> GridBlockSize CudaOccupancyMaxPotentialBlockSize(const T& func, size_t dynamic_smem_size = 0, int block_size_limit = 0) { GridBlockSize ret = {}; CheckError( cudaOccupancyMaxPotentialBlockSize(&ret.grid_size, &ret.block_size, func, dynamic_smem_size, block_size_limit)); return ret; } #endif // __CUDACC__ } // namespace cuda } // namespace xchainer
Use const T& instead of T&&
Use const T& instead of T&&
C
mit
tkerola/chainer,hvy/chainer,okuta/chainer,pfnet/chainer,ktnyt/chainer,wkentaro/chainer,niboshi/chainer,okuta/chainer,hvy/chainer,hvy/chainer,okuta/chainer,wkentaro/chainer,jnishi/chainer,ktnyt/chainer,hvy/chainer,chainer/chainer,keisuke-umezawa/chainer,wkentaro/chainer,niboshi/chainer,jnishi/chainer,jnishi/chainer,keisuke-umezawa/chainer,chainer/chainer,niboshi/chainer,keisuke-umezawa/chainer,ktnyt/chainer,niboshi/chainer,ktnyt/chainer,keisuke-umezawa/chainer,jnishi/chainer,wkentaro/chainer,chainer/chainer,okuta/chainer,chainer/chainer
07d0cafdf2018e8789e4e0671eb0ccc8bbc5c186
contrib/sendmail/mail.local/pathnames.h
contrib/sendmail/mail.local/pathnames.h
/*- * 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"
/*- * 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"
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
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
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
83683ddd3d704e2d8c1fe9bef9eabb4639c0846a
plat/qemu/common/qemu_stack_protector.c
plat/qemu/common/qemu_stack_protector.c
/* * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <stdint.h> #include <arch_helpers.h> #include <plat/common/platform.h> #define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL) u_register_t plat_get_stack_protector_canary(void) { /* * Ideally, a random number should be returned instead of the * combination of a timer's value and a compile-time constant. * As the virt platform does not have any random number generator, * this is better than nothing but not necessarily really secure. */ return RANDOM_CANARY_VALUE ^ read_cntpct_el0(); }
/* * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <stdint.h> #include <arch_helpers.h> #include <arch_features.h> #include <plat/common/platform.h> #define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL) u_register_t plat_get_stack_protector_canary(void) { #if ENABLE_FEAT_RNG /* Use the RNDR instruction if the CPU supports it */ if (is_armv8_5_rng_present()) { return read_rndr(); } #endif /* * Ideally, a random number should be returned above. If a random * number generator is not supported, return instead a * combination of a timer's value and a compile-time constant. * This is better than nothing but not necessarily really secure. */ return RANDOM_CANARY_VALUE ^ read_cntpct_el0(); }
Use RNDR in stack protector
plat/qemu: Use RNDR in stack protector When getting a stack protector canary value, check if cpu supports FEAT_RNG and use that. Fallback to old method of using a (hardcoded value ^ timer). Signed-off-by: Tomas Pilar <[email protected]> Change-Id: I8181acf8e31661d4cc82bc3a4078f8751909e725
C
bsd-3-clause
achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware
1cb3ecbcbd1267f8ad6d896c2a3bae9590f3e6c6
print_numbers.c
print_numbers.c
#include <stdio.h> #include <pthread.h> #include <stdlib.h> #include <stdbool.h> #include <errno.h> #include <unistd.h> pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t condition = PTHREAD_COND_INITIALIZER; bool turn = true; int counter = 0; void* even_thread(void* arg) { do { pthread_mutex_lock(&mutex); if (counter % 2 == 0) { pthread_cond_wait(&condition, &mutex); } fprintf(stdout, "%d\n", counter); fflush(stdout); counter++; pthread_cond_signal(&condition); pthread_mutex_unlock(&mutex); sleep(3); } while (1); } void* odd_thread(void* arg) { do { pthread_mutex_lock(&mutex); if (counter % 2 != 0) { pthread_cond_wait(&condition, &mutex); } fprintf(stdout, "%d\n", counter); fflush(stdout); counter++; pthread_cond_signal(&condition); pthread_mutex_unlock(&mutex); sleep(1); } while (1); } int main(int argc, char** argv) { pthread_t odd_thr, even_thr; int rc = 0; rc = pthread_create(&odd_thr, NULL, odd_thread, NULL); if (rc < 0) { fprintf(stderr, "Error creating an odd thread! %d\n", errno); fflush(stderr); exit(EXIT_FAILURE); } rc = pthread_create(&even_thr, NULL, even_thread, NULL); if (rc < 0) { fprintf(stderr, "Error creating an even thread! %d\n", errno); fflush(stderr); exit(EXIT_FAILURE); } rc = pthread_join(odd_thr, NULL); if (rc < 0) { fprintf(stderr, "Error in pthread_join with odd thread! %d\n", errno); fflush(stderr); exit(EXIT_FAILURE); } rc = pthread_join(even_thr, NULL); if (rc < 0) { fprintf(stderr, "Error in pthread_join with even thread! %d\n", errno); fflush(stderr); exit(EXIT_FAILURE); } return EXIT_SUCCESS; }
Add printing even and odd numbers in separate threads.
Add printing even and odd numbers in separate threads.
C
apache-2.0
tisma/ctorious,tisma/ctorious
55f424506979eb1eb19ce95dc3072daa51c74efb
src/serialize/json/string_jump_state.c
src/serialize/json/string_jump_state.c
/* * waysome - wayland based window manager * * Copyright in alphabetical order: * * Copyright (C) 2014-2015 Julian Ganz * Copyright (C) 2014-2015 Manuel Messner * Copyright (C) 2014-2015 Marcel Müller * Copyright (C) 2014-2015 Matthias Beyer * Copyright (C) 2014-2015 Nadja Sommerfeld * * This file is part of waysome. * * waysome is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 2.1 of the License, or (at your option) * any later version. * * waysome is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with waysome. If not, see <http://www.gnu.org/licenses/>. */ #include <stddef.h> #include <string.h> #include "serialize/json/keys.h" #include "serialize/json/states.h" #include "serialize/json/string_jump_state.h" /** * Map for mapping the current state with a string on the next state */ static const struct { enum json_backend_state current; enum json_backend_state next; const char* str; } MAP[] = { { .current = STATE_MSG, .next = STATE_UID, .str = UID }, { .current = STATE_MSG, .next = STATE_TYPE, .str = TYPE }, { .current = STATE_MSG, .next = STATE_COMMANDS, .str = COMMANDS }, { .str = NULL }, }; /* * * Interface implementation * */ enum json_backend_state get_next_state_for_string( enum json_backend_state current, const unsigned char * str ) { //!< @todo implement return 0; }
Add string jump state source file including stub
Add string jump state source file including stub
C
lgpl-2.1
waysome/waysome,waysome/waysome
0ef9cdb035524ebd26d350b364bb4b1520343f97
Clue/Classes/Protocols/CLUInteractionObserverDelegate.h
Clue/Classes/Protocols/CLUInteractionObserverDelegate.h
// // CLUInteractionObserver.h // Clue // // Created by Ahmed Sulaiman on 6/7/16. // Copyright © 2016 Ahmed Sulaiman. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @protocol CLUInteractionObserverDelegate <NSObject> @required - (void)touchesBegan:(NSSet<UITouch *> *)touches; - (void)touchesMoved:(NSArray<UITouch *> *)touches; - (void)touchesEnded:(NSSet<UITouch *> *)touches; @end
// // CLUInteractionObserver.h // Clue // // Created by Ahmed Sulaiman on 6/7/16. // Copyright © 2016 Ahmed Sulaiman. All rights reserved. // #import <Foundation/Foundation.h> #import "CLUTouch.h" @protocol CLUInteractionObserverDelegate <NSObject> @required - (void)touchesBegan:(NSArray<CLUTouch *> *)touches; - (void)touchesMoved:(NSArray<CLUTouch *> *)touches; - (void)touchesEnded:(NSArray<CLUTouch *> *)touches; @end
Change Interaction Observer Delegate to use Clue Touch model and NSArray instead of NSSet
Change Interaction Observer Delegate to use Clue Touch model and NSArray instead of NSSet
C
mit
Geek-1001/Clue,Geek-1001/Clue,Geek-1001/Clue,Geek-1001/Clue
43795e05bc7b112ba242ec7a9951f30dd4978a9e
io/file_descriptor.h
io/file_descriptor.h
#ifndef FILE_DESCRIPTOR_H #define FILE_DESCRIPTOR_H #include <io/channel.h> class FileDescriptor : public Channel { LogHandle log_; protected: int fd_; public: FileDescriptor(int); ~FileDescriptor(); Action *close(EventCallback *); Action *read(size_t, EventCallback *); Action *write(Buffer *, EventCallback *); }; #endif /* !FILE_DESCRIPTOR_H */
#ifndef FILE_DESCRIPTOR_H #define FILE_DESCRIPTOR_H #include <io/channel.h> class FileDescriptor : public Channel { LogHandle log_; protected: int fd_; public: FileDescriptor(int); ~FileDescriptor(); virtual Action *close(EventCallback *); virtual Action *read(size_t, EventCallback *); virtual Action *write(Buffer *, EventCallback *); }; #endif /* !FILE_DESCRIPTOR_H */
Make close, read and write virtual.
Make close, read and write virtual. git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@192 4068ffdb-0463-0410-8185-8cc71e3bd399
C
bsd-2-clause
diegows/wanproxy,diegows/wanproxy,splbio/wanproxy,splbio/wanproxy,splbio/wanproxy,diegows/wanproxy
bd08163aa2c0067a06638dcaefd1cd14461adea5
gass/file/source/globus_gass_file.h
gass/file/source/globus_gass_file.h
/****************************************************************************** globus_gass_file_api.h Description: This header contains the GASS File Access API definitions CVS Information: $Source$ $Date$ $Revision$ $Author$ ******************************************************************************/ #ifndef _GLOBUS_GASS_INCLUDE_GLOBUS_GASS_FILE_API_H #define _GLOBUS_GASS_INCLUDE_GLOBUS_GASS_FILE_API_H #ifndef EXTERN_C_BEGIN #ifdef __cplusplus #define EXTERN_C_BEGIN extern "C" { #define EXTERN_C_END } #else #define EXTERN_C_BEGIN #define EXTERN_C_END #endif #endif #include <stdio.h> EXTERN_C_BEGIN int globus_gass_open(char *file, int oflags, ...); FILE *globus_gass_fopen(char *file, char *mode); int globus_gass_close(int fd); int globus_gass_fclose(FILE *f); /****************************************************************************** * Module Definition *****************************************************************************/ extern globus_module_descriptor_t globus_i_gass_file_module; #define GLOBUS_GASS_FILE_MODULE (&globus_i_gass_file_module) EXTERN_C_END #endif
/****************************************************************************** globus_gass_file_api.h Description: This header contains the GASS File Access API definitions CVS Information: $Source$ $Date$ $Revision$ $Author$ ******************************************************************************/ #ifndef _GLOBUS_GASS_INCLUDE_GLOBUS_GASS_FILE_API_H #define _GLOBUS_GASS_INCLUDE_GLOBUS_GASS_FILE_API_H #ifndef EXTERN_C_BEGIN #ifdef __cplusplus #define EXTERN_C_BEGIN extern "C" { #define EXTERN_C_END } #else #define EXTERN_C_BEGIN #define EXTERN_C_END #endif #endif #include <stdio.h> #include "globus_gass_common.h" EXTERN_C_BEGIN int globus_gass_open(char *file, int oflags, ...); FILE *globus_gass_fopen(char *file, char *mode); int globus_gass_close(int fd); int globus_gass_fclose(FILE *f); /****************************************************************************** * Module Definition *****************************************************************************/ extern globus_module_descriptor_t globus_i_gass_file_module; #define GLOBUS_GASS_FILE_MODULE (&globus_i_gass_file_module) EXTERN_C_END #endif
Add inclusion of globus_gass_common.h so end user does not need this inclusion
Add inclusion of globus_gass_common.h so end user does not need this inclusion
C
apache-2.0
ellert/globus-toolkit,ellert/globus-toolkit,ellert/globus-toolkit,globus/globus-toolkit,globus/globus-toolkit,ellert/globus-toolkit,gridcf/gct,gridcf/gct,globus/globus-toolkit,globus/globus-toolkit,globus/globus-toolkit,gridcf/gct,gridcf/gct,ellert/globus-toolkit,globus/globus-toolkit,ellert/globus-toolkit,globus/globus-toolkit,gridcf/gct,globus/globus-toolkit,ellert/globus-toolkit,ellert/globus-toolkit,gridcf/gct
0a2d85484ad324195537b20c7691a4b49868b76f
Sensorama/Sensorama/SRUtils.h
Sensorama/Sensorama/SRUtils.h
// // SRUtils.h // Sensorama // // Created by Wojciech Koszek (home) on 3/1/16. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // @import Foundation; @import UIKit; @interface SRUtils : NSObject + (UIColor *)mainColor; + (NSDictionary *)deviceInfo; + (NSString*)computeSHA256DigestForString:(NSString*)input; + (BOOL)isSimulator; + (NSString *)activityString:(CMMotionActivity *)activity; + (NSInteger)activityInteger:(CMMotionActivity *)activity; @end
// // SRUtils.h // Sensorama // // Created by Wojciech Koszek (home) on 3/1/16. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // @import Foundation; @import UIKit; @import CoreMotion; @interface SRUtils : NSObject + (UIColor *)mainColor; + (NSDictionary *)deviceInfo; + (NSString*)computeSHA256DigestForString:(NSString*)input; + (BOOL)isSimulator; + (NSString *)activityString:(CMMotionActivity *)activity; + (NSInteger)activityInteger:(CMMotionActivity *)activity; @end
Add CoreMotion so that types can be detected
Add CoreMotion so that types can be detected
C
bsd-2-clause
wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios
bb45039fab4071893154345415ad961391733c2d
include/llvm/Transforms/SampleProfile.h
include/llvm/Transforms/SampleProfile.h
//===- Transforms/SampleProfile.h - SamplePGO pass--------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// This file provides the interface for the sampled PGO loader pass. //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_SAMPLEPROFILE_H #define LLVM_TRANSFORMS_SAMPLEPROFILE_H #include "llvm/IR/PassManager.h" namespace llvm { /// The instrumentation (profile-instr-gen) pass for IR based PGO. class SampleProfileLoaderPass : public PassInfoMixin<SampleProfileLoaderPass> { public: PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM); }; } // End llvm namespace #endif
//===- Transforms/SampleProfile.h - SamplePGO pass--------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// This file provides the interface for the sampled PGO loader pass. //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_SAMPLEPROFILE_H #define LLVM_TRANSFORMS_SAMPLEPROFILE_H #include "llvm/IR/PassManager.h" namespace llvm { /// The sample profiler data loader pass. class SampleProfileLoaderPass : public PassInfoMixin<SampleProfileLoaderPass> { public: PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM); }; } // End llvm namespace #endif
Fix wrong comment in header /NFC
Fix wrong comment in header /NFC git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@271825 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm
ff2938e75c27521a0bfd13028ccd045a349f169b
gen-system.c
gen-system.c
#include <stdio.h> #include <stdint.h> #include <stdlib.h> int main(int argc, char **argv) { printf("#include <stdint.h>\n" "#include \"mako-vm.h\"\n" "char *argv0;\n" "int32_t mem[] = {"); while(!feof(stdin)) { uint8_t buf[4]; int n = fread(buf, sizeof *buf, 4, stdin); if(ferror(stdin)) goto onerr; if(n == 0) break; if(n != 4) { fprintf(stderr, "%s: The file was invalid.\n", argv[0]); exit(1); } printf("0x%04X,", (int32_t)buf[0] << 24 | (int32_t)buf[1] << 16 | (int32_t)buf[2] << 8 | (int32_t)buf[3]); } printf("0};\n" "int main(int argc, char **argv)\n" "{\n" "\targv0 = argv[0];\n" "\trun_vm(mem);\n" "}\n"); exit(0); onerr: perror(argv[0]); exit(1); }
#include <stdio.h> #include <stdint.h> #include <stdlib.h> int main(int argc, char **argv) { printf("#include <stdint.h>\n" "#include <SDL.h>\n" "#include \"mako-vm.h\"\n" "char *argv0;\n" "int32_t mem[] = {"); while(!feof(stdin)) { uint8_t buf[4]; int n = fread(buf, sizeof *buf, 4, stdin); if(ferror(stdin)) goto onerr; if(n == 0) break; if(n != 4) { fprintf(stderr, "%s: The file was invalid.\n", argv[0]); exit(1); } printf("0x%04X,", (int32_t)buf[0] << 24 | (int32_t)buf[1] << 16 | (int32_t)buf[2] << 8 | (int32_t)buf[3]); } printf("0};\n" "int main(int argc, char **argv)\n" "{\n" "\targv0 = argv[0];\n" "\trun_vm(mem);\n" "}\n"); exit(0); onerr: perror(argv[0]); exit(1); }
Include <SDL.h> in the baked VMs, so Windows works.
Include <SDL.h> in the baked VMs, so Windows works.
C
mit
pikhq/cmako,pikhq/cmako
8c18fe2562c45180c407872d05857c55c1e5e37b
include/asm-arm/mach/map.h
include/asm-arm/mach/map.h
/* * linux/include/asm-arm/map.h * * Copyright (C) 1999-2000 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Page table mapping constructs and function prototypes */ struct map_desc { unsigned long virtual; unsigned long pfn; unsigned long length; unsigned int type; }; struct meminfo; #define MT_DEVICE 0 #define MT_CACHECLEAN 1 #define MT_MINICLEAN 2 #define MT_LOW_VECTORS 3 #define MT_HIGH_VECTORS 4 #define MT_MEMORY 5 #define MT_ROM 6 #define MT_IXP2000_DEVICE 7 #define __phys_to_pfn(paddr) (paddr >> PAGE_SHIFT) #define __pfn_to_phys(pfn) (pfn << PAGE_SHIFT) extern void create_memmap_holes(struct meminfo *); extern void memtable_init(struct meminfo *); extern void iotable_init(struct map_desc *, int); extern void setup_io_desc(void);
/* * linux/include/asm-arm/map.h * * Copyright (C) 1999-2000 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Page table mapping constructs and function prototypes */ struct map_desc { unsigned long virtual; unsigned long pfn; unsigned long length; unsigned int type; }; struct meminfo; #define MT_DEVICE 0 #define MT_CACHECLEAN 1 #define MT_MINICLEAN 2 #define MT_LOW_VECTORS 3 #define MT_HIGH_VECTORS 4 #define MT_MEMORY 5 #define MT_ROM 6 #define MT_IXP2000_DEVICE 7 #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) extern void create_memmap_holes(struct meminfo *); extern void memtable_init(struct meminfo *); extern void iotable_init(struct map_desc *, int); extern void setup_io_desc(void);
Fix buggy __phys_to_pfn / __pfn_to_phys
[ARM] Fix buggy __phys_to_pfn / __pfn_to_phys Macro arguments should _always_ be surrounded by parentheses when used to prevent unexpected problems with operator precedence. Signed-off-by: Russell King <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
440f8382b009c9af12da567119566113a89ec935
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 65 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 66 #endif
Update Skia milestone to 66
Update Skia milestone to 66 [email protected] Bug: skia: Change-Id: Ib011c6d4a6e54980d2e6e8b16a93551d99dcd948 Reviewed-on: https://skia-review.googlesource.com/97103 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]>
C
bsd-3-clause
google/skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,rubenvb/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,rubenvb/skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc
5b2ede3d0d44f5d96ccaad5d72df41c1df678708
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 84 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 85 #endif
Update Skia milestone to 85
Update Skia milestone to 85 Change-Id: If6f878b896397ec1946a0b29b10764722b35d737 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289777 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]> Auto-Submit: Heather Miller <[email protected]>
C
bsd-3-clause
google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia
217b2661c14b7940bb273f4b793b3c6d41f7425c
ionScience/MarchingCubes.h
ionScience/MarchingCubes.h
#pragma once #include <ionScene/CSimpleMesh.h> #include "SVolume.h" struct SMarchingCubesPoint { f32 Value; vec3f Gradient; SMarchingCubesPoint() {} SMarchingCubesPoint(f32 const & value) : Value(value) {} }; typedef SVolume<SMarchingCubesPoint> SMarchingCubesVolume; void CalculateGradient(SMarchingCubesVolume & Volume); ion::Scene::CSimpleMesh * MarchingCubes(SMarchingCubesVolume & Volume);
#pragma once #include <ionScene/CSimpleMesh.h> #include "SVolume.h" struct SMarchingCubesPoint { f32 Value = 0; vec3f Gradient; SMarchingCubesPoint() {} SMarchingCubesPoint(f32 const & value) : Value(value) {} }; typedef SVolume<SMarchingCubesPoint> SMarchingCubesVolume; void CalculateGradient(SMarchingCubesVolume & Volume); ion::Scene::CSimpleMesh * MarchingCubes(SMarchingCubesVolume & Volume);
Fix marching cubes unitialized variable
[ionScience] Fix marching cubes unitialized variable
C
mit
iondune/ionEngine,iondune/ionEngine
f28cebff4d6ae816a78fe4a967d725f5c855cd60
rst_client.c
rst_client.c
#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/sctp.h> #include <arpa/inet.h> #include <string.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #define PORT 5001 #define ADDR "212.201.121.85" int main(int argc, char *argv[]) { int fd; char c; #if 1 struct sctp_reset_streams srs; #else sctp_assoc_t assoc_id; #endif struct sockaddr_in addr; if ((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) < 0) { perror("socket"); } memset(&addr, 0, sizeof(struct sockaddr_in)); addr.sin_family = AF_INET; addr.sin_len = sizeof(struct sockaddr_in); addr.sin_addr.s_addr = inet_addr(ADDR); addr.sin_port = htons(PORT); if (connect(fd, (const struct sockaddr *) &addr, sizeof(struct sockaddr_in)) != 0) { perror("connect"); } c = 'A'; if (send(fd, (const void *)&c, 1, 0) < 0) { perror("send 1"); } c = 'B'; if (send(fd, (const void *)&c, 1, 0) < 0) { perror("send 2"); } #if 1 memset(&srs, 0, sizeof(struct sctp_reset_streams)); srs.srs_flags = SCTP_STREAM_RESET_OUTGOING; srs.srs_number_streams = 0; if (setsockopt(fd, IPPROTO_SCTP, SCTP_RESET_STREAMS, &srs, (socklen_t)sizeof(struct sctp_reset_streams)) < 0) { perror("setsockopt SCTP_RESET_STREAMS"); } #else if (setsockopt(fd, IPPROTO_SCTP, SCTP_RESET_ASSOC, &assoc_id, (socklen_t)sizeof(sctp_assoc_t)) < 0) { perror("setsockopt SCTP_RESET_ASSOC"); } #endif if (close(fd) < 0) { perror("close"); } return (0); }
Add a simple test client.
Add a simple test client.
C
bsd-2-clause
sctplab/stream-reset-improved,sctplab/stream-reset-improved
431fed0108bdccf1ea8fb40b952d32ec993cfaa4
src/config.h
src/config.h
#pragma once #include <pebble.h> #define BG_COLOR GColorWhite #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12) #define BPM_FONT FONT_KEY_BITHAM_42_BOLD #define BPM_FONT_HEIGHT 42 #define BPM_DEFAULT "---" #define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD #define BPM_HINT_FONT_HEIGHT 24 #define BPM_HINT_TEXT "BPM:" #define BPM_TEXT_BUFFER_SIZE 10 #define TAP_TIMEOUT_SECONDS 2
#pragma once #include <pebble.h> #define BG_COLOR GColorWhite #ifdef PBL_ROUND #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12) #else #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2) #endif #define BPM_FONT FONT_KEY_BITHAM_42_BOLD #define BPM_FONT_HEIGHT 42 #define BPM_DEFAULT "---" #define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD #define BPM_HINT_FONT_HEIGHT 24 #define BPM_HINT_TEXT "BPM:" #define BPM_TEXT_BUFFER_SIZE 10 #define TAP_TIMEOUT_SECONDS 2
Fix cut off BPM on aplite and basalt
Fix cut off BPM on aplite and basalt Previously, BPMs that rendered wide, specifically 100.0 and simlar, would get cut off on these platforms. This change decreases border size on square watches to prevent this from happening.
C
mit
aarmea/bpm-pebble,aarmea/bpm-pebble,aarmea/bpm-pebble
380b06677936225540a538e032741e4ed7ef2d26
src/qt/bitcoinaddressvalidator.h
src/qt/bitcoinaddressvalidator.h
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base48 entry widget validator. Corrects near-miss characters and refuses characters that are no part of base48. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressValidator(QObject *parent = 0); State validate(QString &input, int &pos) const; static const int MaxAddressLength = 35; }; #endif // BITCOINADDRESSVALIDATOR_H
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base58 entry widget validator. Corrects near-miss characters and refuses characters that are not part of base58. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressValidator(QObject *parent = 0); State validate(QString &input, int &pos) const; static const int MaxAddressLength = 35; }; #endif // BITCOINADDRESSVALIDATOR_H
Fix typo in a comment: it's base58, not base48.
Fix typo in a comment: it's base58, not base48.
C
mit
MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin
ae360ba7aa18b1222a1ed92e67cbc7690e4a3f5c
src/parser.h
src/parser.h
/* * The Homework Database * * SQL Parser * * Authors: * Oliver Sharma and Joe Sventek * {oliver, joe}@dcs.gla.ac.uk * * (c) 2009. All rights reserved. */ #ifndef HWDB_PARSER_H #define HWDB_PARSER_H #include "sqlstmts.h" #include "gram.h" /* Places parsed output in externally declared global variable: * sqlstmt stmt */ void *sql_parse(char *query); void reset_statement(void); void sql_reset_parser(void *bufstate); void sql_dup_stmt(sqlstmt *dup); /* Prints externally declared global variable * sqlstmt stmt * to standard output */ void sql_print(); #endif
/* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * The Homework Database * * SQL Parser * * Authors: * Oliver Sharma and Joe Sventek * {oliver, joe}@dcs.gla.ac.uk * */ #ifndef HWDB_PARSER_H #define HWDB_PARSER_H #include "sqlstmts.h" #include "gram.h" /* Places parsed output in externally declared global variable: * sqlstmt stmt */ void *sql_parse(char *query); void reset_statement(void); void sql_reset_parser(void *bufstate); void sql_dup_stmt(sqlstmt *dup); /* Prints externally declared global variable * sqlstmt stmt * to standard output */ void sql_print(); #endif
Add BSD 3-clause open source header
Add BSD 3-clause open source header
C
bsd-3-clause
fergul/Cache,jsventek/Cache,jsventek/Cache,jsventek/Cache,fergul/Cache,fergul/Cache
7798a06a3351324b83eed8f8559bee182e0c752a
src/linux/io_event.h
src/linux/io_event.h
/* *The MIT License (MIT) * * Copyright (c) <2016> <Stephan Gatzka> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef CJET_IO_EVENT_H #define CJET_IO_EVENT_H #ifdef __cplusplus extern "C" { #endif #include <stdint.h> union io_context { void *ptr; int fd; uint32_t u32; uint64_t u64; }; struct io_event { union io_context context; int (*read_function)(union io_context*); int (*write_function)(union io_context*); }; #ifdef __cplusplus } #endif #endif
Add preliminary structure for generic io handling.
Add preliminary structure for generic io handling.
C
mit
gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet
89bba249561dc480430c64d9eecbc4af92bf6376
src/config/cearth_config.h
src/config/cearth_config.h
#ifndef _CONFIG_H_ #define _CONFIG_H_ #define LOGINDB_FILE "logindb" #define LOGINDB_MAX 100 #define LOGINDB_MAXLINE 128 #define LOGIN_COOKIEJAR "cookie" #define LOGIN_COOKIESIZE 32 #define LOGIN_TOKENSIZE 64 #define LOGIN_URLMAXSIZE 256 static const char *haven_authserv = "moltke.seatribe.se"; static const char *haven_webauth = "www.havenandhearth.com"; static const char *haven_tokenlink = "/autohaven"; static const char *cearth_config_dir = "/.cearth/"; static const char *foo = "test"; #endif
#ifndef _CONFIG_H_ #define _CONFIG_H_ #define LOGINDB_FILE "logindb" #define LOGINDB_MAX 100 #define LOGINDB_MAXLINE 128 #define LOGIN_COOKIEJAR "cookie" #define LOGIN_COOKIESIZE 32 #define LOGIN_TOKENSIZE 64 #define LOGIN_URLMAXSIZE 256 #define LOGIN_TOKSTRSTART "<property name=\"jnlp.haven.authck\" value=\"" static const char *haven_authserv = "moltke.seatribe.se"; static const char *haven_webauth = "www.havenandhearth.com"; static const char *haven_tokenlink = "/autohaven"; static const char *cearth_config_dir = "/.cearth/"; static const char *foo = "test"; #endif
Add the string to search when parsing for token from website
Add the string to search when parsing for token from website
C
mit
nyanpasu/cearth
298f58e073b2782bd264edea969769b7b5e7cf41
libc/sysdeps/linux/arm/bits/arm_asm.h
libc/sysdeps/linux/arm/bits/arm_asm.h
/* Various definitons used the the ARM uClibc assembly code. */ #ifndef _ARM_ASM_H #define _ARM_ASM_H #ifdef __thumb2__ # ifdef __ASSEMBLER__ .thumb .syntax unified # endif /* __ASSEMBLER__ */ #define IT(t, cond) i##t cond #else /* XXX: This can be removed if/when we require an assembler that supports unified assembly syntax. */ #define IT(t, cond) /* Code to return from a thumb function stub. */ #ifdef __ARM_ARCH_4T__ #define POP_RET pop {r2, pc} #else #define POP_RET pop {r2, r3}; bx r3 #endif #endif #if defined(__ARM_ARCH_6M__) /* Force arm mode to flush out errors on M profile cores. */ #undef IT #define THUMB1_ONLY 1 #endif #endif /* _ARM_ASM_H */
/* Various definitons used the the ARM uClibc assembly code. */ #ifndef _ARM_ASM_H #define _ARM_ASM_H #ifdef __thumb2__ # ifdef __ASSEMBLER__ .thumb .syntax unified # endif /* __ASSEMBLER__ */ #define IT(t, cond) i##t cond #else /* XXX: This can be removed if/when we require an assembler that supports unified assembly syntax. */ #define IT(t, cond) /* Code to return from a thumb function stub. */ # if defined __ARM_ARCH_4T__ && defined __THUMB_INTERWORK__ # define POP_RET pop {r2, r3}; bx r3 # else # define POP_RET pop {r2, pc} # endif #endif /* __thumb2__ */ #if defined(__ARM_ARCH_6M__) /* Force arm mode to flush out errors on M profile cores. */ #undef IT #define THUMB1_ONLY 1 #endif #endif /* _ARM_ASM_H */
Fix POP_RET for armv4t && interworking
arm: Fix POP_RET for armv4t && interworking It seems the condition was reversed which lead to e.g. arm-920t being confused Signed-off-by: Bernhard Reutner-Fischer <[email protected]>
C
lgpl-2.1
kraj/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,brgl/uclibc-ng,kraj/uclibc-ng,wbx-github/uclibc-ng,majek/uclibc-vx32,brgl/uclibc-ng,kraj/uClibc,brgl/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,majek/uclibc-vx32,kraj/uClibc,kraj/uclibc-ng,brgl/uclibc-ng,kraj/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,kraj/uclibc-ng,wbx-github/uclibc-ng,wbx-github/uclibc-ng,majek/uclibc-vx32,majek/uclibc-vx32,kraj/uClibc
d75a5701418bd93343473231248e44b4cb60abe2
src/article_analysis/protocol/types.h
src/article_analysis/protocol/types.h
#ifndef ARTICLE_ANALYSIS_PROTOCOL_TYPES_H_ #define ARTICLE_ANALYSIS_PROTOCOL_TYPES_H_ #include <string.h> #include <time.h> #include <string> #include <vector> namespace protocol { namespace types { /** * Type of the document's title string. */ typedef std::wstring DocTitle; /** * Type of the user name string. */ typedef std::string User; /** * Type of the document's content string. */ typedef std::wstring Content; /** * Type of of the time point. */ typedef time_t Time; /** * Type of the board. */ typedef std::string Board; /** * Enumerate of the reply mode */ enum class ReplyMode : int { GOOD = 0, NORMAL, WOO, }; /** * Number of different reply modes. */ static constexpr size_t NUM_REPLY_MODES = 3; /** * Type of a row of reply message. */ struct ReplyMessage { ReplyMode mode; User user; Content message; ReplyMessage() {} ReplyMessage(ReplyMode mode, User const& user, Content const& message) : mode(mode), user(user), message(message) {} }; /** * Type of an array of reply messages. */ typedef std::vector<ReplyMessage> ReplyMessages; /** * Meta data of a document. */ struct DocMetaData { size_t id; size_t prev_id; DocTitle title; User author; Time post_time; Board board; size_t num_reply_rows[NUM_REPLY_MODES]; DocMetaData() {} DocMetaData(size_t id, size_t prev_id, DocTitle const& title, User const& author, Time const& post_time, Board const& board, size_t num_reply_rows[NUM_REPLY_MODES]) : id(id), prev_id(prev_id), title(title), author(author), post_time(post_time), board(board) { memcpy(this->num_reply_rows, num_reply_rows, sizeof(this->num_reply_rows)); } }; /** * Real document content data. */ struct DocRealData { Content content; ReplyMessages reply_messages; DocRealData() {} DocRealData(Content const& content, ReplyMessages const& reply_messages) : content(content), reply_messages(reply_messages) {} }; } // namespace types } // namespace protocol #endif // ARTICLE_ANALYSIS_PROTOCOL_TYPES_H_
Add type definitions of structure documents
Add type definitions of structure documents As title.
C
mit
cathook/PTTArticleRecommender,cathook/PTTArticleRecommender,cathook/PTTArticleRecommender,cathook/PTTArticleRecommander,cathook/PTTArticleRecommander,cathook/PTTArticleRecommander,cathook/PTTArticleRecommender,cathook/PTTArticleRecommander,cathook/PTTArticleRecommander,cathook/PTTArticleRecommender
23287c6cc26e007c6c46eb387e5c5fd296df195e
ghighlighter/gh-datastore.c
ghighlighter/gh-datastore.c
#include <sqlite3.h> #include <string.h> #include <stdlib.h> char * gh_db_path (char *data_dir) { char *db_file = "/ghighlighter.db"; int length = strlen (data_dir); length = length + strlen (db_file); char *path = malloc (length + sizeof (char)); strcat (path, data_dir); strcat (path, db_file); return path; }
Add method to return path to db file
Add method to return path to db file
C
mit
chdorner/ghighlighter-c
1ee690946e0b9dc2a44dd673f4e62942a953bec5
include/ImageIO/CGImageSourceInternal.h
include/ImageIO/CGImageSourceInternal.h
//****************************************************************************** // // Copyright (c) 2016, Intel Corporation // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once @interface ImageSource : NSObject @property (nonatomic) NSData *data; - (instancetype)initWithData:(CFDataRef)data; - (instancetype)initWithURL:(CFURLRef)url; - (instancetype)initWithDataProvider:(CGDataProviderRef)provider; - (CFStringRef)getImageType; @end
//****************************************************************************** // // Copyright (c) 2016, Intel Corporation // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once #import <Foundation/NSObject.h> #import <CoreFoundation/CFData.h> #import <CoreFoundation/CFURL.h> #import <CoreGraphics/CoreGraphicsExport.h> @class NSData; @interface ImageSource : NSObject @property (nonatomic) NSData *data; - (instancetype)initWithData:(CFDataRef)data; - (instancetype)initWithURL:(CFURLRef)url; - (instancetype)initWithDataProvider:(CGDataProviderRef)provider; - (CFStringRef)getImageType; @end
Fix ApiAnalyzer complaints about ImageIO headers.
Fix ApiAnalyzer complaints about ImageIO headers.
C
mit
nathpete-msft/WinObjC,rajsesh-msft/WinObjC,yweijiang/WinObjC,autodesk-forks/WinObjC,yweijiang/WinObjC,bSr43/WinObjC,bbowman/WinObjC,MSFTFox/WinObjC,s5msft/WinObjC,bbowman/WinObjC,rajsesh-msft/WinObjC,MSFTFox/WinObjC,Microsoft/WinObjC,bbowman/WinObjC,vkvenkat/WinObjC,pradipd/WinObjC,ehren/WinObjC,nathpete-msft/WinObjC,afaruqui/WinObjC,yweijiang/WinObjC,Microsoft/WinObjC,bSr43/WinObjC,afaruqui/WinObjC,yweijiang/WinObjC,pradipd/WinObjC,autodesk-forks/WinObjC,s5msft/WinObjC,ehren/WinObjC,Microsoft/WinObjC,pradipd/WinObjC,bbowman/WinObjC,pradipd/WinObjC,s5msft/WinObjC,nathpete-msft/WinObjC,afaruqui/WinObjC,vkvenkat/WinObjC,bSr43/WinObjC,autodesk-forks/WinObjC,rajsesh-msft/WinObjC,s5msft/WinObjC,pradipd/WinObjC,MSFTFox/WinObjC,autodesk-forks/WinObjC,Microsoft/WinObjC,rajsesh-msft/WinObjC,ehren/WinObjC,bbowman/WinObjC,nathpete-msft/WinObjC,afaruqui/WinObjC,ehren/WinObjC,vkvenkat/WinObjC,nathpete-msft/WinObjC,bSr43/WinObjC,MSFTFox/WinObjC,ehren/WinObjC,vkvenkat/WinObjC
6aeb3c9f6d6ba11901272b53b78671bab093baab
src/serialize/json/string_jump_state.h
src/serialize/json/string_jump_state.h
/* * waysome - wayland based window manager * * Copyright in alphabetical order: * * Copyright (C) 2014-2015 Julian Ganz * Copyright (C) 2014-2015 Manuel Messner * Copyright (C) 2014-2015 Marcel Müller * Copyright (C) 2014-2015 Matthias Beyer * Copyright (C) 2014-2015 Nadja Sommerfeld * * This file is part of waysome. * * waysome is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 2.1 of the License, or (at your option) * any later version. * * waysome is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with waysome. If not, see <http://www.gnu.org/licenses/>. */ /** * @addtogroup serializer_module "Serializer module" * * @{ */ /** * @addtogroup serializer_module_json_backend "Serializer JSON backend" * * @{ */ /** * @addtogroup serializer_module_json_backend_deser "JSON backend deserializer" * * Serializer module JSON backend private utilities * * @{ */ #ifndef __WS_SERIALIZE_JSON_DESERIALIZER_STRING_JUMP_TAB_COMMON_H__ #define __WS_SERIALIZE_JSON_DESERIALIZER_STRING_JUMP_TAB_COMMON_H__ #include "serialize/json/states.h" /** * Get the next state for the current state and a string */ enum json_backend_state get_next_state_for_string( enum json_backend_state current, const unsigned char * str ); #endif //__WS_SERIALIZE_JSON_DESERIALIZER_STRING_JUMP_TAB_COMMON_H__ /** * @} */ /** * @} */ /** * @} */
Add string jump state helper interface definition
Add string jump state helper interface definition
C
lgpl-2.1
waysome/waysome,waysome/waysome
5a196100cf17c7dcee8b1be9c3155a96e7c8b047
src/otu.c
src/otu.c
/* Oxygen Toxicity Unit Calulation */ #include <math> double otu_const(double time, double o2_ratio) { double otu = 0.0; otu = time * pow(( 0.5 / (o2_ratio - 0.5)), (-5/6)); return (otu); } double otu_descend(double time, double o2_ratio_i, double o2_ratio_f) { double otu = 0.0; otu = ((3/11)*time)/(o2_ratio_f-o2_ratio_i)*((pow((o2_ratio_f - 0.5)/0.5),11/6) - pow((o2_ratio_i - 0.5)/0.5, 11/6)); return otu; }
Add the calculations for the Oxygen Toxicity Unit
Add the calculations for the Oxygen Toxicity Unit
C
isc
AquaBSD/libbuhlmann,AquaBSD/libbuhlmann,AquaBSD/libbuhlmann
dc6dfea7444709fd4a86b06a204b73f4b549ba48
src/chrono_vehicle/tracked_vehicle/road_wheel/ChSingleRoadWheel.h
src/chrono_vehicle/tracked_vehicle/road_wheel/ChSingleRoadWheel.h
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Radu Serban // ============================================================================= // // Base class for a single road wheel (template definition). // A single road wheel is of type LATERAL_PIN. // // ============================================================================= #ifndef CH_SINGLE_ROAD_WHEEL_H #define CH_SINGLE_ROAD_WHEEL_H #include "chrono_vehicle/ChApiVehicle.h" #include "chrono_vehicle/ChSubsysDefs.h" #include "chrono_vehicle/tracked_vehicle/ChRoadWheel.h" namespace chrono { namespace vehicle { /// /// /// class CH_VEHICLE_API ChSingleRoadWheel : public ChRoadWheel { public: ChSingleRoadWheel(const std::string& name ///< [in] name of the subsystem ); virtual ~ChSingleRoadWheel() {} /// Return the type of track shoe consistent with this road wheel. virtual TrackShoeType GetType() const override { return LATERAL_PIN; } /// Initialize this road wheel subsystem. virtual void Initialize(ChSharedPtr<ChBodyAuxRef> chassis, ///< [in] handle to the chassis body const ChVector<>& location ///< [in] location relative to the chassis frame ) override; /// Add visualization of the road wheel. /// This (optional) function should be called only after a call to Initialize(). /// It renders the wheel as a textured cylinder. void AddWheelVisualization() override; protected: /// Return the width of the road wheel. virtual double GetWheelWidth() const = 0; }; } // end namespace vehicle } // end namespace chrono #endif
Fix case of file name
Fix case of file name
C
bsd-3-clause
rserban/chrono,jcmadsen/chrono,armanpazouki/chrono,tjolsen/chrono,armanpazouki/chrono,dariomangoni/chrono,amelmquist/chrono,armanpazouki/chrono,rserban/chrono,armanpazouki/chrono,rserban/chrono,tjolsen/chrono,projectchrono/chrono,Milad-Rakhsha/chrono,jcmadsen/chrono,amelmquist/chrono,rserban/chrono,jcmadsen/chrono,jcmadsen/chrono,Milad-Rakhsha/chrono,Milad-Rakhsha/chrono,jcmadsen/chrono,dariomangoni/chrono,andrewseidl/chrono,andrewseidl/chrono,tjolsen/chrono,amelmquist/chrono,jcmadsen/chrono,armanpazouki/chrono,andrewseidl/chrono,andrewseidl/chrono,projectchrono/chrono,jcmadsen/chrono,dariomangoni/chrono,Milad-Rakhsha/chrono,projectchrono/chrono,rserban/chrono,rserban/chrono,amelmquist/chrono,andrewseidl/chrono,Milad-Rakhsha/chrono,armanpazouki/chrono,tjolsen/chrono,dariomangoni/chrono,dariomangoni/chrono,amelmquist/chrono,rserban/chrono,Milad-Rakhsha/chrono,projectchrono/chrono,projectchrono/chrono,tjolsen/chrono,projectchrono/chrono,dariomangoni/chrono,amelmquist/chrono
b8ce3260e50eff750d5b2426fc8317fe474018db
zmq_compat.h
zmq_compat.h
/* Copyright © 2001-2014, Canal TP and/or its affiliates. All rights reserved. This file is part of Navitia, the software to build cool stuff with public transport. Hope you'll enjoy and contribute to this project, powered by Canal TP (www.canaltp.fr). Help us simplify mobility and open public transport: a non ending quest to the responsive locomotion way of traveling! LICENCE: This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Stay tuned using twitter @navitia IRC #navitia on freenode https://groups.google.com/d/forum/navitia www.navitia.io */ /** * this file provide a compatibility layer between zmq 2 and zmq 3 * by providing a API similar to zmq 2 */ #pragma once #include <zmq.hpp> #if ZMQ_VERSION_MAJOR >= 3 namespace zmq{ void device(int, void *frontend, void *backend){ zmq::proxy(frontend, backend, NULL); } } #endif
Add a compatibility layer for zmq 3
Add a compatibility layer for zmq 3
C
agpl-3.0
pbougue/utils,xlqian/utils,CanalTP/utils,CanalTP/utils
79c31c97a5c0c1b061f18fec06d6b969d267c766
src/modules/test_map/mod.c
src/modules/test_map/mod.c
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif EAPI int elm_modapi_init(void *m) { return 1; // succeed always } EAPI int elm_modapi_shutdown(void *m) { return 1; // succeed always } EAPI Eina_Bool obj_hook(Evas_Object *obj) { return EINA_TRUE; } EAPI Eina_Bool obj_unhook(Evas_Object *obj) { return EINA_TRUE; } EAPI Eina_Bool obj_convert_geo_into_coord(const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y) { return EINA_FALSE; } EAPI Eina_Bool obj_convert_coord_into_geo(const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat) { return EINA_FALSE; } EAPI char* obj_url_request(Evas_Object *obj, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", zoom, x, y); return strdup(buf); }
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif EAPI int elm_modapi_init(void *m __UNUSED__) { return 1; // succeed always } EAPI int elm_modapi_shutdown(void *m __UNUSED__) { return 1; // succeed always } EAPI Eina_Bool obj_hook(Evas_Object *obj __UNUSED__) { return EINA_TRUE; } EAPI Eina_Bool obj_unhook(Evas_Object *obj __UNUSED__) { return EINA_TRUE; } EAPI Eina_Bool obj_convert_geo_into_coord(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, double lon __UNUSED__, double lat __UNUSED__, int size __UNUSED__, int *x __UNUSED__, int *y __UNUSED__) { return EINA_FALSE; } EAPI Eina_Bool obj_convert_coord_into_geo(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, int x __UNUSED__, int y __UNUSED__, int size __UNUSED__, double *lon __UNUSED__, double *lat __UNUSED__) { return EINA_FALSE; } EAPI char* obj_url_request(Evas_Object *obj __UNUSED__, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", zoom, x, y); return strdup(buf); }
Add UNUSED so we get a clean compile.
Add UNUSED so we get a clean compile. SVN revision: 55786
C
lgpl-2.1
rvandegrift/elementary,FlorentRevest/Elementary,tasn/elementary,tasn/elementary,tasn/elementary,FlorentRevest/Elementary,tasn/elementary,rvandegrift/elementary,tasn/elementary,FlorentRevest/Elementary,rvandegrift/elementary,FlorentRevest/Elementary,rvandegrift/elementary
7b6b9da98f07f48342a50a437e18f049c7f9537b
GITPackFile.h
GITPackFile.h
// // GITPackFile.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> @interface GITPackFile : NSObject { NSData * idxData; NSData * packData; NSString * idxPath; NSString * packPath; NSArray * idxOffsets; NSUInteger idxVersion; NSUInteger packVersion; NSUInteger numberOfObjects; } @end @property(readonly,copy) NSString * idxPath; @property(readonly,copy) NSString * packPath;
// // GITPackFile.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> @interface GITPackFile : NSObject { NSData * idxData; NSData * packData; NSString * idxPath; NSString * packPath; NSArray * idxOffsets; NSUInteger idxVersion; NSUInteger packVersion; NSUInteger numberOfObjects; } @property(readonly,copy) NSString * idxPath; @property(readonly,copy) NSString * packPath; @property(readonly,assign) NSUInteger idxVersion; @property(readonly,assign) NSUInteger packVersion; @property(readonly,assign) NSUInteger numberOfObjects; - (id)initWithPath:(NSString*)path; - (void)setPackPath:(NSString*)path; - (void)setIdxPath:(NSString*)path; - (void)openIdxAndPackFiles; - (void)readPack; - (NSData*)objectAtOffset:(NSUInteger)offset; - (NSData*)objectAtOffsetVersion1:(NSUInteger)offset; - (NSData*)objectAtOffsetVersion2:(NSUInteger)offset; - (void)readIdx; - (NSData*)dataForSha1:(NSString*)sha1; - (NSUInteger)offsetForSha1:(NSString*)sha1; @end
Add more properties and methods to help with git-pack-inspect debugging
Add more properties and methods to help with git-pack-inspect debugging
C
mit
geoffgarside/cocoagit,schacon/cocoagit,geoffgarside/cocoagit,schacon/cocoagit
08668aa02b246767ee650d63819226040f30b050
example/ex-string03.c
example/ex-string03.c
#include <stdio.h> #include "m-string.h" #include "m-dict.h" #include "m-array.h" /* Definition of an associative map string_t --> size_t */ DICT_DEF2(dict_str, string_t, size_t) #define M_OPL_dict_str_t() DICT_OPLIST(dict_str, STRING_OPLIST, M_DEFAULT_OPLIST) /* Definition of an array of string_t */ ARRAY_DEF(vector_str, string_t) #define M_OPL_vector_str_t() ARRAY_OPLIST(vector_str, STRING_OPLIST) int main(void) { // Construct an array of string, performing a convertion of the C const char * // into a proper string_t at real time and push then into a dynamic array // that is declared, initialized and cleared. M_LET( (words, ("This"), ("is"), ("a"), ("useless"), ("sentence"), ("."), ("It"), ("is"), ("used"), ("a"), ("bit"), ("to"), ("count"), ("words"), (".") ), vector_str_t) { // Print the arrays. printf("The words are: "); vector_str_out_str(stdout, words); printf("\n"); // Count the words. M_LET(map, dict_str_t) { // Count the words: for M_EACH(w, words, vector_str_t) { (*dict_str_get_at(map, *w)) ++; } // Print the count: for M_EACH(p, map, dict_str_t) { printf ("%zu occurences of %s\n", p->value, string_get_cstr(p->key)); } } } }
Add a new example of the new M_LET feature.
Add a new example of the new M_LET feature.
C
bsd-2-clause
P-p-H-d/mlib,P-p-H-d/mlib
16a59cb9926bc96792cc9d1b7a996689f7bf1b86
components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
#include "val_interfaces.h" #include "pal_mbed_os_crypto.h" #include "lifecycle.h" #ifdef ITS_TEST void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST #error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout. void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api); #endif int main(void) { #ifdef ITS_TEST test_start(test_entry_s003); #elif PS_TEST test_start(test_entry_p003); #endif }
#include "val_interfaces.h" #include "pal_mbed_os_crypto.h" #include "lifecycle.h" #ifdef ITS_TEST void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST #ifndef PS_ALLOW_ENTIRE_STORAGE_FILL #error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout. #endif void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api); #endif int main(void) { #ifdef ITS_TEST test_start(test_entry_s003); #elif PS_TEST test_start(test_entry_p003); #endif }
Allow PS test03 with PS_ALLOW_ENTIRE_STORAGE_FILL flag
Allow PS test03 with PS_ALLOW_ENTIRE_STORAGE_FILL flag
C
apache-2.0
andcor02/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,kjbracey-arm/mbed,mbedmicro/mbed,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed
6af6de1f5cb48d109c1d58fa4bdd509de09e9c7f
Globals.h
Globals.h
/* Mace - http://www.macehq.cx Copyright 1999-2004 See the file README for more information */ #ifndef GLOBALS_H #define GLOBALS_H #ifndef _MaceTypes #define _MaceTypes typedef unsigned char U8; typedef signed char S8; typedef unsigned short U16; typedef signed short S16; //Note: on 64-bit machines, replace "long" with "int" #if __LP64__ typedef unsigned int U32; typedef signed int S32; #else typedef unsigned long U32; typedef signed long S32; #endif #endif void App_Exit(void); //Same as App_Exit2(), except that this calls setdis() void App_Exit2(void); U16 FlipW(U16 a); U32 FlipL(U32 a); void HexW (U16 n, char * String); void HexL (U32 n, char * String); #endif //GLOBALS_H
/* Mace - http://www.macehq.cx Copyright 1999-2004 See the file README for more information */ #ifndef GLOBALS_H #define GLOBALS_H #ifndef _MaceTypes #define _MaceTypes #include <stdint.h> typedef uint8_t U8; typedef int8_t S8; typedef uint16_t U16; typedef int16_t S16; typedef uint32_t U32; typedef int32_t S32; #endif void App_Exit(void); //Same as App_Exit2(), except that this calls setdis() void App_Exit2(void); U16 FlipW(U16 a); U32 FlipL(U32 a); void HexW (U16 n, char * String); void HexL (U32 n, char * String); #endif //GLOBALS_H
Use C99 stdint.h header for types
Use C99 stdint.h header for types
C
lgpl-2.1
MaddTheSane/Mace,MaddTheSane/Mace
47b3fd8dd3b1baa364ee93c221ae41d7a61810cb
src/lib/ecore_x/xcb/ecore_xcb_missing.c
src/lib/ecore_x/xcb/ecore_xcb_missing.c
#include "ecore_xcb_private.h" EAPI Eina_Bool ecore_x_input_multi_select(Ecore_X_Window win) { return 0; } EAPI void ecore_x_e_comp_sync_counter_set(Ecore_X_Window win, Ecore_X_Sync_Counter counter) { } EAPI void ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win) { } EAPI Eina_Bool ecore_x_e_comp_sync_supported_get(Ecore_X_Window root) { return 0; }
#include "ecore_xcb_private.h" EAPI void ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win, Ecore_X_Atom *protos, int num) { } EAPI Eina_Bool ecore_x_input_multi_select(Ecore_X_Window win) { return 0; } EAPI void ecore_x_e_comp_sync_counter_set(Ecore_X_Window win, Ecore_X_Sync_Counter counter) { } EAPI void ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win) { } EAPI Eina_Bool ecore_x_e_comp_sync_supported_get(Ecore_X_Window root) { return 0; }
Add one more missing function stub
Add one more missing function stub
C
mit
OpenInkpot-archive/ecore,OpenInkpot-archive/ecore,OpenInkpot-archive/ecore
5099b80088141137d81c62d3e03208835faced06
test/Driver/clang_f_opts.c
test/Driver/clang_f_opts.c
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2> %t // RUN: grep -F '"-fblocks"' %t // RUN: grep -F '"-fpascal-strings"' %t // RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2> %t // RUN: grep -F '"-fno-builtin"' %t // RUN: grep -F '"-fno-common"' %t // RUN: grep -F '"-fno-math-errno"' %t // RUN: grep -F '"-fno-show-source-location"' %t // RUN: grep -F '"-fshort-wchar"' %t // RUN: clang -fshort-enums -x c /dev/null 2>&1 | FileCheck -check-prefix=CHECK-SHORT-ENUMS %s // CHECK-SHORT-ENUMS: compiler does not support '-fshort-enums'
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s // RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s // RUN: clang -fshort-enums -x c /dev/null 2>&1 | FileCheck -check-prefix=CHECK-SHORT-ENUMS %s // CHECK-OPTIONS1: -fblocks // CHECK-OPTIONS1: -fpascal-strings // CHECK-OPTIONS2: -fno-builtin // CHECK-OPTIONS2: -fno-common // CHECK-OPTIONS2: -fno-math-errno // CHECK-OPTIONS2: -fno-show-source-location // CHECL-OPTIONS2: -fshort-wchar // CHECK-SHORT-ENUMS: compiler does not support '-fshort-enums'
Convert the remainder of this test case over to using FileCheck.
Convert the remainder of this test case over to using FileCheck. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@91194 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
a6d0140a2c9bbaa73706472e0e748279cd0a2b7b
app/tx/main.c
app/tx/main.c
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
Send two packet at once.
Send two packet at once.
C
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
1946af2c45372e3de39000a45a5954bb5870bc1b
src/consensus/amount.h
src/consensus/amount.h
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_AMOUNT_H #define BITCOIN_CONSENSUS_AMOUNT_H #include <cstdint> /** Amount in satoshis (Can be negative) */ typedef int64_t CAmount; static constexpr CAmount COIN = 100000000; /** No amount larger than this (in satoshi) is valid. * * Note that this constant is *not* the total money supply, which in Bitcoin * currently happens to be less than 21,000,000 BTC for various reasons, but * rather a sanity check. As this sanity check is used by consensus-critical * validation code, the exact value of the MAX_MONEY constant is consensus * critical; in unusual circumstances like a(nother) overflow bug that allowed * for the creation of coins out of thin air modification could lead to a fork. * */ static constexpr CAmount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } #endif // BITCOIN_CONSENSUS_AMOUNT_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_AMOUNT_H #define BITCOIN_CONSENSUS_AMOUNT_H #include <cstdint> /** Amount in satoshis (Can be negative) */ typedef int64_t CAmount; /** The amount of satoshis in one BTC. */ static constexpr CAmount COIN = 100000000; /** No amount larger than this (in satoshi) is valid. * * Note that this constant is *not* the total money supply, which in Bitcoin * currently happens to be less than 21,000,000 BTC for various reasons, but * rather a sanity check. As this sanity check is used by consensus-critical * validation code, the exact value of the MAX_MONEY constant is consensus * critical; in unusual circumstances like a(nother) overflow bug that allowed * for the creation of coins out of thin air modification could lead to a fork. * */ static constexpr CAmount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } #endif // BITCOIN_CONSENSUS_AMOUNT_H
Add comment to COIN constant.
Add comment to COIN constant. The COIN constant is critical in understanding Bitcoin's supply, but what it represents isn't clear from the name of the constant. Adding a comment clarifies the meaning of the constant for future readers.
C
mit
jlopp/statoshi,namecoin/namecoin-core,achow101/bitcoin,namecoin/namecoin-core,pataquets/namecoin-core,instagibbs/bitcoin,domob1812/bitcoin,tecnovert/particl-core,AkioNak/bitcoin,sstone/bitcoin,tecnovert/particl-core,dscotese/bitcoin,anditto/bitcoin,domob1812/namecore,pataquets/namecoin-core,namecoin/namecore,fujicoin/fujicoin,fanquake/bitcoin,bitcoinsSG/bitcoin,dscotese/bitcoin,jambolo/bitcoin,particl/particl-core,sipsorcery/bitcoin,MarcoFalke/bitcoin,domob1812/bitcoin,bitcoin/bitcoin,mruddy/bitcoin,jambolo/bitcoin,bitcoin/bitcoin,particl/particl-core,bitcoinsSG/bitcoin,sstone/bitcoin,namecoin/namecoin-core,fanquake/bitcoin,GroestlCoin/GroestlCoin,jamesob/bitcoin,ajtowns/bitcoin,namecoin/namecore,prusnak/bitcoin,domob1812/bitcoin,mruddy/bitcoin,achow101/bitcoin,instagibbs/bitcoin,jlopp/statoshi,mruddy/bitcoin,instagibbs/bitcoin,Xekyo/bitcoin,achow101/bitcoin,pataquets/namecoin-core,jambolo/bitcoin,domob1812/namecore,jlopp/statoshi,pataquets/namecoin-core,andreaskern/bitcoin,sstone/bitcoin,andreaskern/bitcoin,fujicoin/fujicoin,AkioNak/bitcoin,tecnovert/particl-core,bitcoinsSG/bitcoin,sipsorcery/bitcoin,Xekyo/bitcoin,mm-s/bitcoin,bitcoin/bitcoin,bitcoin/bitcoin,mruddy/bitcoin,kallewoof/bitcoin,kallewoof/bitcoin,sipsorcery/bitcoin,jamesob/bitcoin,bitcoinknots/bitcoin,Xekyo/bitcoin,jlopp/statoshi,kallewoof/bitcoin,tecnovert/particl-core,anditto/bitcoin,lateminer/bitcoin,prusnak/bitcoin,lateminer/bitcoin,anditto/bitcoin,prusnak/bitcoin,jamesob/bitcoin,mm-s/bitcoin,anditto/bitcoin,GroestlCoin/GroestlCoin,dscotese/bitcoin,achow101/bitcoin,fujicoin/fujicoin,bitcoinsSG/bitcoin,GroestlCoin/GroestlCoin,jambolo/bitcoin,GroestlCoin/bitcoin,instagibbs/bitcoin,MarcoFalke/bitcoin,particl/particl-core,Xekyo/bitcoin,fujicoin/fujicoin,sipsorcery/bitcoin,tecnovert/particl-core,jambolo/bitcoin,domob1812/bitcoin,MarcoFalke/bitcoin,prusnak/bitcoin,namecoin/namecore,prusnak/bitcoin,MarcoFalke/bitcoin,mm-s/bitcoin,AkioNak/bitcoin,mruddy/bitcoin,fujicoin/fujicoin,bitcoin/bitcoin,pataquets/namecoin-core,ajtowns/bitcoin,fanquake/bitcoin,MarcoFalke/bitcoin,GroestlCoin/bitcoin,tecnovert/particl-core,MarcoFalke/bitcoin,domob1812/namecore,kallewoof/bitcoin,anditto/bitcoin,bitcoinknots/bitcoin,dscotese/bitcoin,bitcoinknots/bitcoin,GroestlCoin/bitcoin,sipsorcery/bitcoin,bitcoinknots/bitcoin,bitcoinknots/bitcoin,fujicoin/fujicoin,lateminer/bitcoin,andreaskern/bitcoin,domob1812/namecore,kallewoof/bitcoin,achow101/bitcoin,jamesob/bitcoin,namecoin/namecore,pataquets/namecoin-core,sstone/bitcoin,jamesob/bitcoin,Xekyo/bitcoin,jamesob/bitcoin,lateminer/bitcoin,AkioNak/bitcoin,domob1812/bitcoin,fanquake/bitcoin,mm-s/bitcoin,bitcoinsSG/bitcoin,AkioNak/bitcoin,kallewoof/bitcoin,GroestlCoin/GroestlCoin,mm-s/bitcoin,mm-s/bitcoin,prusnak/bitcoin,lateminer/bitcoin,ajtowns/bitcoin,jlopp/statoshi,sipsorcery/bitcoin,ajtowns/bitcoin,GroestlCoin/bitcoin,namecoin/namecoin-core,ajtowns/bitcoin,particl/particl-core,GroestlCoin/bitcoin,sstone/bitcoin,andreaskern/bitcoin,fanquake/bitcoin,GroestlCoin/GroestlCoin,domob1812/namecore,namecoin/namecoin-core,jambolo/bitcoin,AkioNak/bitcoin,instagibbs/bitcoin,dscotese/bitcoin,lateminer/bitcoin,particl/particl-core,GroestlCoin/GroestlCoin,domob1812/bitcoin,mruddy/bitcoin,andreaskern/bitcoin,achow101/bitcoin,bitcoinsSG/bitcoin,sstone/bitcoin,andreaskern/bitcoin,instagibbs/bitcoin,ajtowns/bitcoin,domob1812/namecore,Xekyo/bitcoin,bitcoin/bitcoin,particl/particl-core,jlopp/statoshi,namecoin/namecore,GroestlCoin/bitcoin,fanquake/bitcoin,anditto/bitcoin,dscotese/bitcoin,namecoin/namecore,namecoin/namecoin-core
eb2dc60d19a206f5d51d3871ba81effa166c5219
src/driver_control/dc_common.c
src/driver_control/dc_common.c
#define DC_BASE_MODE_OFF 0 #define DC_BASE_MODE_NO_GYRO 1 #define DC_BASE_MODE_GYRO 2 #define DC_BASE_MODE_OVER 3 const string dc_base_mode_names[] = {" OFF", "NO GYRO", " GYRO"}; int dc_base_mode = DC_BASE_MODE_GYRO; void dc_base_mode_next(void); #define DC_SHOOTER_MODE_NONE 0 #define DC_SHOOTER_MODE_DIRECT 1 #define DC_SHOOTER_MODE_SLIP 2 #define DC_SHOOTER_MODE_KICKER 3 #define DC_SHOOTER_MODE_OVER 4 const string dc_shooter_mode_names[] = {"NONE ", "DIRECT", "SLIP ", "KICKER"}; int dc_shooter_mode = DC_SHOOTER_MODE_NONE; void dc_shooter_mode_next(void);
#define DC_BASE_MODE_OFF 0 #define DC_BASE_MODE_NO_GYRO 1 #define DC_BASE_MODE_GYRO 2 #define DC_BASE_MODE_OVER 3 const string dc_base_mode_names[] = {" OFF", "NO GYRO", " GYRO"}; int dc_base_mode = DC_BASE_MODE_GYRO; void dc_base_mode_next(void); #define DC_SHOOTER_MODE_NONE 0 #define DC_SHOOTER_MODE_DIRECT 1 #define DC_SHOOTER_MODE_SLIP 2 #define DC_SHOOTER_MODE_KICKER 3 #define DC_SHOOTER_MODE_OVER 4 const string dc_shooter_mode_names[] = {"NONE ", "DIRECT", "SLIP ", "KICKER"}; int dc_shooter_mode = DC_SHOOTER_MODE_DIRECT; // mode on startup void dc_shooter_mode_next(void);
Switch to direct drive on startup
Switch to direct drive on startup
C
mit
qsctr/vex-4194b-2016
75c6d50abe1dc506a0f21e4e19f742d799cad5c4
numba/_pymodule.h
numba/_pymodule.h
#ifndef NUMBA_PY_MODULE_H_ #define NUMBA_PY_MODULE_H_ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include <frameobject.h> #define MOD_ERROR_VAL NULL #define MOD_SUCCESS_VAL(val) val #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) #define MOD_DEF(ob, name, doc, methods) { \ static struct PyModuleDef moduledef = { \ PyModuleDef_HEAD_INIT, name, doc, -1, methods, NULL, NULL, NULL, NULL }; \ ob = PyModule_Create(&moduledef); } #define MOD_INIT_EXEC(name) PyInit_##name(); #define PyString_AsString PyUnicode_AsUTF8 #define PyString_Check PyUnicode_Check #define PyString_FromFormat PyUnicode_FromFormat #define PyString_FromString PyUnicode_FromString #define PyString_InternFromString PyUnicode_InternFromString #define PyInt_Type PyLong_Type #define PyInt_Check PyLong_Check #define PyInt_CheckExact PyLong_CheckExact #define PyMem_RawMalloc malloc #define PyMem_RawRealloc realloc #define PyMem_RawFree free #endif /* NUMBA_PY_MODULE_H_ */
#ifndef NUMBA_PY_MODULE_H_ #define NUMBA_PY_MODULE_H_ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include <frameobject.h> #define MOD_ERROR_VAL NULL #define MOD_SUCCESS_VAL(val) val #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) #define MOD_DEF(ob, name, doc, methods) { \ static struct PyModuleDef moduledef = { \ PyModuleDef_HEAD_INIT, name, doc, -1, methods, NULL, NULL, NULL, NULL }; \ ob = PyModule_Create(&moduledef); } #define MOD_INIT_EXEC(name) PyInit_##name(); #define PyString_AsString PyUnicode_AsUTF8 #define PyString_Check PyUnicode_Check #define PyString_FromFormat PyUnicode_FromFormat #define PyString_FromString PyUnicode_FromString #define PyString_InternFromString PyUnicode_InternFromString #define PyInt_Type PyLong_Type #define PyInt_Check PyLong_Check #define PyInt_CheckExact PyLong_CheckExact #endif /* NUMBA_PY_MODULE_H_ */
Remove accidental definitions of MyMem_*
Remove accidental definitions of MyMem_* These were guarded to only be defined on Python < 3.4. This should fix test_snapshot on the 32-bit build.
C
bsd-2-clause
stuartarchibald/numba,numba/numba,numba/numba,cpcloud/numba,gmarkall/numba,seibert/numba,seibert/numba,cpcloud/numba,stonebig/numba,numba/numba,IntelLabs/numba,IntelLabs/numba,stonebig/numba,stonebig/numba,seibert/numba,numba/numba,gmarkall/numba,seibert/numba,gmarkall/numba,stonebig/numba,stuartarchibald/numba,cpcloud/numba,stuartarchibald/numba,numba/numba,IntelLabs/numba,seibert/numba,gmarkall/numba,IntelLabs/numba,stonebig/numba,IntelLabs/numba,cpcloud/numba,stuartarchibald/numba,cpcloud/numba,gmarkall/numba,stuartarchibald/numba
0262f2fab71dca4874831d2d87ecaa099c1831d1
src/util/fixed_point.h
src/util/fixed_point.h
/** * \file fixed_point.h * * * * \author Ethan Burns * \date 2009-01-16 */ #include "stdint.h" #include <limits> /* The type of a fixed point value. This should never be larger than * the size of the type for the 'value' field in the AtomicInt * class. */ typedef unsigned long fp_type; #define fp_sqrt2 14142 #define fp_one 10000 #define fp_infinity (numeric_limits<fp_type>::max())
/** * \file fixed_point.h * * * * \author Ethan Burns * \date 2009-01-16 */ #include "stdint.h" #include <limits> /* The type of a fixed point value. This should never be larger than * the size of the type for the 'value' field in the AtomicInt * class. */ typedef unsigned long fp_type; #define fp_sqrt2 1414 #define fp_one 1000 #define fp_infinity (numeric_limits<fp_type>::max())
Use 3 decimal places, the sun uses 32-bit fp_type which chokes with 4.
Use 3 decimal places, the sun uses 32-bit fp_type which chokes with 4.
C
mit
eaburns/pbnf,eaburns/pbnf,eaburns/pbnf,eaburns/pbnf
af2e0e171ae1e1957f1f7aaf8d5c090c87c2f9dd
Tests/Component/FactoryProvider/PizzaFactory.h
Tests/Component/FactoryProvider/PizzaFactory.h
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Jasper Blues & Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> #import "CreditService.h" #import "Pizza.h" @protocol PizzaFactory <NSObject> @property (nonatomic, strong, readonly) id<CreditService> creditService; - (id<Pizza>)pizzaWithRadius:(double)radius ingredients:(NSArray *)ingrendients; - (id<Pizza>)smallPizzaWithIngredients:(NSArray *)ingredients; - (id<Pizza>)mediumPizzaWithIngredients:(NSArray *)ingredients; - (id<Pizza>)largePizzaWithIngredients:(NSArray *)ingredients; @end
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Jasper Blues & Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> #import "CreditService.h" #import "Pizza.h" @protocol PizzaFactory <NSObject> @property(nonatomic, strong, readonly) id <CreditService> creditService; - (id <Pizza>)pizzaWithRadius:(double)radius ingredients:(NSArray*)ingredients; - (id <Pizza>)smallPizzaWithIngredients:(NSArray*)ingredients; - (id <Pizza>)mediumPizzaWithIngredients:(NSArray*)ingredients; - (id <Pizza>)largePizzaWithIngredients:(NSArray*)ingredients; @end
Fix typing mistake. add code formatting.
Fix typing mistake. add code formatting.
C
apache-2.0
r2B3Challenge/Typhoon,zjh171/Typhoon,r2B3Challenge/Typhoon,nickynick/Typhoon,gaurav1981/Typhoon,manicakes/Typhoon,1yvT0s/Typhoon,manicakes/Typhoon,mbaltaks/Typhoon,nickynick/Typhoon,gaurav1981/Typhoon,pomozoff/Typhoon,literator/Typhoon,nickynick/Typhoon,gaurav1981/Typhoon,pomozoff/Typhoon,nickynick/Typhoon,manicakes/Typhoon,nickynick/Typhoon,r2B3Challenge/Typhoon,manicakes/Typhoon,gaurav1981/Typhoon,literator/Typhoon,gaurav1981/Typhoon,eyeem/Typhoon,mbaltaks/Typhoon,dmueller39/Typhoon,literator/Typhoon,pomozoff/Typhoon,mbaltaks/Typhoon,1yvT0s/Typhoon,zjh171/Typhoon,zjh171/Typhoon,eyeem/Typhoon,literator/Typhoon,1yvT0s/Typhoon,1yvT0s/Typhoon,manicakes/Typhoon,eyeem/Typhoon,gaurav1981/Typhoon,mbaltaks/Typhoon,1yvT0s/Typhoon,zjh171/Typhoon,zjh171/Typhoon,dmueller39/Typhoon,r2B3Challenge/Typhoon,mbaltaks/Typhoon,eyeem/Typhoon,1yvT0s/Typhoon,dmueller39/Typhoon,zjh171/Typhoon,literator/Typhoon,mbaltaks/Typhoon,manicakes/Typhoon,r2B3Challenge/Typhoon,pomozoff/Typhoon,literator/Typhoon,r2B3Challenge/Typhoon,dmueller39/Typhoon,eyeem/Typhoon,dmueller39/Typhoon,pomozoff/Typhoon,eyeem/Typhoon
08aad53abab851e5b39593495a6463c56e59c326
util.h
util.h
#include <algorithm> #include <time.h> template <typename Container1, typename Container2> bool sequences_are_equal(const Container1& seq1, const Container2& seq2) { typedef typename Container1::const_iterator Iter1; typedef typename Container2::const_iterator Iter2; typedef std::pair<Iter1, Iter2> IterPair; IterPair mismatch_pair = std::mismatch(seq1.begin(), seq1.end(), seq2.begin()); return mismatch_pair.first == seq1.end(); } struct randint { int range; public: randint(int range) : range(range) {} int operator()() { return (rand() / RAND_MAX) * range; } };
#include <algorithm> template <typename Container1, typename Container2> bool sequences_are_equal(const Container1& seq1, const Container2& seq2) { typedef typename Container1::const_iterator Iter1; typedef typename Container2::const_iterator Iter2; typedef std::pair<Iter1, Iter2> IterPair; IterPair mismatch_pair = std::mismatch(seq1.begin(), seq1.end(), seq2.begin()); return mismatch_pair.first == seq1.end(); } struct randint { int start; int stop; public: randint(int stop) : start(0), stop(stop) {} randint(int start, int stop) : start(start), stop(stop) {} int operator()() { return rand() % (this->stop - 1) + start; } };
Add start and stop params to randint
Add start and stop params to randint
C
mit
gg/algorithms,gg/algorithms,gg/algorithms
4e26a6a32163d80e2c0316e3b710c5b535f361a3
test/test_controller.c
test/test_controller.c
/** * @file test_controller.c * @author Travis Lane * @version 0.0.1 * @date 2019-04-21 */ #include <check.h> #include "pwm.h" #include "pwm_internal.h" START_TEST(test_controller_basic) { struct usp_controller_t *ctrl; struct usp_pwm_list_t *lst; ctrl = usp_controller_new(); fail_if(ctrl == NULL, "Failed to create controller."); lst = usp_controller_get_pwms(ctrl); fail_if(lst == NULL, "Failed to get pwm list."); usp_pwm_list_unref(lst); usp_controller_delete(ctrl); } END_TEST static Suite * suite_controller_new() { Suite *suite_controller = suite_create("suite_controller"); TCase *case_controller = tcase_create("test_controller"); tcase_add_test(case_controller, test_controller_basic); suite_add_tcase(suite_controller, case_controller); return suite_controller; } int main() { int failed; Suite *suite_controller = suite_controller_new(); SRunner *runner_controller = srunner_create(suite_controller); srunner_run_all(runner_controller, CK_NORMAL); failed = srunner_ntests_failed(runner_controller); srunner_free(runner_controller); return failed; }
Add simple unit tests for the controller
[test] Add simple unit tests for the controller Add a stupid simple unit test to create/destroy a controller.
C
mit
Coderlane/c-pwm-api,Coderlane/c-pwm-api
adcdb080cbf200a29d08dd61817d48abadc37d93
src/libguac/guacamole/parser-constants.h
src/libguac/guacamole/parser-constants.h
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef _GUAC_PARSER_CONSTANTS_H #define _GUAC_PARSER_CONSTANTS_H /** * Constants related to the Guacamole protocol parser. * * @file parser-constants.h */ /** * The maximum number of characters per instruction. */ #define GUAC_INSTRUCTION_MAX_LENGTH 8192 /** * The maximum number of digits to allow per length prefix. */ #define GUAC_INSTRUCTION_MAX_DIGITS 5 /** * The maximum number of elements per instruction, including the opcode. */ #define GUAC_INSTRUCTION_MAX_ELEMENTS 64 #endif
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef _GUAC_PARSER_CONSTANTS_H #define _GUAC_PARSER_CONSTANTS_H /** * Constants related to the Guacamole protocol parser. * * @file parser-constants.h */ /** * The maximum number of characters per instruction. */ #define GUAC_INSTRUCTION_MAX_LENGTH 8192 /** * The maximum number of digits to allow per length prefix. */ #define GUAC_INSTRUCTION_MAX_DIGITS 5 /** * The maximum number of elements per instruction, including the opcode. */ #define GUAC_INSTRUCTION_MAX_ELEMENTS 128 #endif
Increase max number of elements per instruction.
GUACAMOLE-587: Increase max number of elements per instruction.
C
apache-2.0
mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,glyptodon/guacamole-server,glyptodon/guacamole-server,apache/guacamole-server,glyptodon/guacamole-server,apache/guacamole-server,apache/guacamole-server
24746780a3c46b0607edcf65fcdbb2e61b3058fd
src/ios/AppSettings.h
src/ios/AppSettings.h
// // AppPreferences.h // // #import <Cordova/CDV.h> #import <Cordova/CDVViewController.h> @interface AppSettings : CDVPlugin - (void)get:(CDVInvokedUrlCommand*)command; @end
// // AppPreferences.h // // #import <Cordova/CDV.h> #import <Cordova/CDVViewController.h> @interface AppSettings : CDVPlugin - (void)fetch:(CDVInvokedUrlCommand*)command; @end
Update method from get to fetch
Update method from get to fetch
C
apache-2.0
greg-laughlin-hs/app-settings-reader,greg-laughlin-hs/app-settings-reader
7a108087ed96c0d91b65b967f9c524a7c64116fa
targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/itm_api.c
targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/itm_api.c
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * 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. */ #if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" #include "am_bsp.h" #include <stdbool.h> /* SWO frequency: 1000 kHz */ // As SWO has to be accessible everywhere, including ISRs, we can't easily // communicate the dependency on clocks etc. to other components - so this // function checks that things appear to be set up, and if not re-configures // everything void itm_init(void) { am_bsp_itm_printf_enable(); } #endif
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * 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. */ #if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" #include "am_bsp.h" #include <stdbool.h> /* SWO frequency: 1000 kHz */ #ifndef AM_BSP_GPIO_ITM_SWO #define AM_GPIO_ITM_SWO 22 const am_hal_gpio_pincfg_t g_AM_GPIO_ITM_SWO = { .uFuncSel = AM_HAL_PIN_22_SWO, .eDriveStrength = AM_HAL_GPIO_PIN_DRIVESTRENGTH_2MA }; #endif void itm_init(void) { #ifdef AM_BSP_GPIO_ITM_SWO am_bsp_itm_printf_enable(); #else am_bsp_itm_printf_enable(AM_GPIO_ITM_SWO,g_AM_GPIO_ITM_SWO); #endif } #endif
Add default SWO pin number and config if not defined in Ambiq target
Add default SWO pin number and config if not defined in Ambiq target
C
apache-2.0
mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed
b13c0d7adb66133631e78f1aa6799bc2c712b803
WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h
WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h
#import <FBSnapshotTestCase/FBSnapshotTestCase.h> #import "UIApplication+VisualTestUtils.h" /** * @function WMFSnapshotVerifyView * * Verify correct appearance of a given view. * * Search all folder suffixes, use default naming conventions. * * @param view The view to verify. */ #define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil) /** * @function WMFSnapshotVerifyViewForOSAndWritingDirection * * Compares @c view with a reference image matching the current OS version & application writing direction (e.g. * "[email protected]"). * * @param view The view to verify. */ #define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \ FBSnapshotVerifyViewWithOptions((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection], FBSnapshotTestCaseDefaultSuffixes(), 0.1); @interface FBSnapshotTestCase (WMFConvenience) - (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width; - (void)wmf_verifyCellWithIdentifier:(NSString *)identifier fromTableView:(UITableView *)tableView width:(CGFloat)width configuredWithBlock:(void (^)(UITableViewCell *))block; - (void)wmf_verifyView:(UIView *)view width:(CGFloat)width; - (void)wmf_verifyViewAtWindowWidth:(UIView *)view; @end
#import <FBSnapshotTestCase/FBSnapshotTestCase.h> #import "UIApplication+VisualTestUtils.h" /** * @function WMFSnapshotVerifyView * * Verify correct appearance of a given view. * * Search all folder suffixes, use default naming conventions. * * @param view The view to verify. */ #define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil) /** * @function WMFSnapshotVerifyViewForOSAndWritingDirection * * Compares @c view with a reference image matching the current OS version & application writing direction (e.g. * "[email protected]"). * * @param view The view to verify. */ #define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \ FBSnapshotVerifyView((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection]); @interface FBSnapshotTestCase (WMFConvenience) - (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width; - (void)wmf_verifyCellWithIdentifier:(NSString *)identifier fromTableView:(UITableView *)tableView width:(CGFloat)width configuredWithBlock:(void (^)(UITableViewCell *))block; - (void)wmf_verifyView:(UIView *)view width:(CGFloat)width; - (void)wmf_verifyViewAtWindowWidth:(UIView *)view; @end
Revert "Add slight tolerance for image differences to visual test macro."
Revert "Add slight tolerance for image differences to visual test macro." This reverts commit 13d6d4e18d98f7c2d496f3454216d96a4d8e95d1.
C
mit
josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios
60f92d0b69f688523e81adcc8991f6c44a7264c5
src/pomodoro.h
src/pomodoro.h
// ---------------------------------------------------------------------------- // pomodoro - Provides data structures and methods for manipulating pomodoros // Copyright (c) 2013 Jonathan Speicher ([email protected]) // Licensed under the MIT license: http://opensource.org/licenses/MIT // ---------------------------------------------------------------------------- #pragma once // Defines the number of characters in a pomodoro time left display string. Note // that this does not account for the terminating NULL character. #define POMODORO_TIME_LEFT_STRING_NUM_CHARS 5 // Defines a pomodoro. Pomodoros consist primarily of the countdown timer and // associated display strings. typedef struct { unsigned int total_seconds_left; unsigned int minutes_left; unsigned int seconds_left; char time_left_string[POMODORO_TIME_LEFT_STRING_NUM_CHARS + 1]; } Pomodoro; // Initializes a pomodoro. This initializes the time remaining and sets the // display string appropriately. void pomodoro_init(Pomodoro* pomodoro); // Decrements the time remaining in the pomodoro by the number of seconds // specified. If the requested decrement is greater than the number of seconds // remaining, the time remaining is set to zero. void pomodoro_decrement_by_seconds(Pomodoro* pomodoro, unsigned int seconds);
// ---------------------------------------------------------------------------- // pomodoro - Provides data structures and methods for manipulating pomodoros // Copyright (c) 2013 Jonathan Speicher ([email protected]) // Licensed under the MIT license: http://opensource.org/licenses/MIT // ---------------------------------------------------------------------------- #pragma once // Defines the number of characters in a pomodoro time left display string. // Note that this does not account for the terminating NULL character. #define POMODORO_TIME_LEFT_STRING_NUM_CHARS 5 // Defines a pomodoro. Pomodoros consist primarily of the countdown timer and // associated display strings. typedef struct { unsigned int total_seconds_left; unsigned int minutes_left; unsigned int seconds_left; char time_left_string[POMODORO_TIME_LEFT_STRING_NUM_CHARS + 1]; } Pomodoro; // Initializes a pomodoro. This initializes the time remaining and sets the // display string appropriately. void pomodoro_init(Pomodoro* pomodoro); // Decrements the time remaining in the pomodoro by the number of seconds // specified. If the requested decrement is greater than the number of seconds // remaining, the time remaining is set to zero. void pomodoro_decrement_by_seconds(Pomodoro* pomodoro, unsigned int seconds);
Fix a long line in a comment
Fix a long line in a comment
C
mit
elliots/simple-demo-pebble,jonspeicher/Pomade,jonspeicher/Pomade
aca127424836bc72763d64fe0ea655b896293524
src/settings.h
src/settings.h
#define PIN_GAS_PEDAL A0 #define PIN_BATTERY_VOLTAGE A1 #define PIN_CW 5 #define PIN_CCW 6 #define PIN_SWITCH_FORWARDS 10 #define PIN_SWITCH_BACKWARDS 11 #define GAS_VALUE_MIN 446 #define GAS_VALUE_MAX 510 #define BATTERY_READING_12V 670 #define BATTERY_READING_6V 331 #define BATTERY_VOLTAGE_MIN 11 #define SPEED_MIN 0 #define SPEED_MAX_DIRECTION_CHANGE 15 #define SPEED_MAX_FORWARDS 255 #define SPEED_MAX_BACKWARDS 142 #define SPEED_CHANGE_PACE_DEFAULT 10
#define PIN_GAS_PEDAL A0 #define PIN_BATTERY_VOLTAGE A1 #define PIN_CW 6 #define PIN_CCW 5 #define PIN_SWITCH_FORWARDS 10 #define PIN_SWITCH_BACKWARDS 11 #define GAS_VALUE_MIN 446 #define GAS_VALUE_MAX 490 //510 #define BATTERY_READING_12V 670 #define BATTERY_READING_6V 331 #define BATTERY_VOLTAGE_MIN 11 #define SPEED_MIN 0 #define SPEED_MAX_DIRECTION_CHANGE 15 #define SPEED_MAX_FORWARDS 255 #define SPEED_MAX_BACKWARDS 142 #define SPEED_CHANGE_PACE_DEFAULT 10
Change max gas value Swap CW/CCW pins
Change max gas value Swap CW/CCW pins
C
mit
schinken/E-KettCar,schinken/E-KettCar
472da090a1355b9658e60af74cb54da827b0c03e
src/cpu.c
src/cpu.c
// // Created by Jake Kinsella on 4/17/17. // #include "cpu.h" #include "registers.h" #include "ram.h" #include "matcher/matcher.h" void initialize() { initialize_registers(); initialize_ram(); } void cycle() { uint8_t instruction = read_byte_from_address(pc); printf("%d: %d\n", pc, instruction); // pc starts at instruction when passed to handle functions int index = match(instruction); if (index != -1) { InstructionTemplate template = get_registered_template(index); int dst_code = get_dst_code_from_opcode(instruction); int src_code = get_src_code_from_opcode(instruction); int rp_code = get_rp_code_from_opcode(instruction); run_instruction(dst_code, src_code, rp_code, template); } } void print_register_status() { printf("A: %d, B: %d, C: %d, D: %d, E: %d, F: %d, H: %d, L: %d, SP: %d\n", a, b, c, d, e, f, h, l, combine_bytes(s, p)); }
// // Created by Jake Kinsella on 4/17/17. // #include "cpu.h" #include "registers.h" #include "ram.h" #include "matcher/matcher.h" void initialize() { initialize_registers(); initialize_ram(); } void cycle() { uint8_t instruction = read_byte_from_address(pc); printf("0x%x: 0x%x\n", pc, instruction); // pc starts at instruction when passed to handle functions int index = match(instruction); if (index != -1) { InstructionTemplate template = get_registered_template(index); int dst_code = get_dst_code_from_opcode(instruction); int src_code = get_src_code_from_opcode(instruction); int rp_code = get_rp_code_from_opcode(instruction); run_instruction(dst_code, src_code, rp_code, template); } } void print_register_status() { printf("A: 0x%x, B: 0x%x, C: 0x%x, D: 0x%x, E: 0x%x, F: 0x%x, H: 0x%x, L: 0x%x, SP: 0x%x\n", a, b, c, d, e, f, h, l, combine_bytes(s, p)); }
Print hex in debug messages
Print hex in debug messages
C
mit
TheLocust3/Intel-8080-Emulator,TheLocust3/Intel-8080-Emulator
74089c3090eccc25b79a1d0518a5364c70297f69
bubble-sort.c
bubble-sort.c
#include <stdio.h> #include <stdlib.h> int main() { int a[100],i,j,n,t; printf("Enter the value of n (num. of ints)"); scanf("%d",&n); for(i=0;i<=n-1;i++) { printf("Enter a number:"); scanf("%d",&a[i]); printf(" Good, %d to go\n", n-1-i); } printf(" Start sorting ... \n"); // //Bubble sorting algorithm: // for(i=0;i<=n-2;i++){ for(j=0;j<=n-i-2;j++){ if(a[j]>a[j+1]){ t=a[j]; a[j]=a[j+1]; a[j+1]=t; } } } for(i=0;i<=n-1;i++){ printf("%d,",a[i]); } printf(" Done! \n"); }
Add a C program to github to test
Add a C program to github to test
C
mit
wdli/test-repo
fe328acd898dc8efe35c8a8b9c9ea16630f9ec49
tests/regression/02-base/51-evalint-deep.c
tests/regression/02-base/51-evalint-deep.c
// from SV-COMP: nla-digbench-scaling/ps6-ll_valuebound5.c // contains deep integer expressions that shouldn't cause extremely exponential slowdown // when evaluated by base's eval_rv and EvalInt jointly // runs (as unknown) under 0.1s #include <assert.h> void assume_abort_if_not(int cond) { if(!cond) {abort();} } int main() { short k; long long y, x, c; assume_abort_if_not(k>=0 && k<=5); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (1) { assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); if (!(c < k)) break; c = c + 1; y = y + 1; x = y * y * y * y * y + x; } assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); assert(k*y == y*y); return 0; }
// from SV-COMP: nla-digbench-scaling/ps6-ll_valuebound5.c // contains deep integer expressions that shouldn't cause extremely exponential slowdown // when evaluated by base's eval_rv and EvalInt jointly // runs (as unknown) under 0.1s #include <assert.h> void assume_abort_if_not(int cond) { if(!cond) {abort();} } int main() { short k; long long y, x, c; assume_abort_if_not(k>=0 && k<=5); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (1) { assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) if (!(c < k)) break; c = c + 1; y = y + 1; x = y * y * y * y * y + x; } assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) assert(k*y == y*y); // UNKNOWN (by design) return 0; }
Add UNKNOWN annotations to 02/51
Add UNKNOWN annotations to 02/51
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
e9b3d0191f9ec3a27bea78fac2373eecf062004a
tests/regression/36-apron/64-dummy-sound.c
tests/regression/36-apron/64-dummy-sound.c
// SKIP PARAM: --set ana.activated[+] apron --set ana.apron.privatization dummy #include <pthread.h> #include <assert.h> int g; void *t_fun(void *arg) { // shouldn't have g, x, y in local apron state g = 43; int *p = arg; *p = 11; return NULL; } int main() { g = 42; int x = 10; int y = 20; pthread_t id; pthread_create(&id, NULL, t_fun, &x); // shouldn't have g, x, y in local apron state assert(g == 42); // UNKNOWN! assert(x == 10); // UNKNOWN! return 0; }
Add test for apron dummy privatization soundness
Add test for apron dummy privatization soundness
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
d3858eb7da569afc310bf14d4fed9d754e3e0db3
test/get-compositor.c
test/get-compositor.c
#include <X11/X.h> #include <X11/Xatom.h> #include <X11/Xlib.h> #include <stdio.h> int main() { Display *display = XOpenDisplay(NULL); if (display == NULL) { fprintf(stderr, "Could not connect to $DISPLAY.\n"); return 1; } char buf[32]; snprintf(buf, sizeof(buf), "_NET_WM_CM_S%d", (int)DefaultScreen(display)); Atom atom = XInternAtom(display, buf, False); Window w = XGetSelectionOwner(display, atom); if (w == None) { fprintf(stderr, "No compositor detected.\n"); return 1; } printf("%#llx\n", (unsigned long long)w); return 0; }
#include <X11/X.h> #include <X11/Xatom.h> #include <X11/Xlib.h> #include <stdio.h> int main() { Display *display = XOpenDisplay(NULL); if (display == NULL) { fprintf(stderr, "Could not connect to $DISPLAY.\n"); return 1; } char buf[32]; // Flawfinder: ignore snprintf(buf, sizeof(buf), "_NET_WM_CM_S%d", // Flawfinder: ignore (int)DefaultScreen(display)); buf[sizeof(buf)-1] = 0; Atom atom = XInternAtom(display, buf, False); Window w = XGetSelectionOwner(display, atom); if (w == None) { fprintf(stderr, "No compositor detected.\n"); return 1; } printf("%#llx\n", (unsigned long long)w); return 0; }
Fix a potentially unportable use of snprintf found by flawfinder.
Fix a potentially unportable use of snprintf found by flawfinder.
C
apache-2.0
google/xsecurelock,google/xsecurelock
3a19cbf530648a63fb3f73630046c561f70c6b71
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k10"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k11"
Update driver version to 5.02.00-k11
[SCSI] qla4xxx: Update driver version to 5.02.00-k11 Signed-off-by: Vikas Chaudhary <[email protected]> Signed-off-by: James Bottomley <[email protected]>
C
mit
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,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
315cc71afe5d5245e60ce4564328619c49310b6a
Include/KAI/Platform/GameController.h
Include/KAI/Platform/GameController.h
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H #define KAI_PLATFORM_GAME_CONTROLLER_H #include KAI_PLATFORM_INCLUDE(GameController.h) #endif // SHATTER_PLATFORM_GAME_CONTROLLER_H //EOF
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H #define KAI_PLATFORM_GAME_CONTROLLER_H #include KAI_PLATFORM_INCLUDE(GameController.h) #endif //EOF
Add some color for console output
Add some color for console output
C
mit
cschladetsch/KAI,cschladetsch/KAI,cschladetsch/KAI
931352d4bfab72897dc8012c78d9f64739656226
llvmpy/include/python3adapt.h
llvmpy/include/python3adapt.h
#ifndef PYTHON3ADAPT_H #define PYTHON3ADAPT_H #if (PY_VERSION_HEX < 0x03000000) #define PyBytes_Check PyString_Check #define PyBytes_Size PyString_Size #define PyBytes_AsString PyString_AsString #define PyBytes_FromStringAndSize PyString_FromStringAndSize #define PyBytes_FromString PyString_FromString #else #define PyString_Check PyUnicode_Check #define PyString_Size PyUnicode_GET_SIZE #define PyString_FromStringAndSize PyUnicode_FromStringAndSize #define PyString_FromString PyUnicode_FromString #define PyInt_Check PyLong_Check #define PyInt_FromLong PyLong_FromLong #define PyInt_AsLong PyLong_AsLong #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyFile_Check(x) (1) #if (PY_VERSION_HEX < 0x03030000) #define PyString_AsString(x) PyBytes_AsString(PyUnicode_AsUTF8String(x)) #else #define PyString_AsString PyUnicode_AsUTF8 #endif #endif // (PY_VERSION_HEX < 0x03000000) #endif //PYTHON3ADAPT_H
#ifndef PYTHON3ADAPT_H #define PYTHON3ADAPT_H #if (PY_VERSION_HEX < 0x03000000) #define PyBytes_Check PyString_Check #define PyBytes_Size PyString_Size #define PyBytes_AsString PyString_AsString #define PyBytes_FromStringAndSize PyString_FromStringAndSize #define PyBytes_FromString PyString_FromString #else #define PyString_Check PyUnicode_Check #define PyString_Size PyUnicode_GET_SIZE #define PyString_FromStringAndSize PyUnicode_FromStringAndSize #define PyString_FromString PyUnicode_FromString #define PyInt_Check PyLong_Check #define PyInt_FromLong PyLong_FromLong #define PyInt_AsLong PyLong_AsLong #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyFile_Check(x) (1) #if (PY_VERSION_HEX < 0x03030000) #define PyString_AsString _PyUnicode_AsString #else #define PyString_AsString PyUnicode_AsUTF8 #endif #endif // (PY_VERSION_HEX < 0x03000000) #endif //PYTHON3ADAPT_H
Fix memory leak in Python 3.2
Fix memory leak in Python 3.2
C
bsd-3-clause
llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy
90c74ab32dc8a19f979975b9910c1810032f1ba9
engine/core/include/halley/core/api/input_api.h
engine/core/include/halley/core/api/input_api.h
#pragma once #include <functional> #include "halley/maths/vector2.h" #include "halley/core/input/input_device.h" namespace Halley { class InputJoystick; class InputTouch; class InputAPI { public: virtual ~InputAPI() {} virtual size_t getNumberOfKeyboards() const = 0; virtual std::shared_ptr<InputDevice> getKeyboard(int id = 0) const = 0; virtual size_t getNumberOfJoysticks() const = 0; virtual std::shared_ptr<InputJoystick> getJoystick(int id = 0) const = 0; virtual size_t getNumberOfMice() const = 0; virtual std::shared_ptr<InputDevice> getMouse(int id = 0) const = 0; virtual Vector<std::shared_ptr<InputTouch>> getNewTouchEvents() = 0; virtual Vector<std::shared_ptr<InputTouch>> getTouchEvents() = 0; virtual void setMouseRemapping(std::function<Vector2f(Vector2i)> remapFunction) = 0; virtual void requestControllerSetup(int numControllers, std::function<void(bool)> callback) { callback(true); } }; }
#pragma once #include <functional> #include "halley/maths/vector2.h" #include "halley/core/input/input_device.h" #include "halley/maths/colour.h" #include "halley/data_structures/maybe.h" namespace Halley { class InputJoystick; class InputTouch; class InputControllerData { public: Colour colour; String name; }; class InputAPI { public: virtual ~InputAPI() {} virtual size_t getNumberOfKeyboards() const = 0; virtual std::shared_ptr<InputDevice> getKeyboard(int id = 0) const = 0; virtual size_t getNumberOfJoysticks() const = 0; virtual std::shared_ptr<InputJoystick> getJoystick(int id = 0) const = 0; virtual size_t getNumberOfMice() const = 0; virtual std::shared_ptr<InputDevice> getMouse(int id = 0) const = 0; virtual Vector<std::shared_ptr<InputTouch>> getNewTouchEvents() = 0; virtual Vector<std::shared_ptr<InputTouch>> getTouchEvents() = 0; virtual void setMouseRemapping(std::function<Vector2f(Vector2i)> remapFunction) = 0; virtual void requestControllerSetup(int minControllers, int maxControllers, std::function<void(bool)> callback, Maybe<std::vector<InputControllerData>> controllerData = {}) { callback(true); } }; }
Support for additional data to be passed for controller support (implemented on consoles).
Support for additional data to be passed for controller support (implemented on consoles).
C
apache-2.0
amzeratul/halley,amzeratul/halley,amzeratul/halley
472bd7982e5a006fbbe75a0cd88ba494b31719d6
ext/metrics/metrics.c
ext/metrics/metrics.c
#include <ruby.h> #include "client.h" static VALUE metrics_report_metric(VALUE self, VALUE user_id, VALUE key, VALUE val) { char * user_id_str, * key_str; int result = 0; user_id_str = RSTRING_PTR(user_id); key_str = RSTRING_PTR(key); /* Figure out what this belongs to and call the apprioriate one. */ switch(TYPE(val)) { case T_FIXNUM: result = metrici((const char *)user_id_str, (const char *)key_str, FIX2INT(val)); break; case T_FLOAT: result = metricd((const char *)user_id_str, (const char *)key_str, NUM2DBL(val)); break; default: rb_raise(rb_eTypeError, "Value is not a valid type. Expecting Fixnum or Float."); break; } return (result > 0) ? T_TRUE : T_FALSE; } void Init_metrics(void) { VALUE klass = rb_define_class("Metrics", rb_cObject); rb_define_singleton_method(klass, "report_metric", metrics_report_metric, 3); }
#include <ruby.h> #include "client.h" static VALUE rb_metrics_report_metric(VALUE self, VALUE user_id, VALUE key, VALUE val) { char * user_id_str, * key_str; int result = 0; user_id_str = RSTRING_PTR(user_id); key_str = RSTRING_PTR(key); /* Figure out what this belongs to and call the apprioriate one. */ switch(TYPE(val)) { case T_FIXNUM: result = metrici((const char *)user_id_str, (const char *)key_str, FIX2INT(val)); break; case T_FLOAT: result = metricd((const char *)user_id_str, (const char *)key_str, NUM2DBL(val)); break; default: rb_raise(rb_eTypeError, "Value is not a valid type. Expecting Fixnum or Float."); break; } return (result > 0) ? T_TRUE : T_FALSE; } static VALUE rb_metrics_initialize(VALUE self, VALUE hostname, VALUE port) { if(!FIXNUM_P(port)) { rb_raise(rb_eTypeError, "Port is not a Fixnum."); return T_FALSE; } rb_iv_set(self, "hostname", hostname); rb_iv_set(self, "port", port); return T_TRUE; } void Init_metrics(void) { VALUE rb_mMetrics = rb_define_module("Metrics"); VALUE rb_cNativeClient = rb_define_class_under(rb_mMetrics, "NativeClient", rb_cObject); rb_define_singleton_method(rb_cNativeClient, "report_metric", rb_metrics_report_metric, 3); rb_define_method(rb_cNativeClient, "initialize", rb_metrics_initialize, 2); }
Move this in to an actual class.
Move this in to an actual class.
C
mit
bradhe/metrics-client,bradhe/metrics-client
19cc9b027e894e1dff68f18d7d660ac55b20b784
include/flatcc/flatcc_version.h
include/flatcc/flatcc_version.h
#define FLATCC_VERSION_TEXT "0.4.3" #define FLATCC_VERSION_MAJOR 0 #define FLATCC_VERSION_MINOR 4 #define FLATCC_VERSION_PATCH 3 /* 1 or 0 */ #define FLATCC_VERSION_RELEASED 1
#define FLATCC_VERSION_TEXT "0.5.0-pre" #define FLATCC_VERSION_MAJOR 0 #define FLATCC_VERSION_MINOR 5 #define FLATCC_VERSION_PATCH 0 /* 1 or 0 */ #define FLATCC_VERSION_RELEASED 0
Prepare for next version version
Prepare for next version version
C
apache-2.0
dvidelabs/flatcc,dvidelabs/flatcc,dvidelabs/flatcc
7b04babeb15fbc287e1a3f2ccc66d0eae753d17b
plugin/lasi/gvplugin_lasi.c
plugin/lasi/gvplugin_lasi.c
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #include "gvplugin.h" extern gvplugin_installed_t gvrender_lasi_types; static gvplugin_api_t apis[] = { {API_render, &gvrender_lasi_types}, {(api_t)0, 0}, }; gvplugin_library_t gvplugin_lasi_LTX_library = { "lasi", apis };
Add framework for a new lasi plugin, currently disabled. The lasi library provides UTF-8 support in PostScript
Add framework for a new lasi plugin, currently disabled. The lasi library provides UTF-8 support in PostScript
C
epl-1.0
pixelglow/graphviz,MjAbuz/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,MjAbuz/graphviz,jho1965us/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,kbrock/graphviz,pixelglow/graphviz,BMJHayward/graphviz,jho1965us/graphviz,BMJHayward/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,kbrock/graphviz,jho1965us/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,kbrock/graphviz,BMJHayward/graphviz,ellson/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,kbrock/graphviz,ellson/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,tkelman/graphviz,kbrock/graphviz,pixelglow/graphviz,kbrock/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,pixelglow/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,jho1965us/graphviz,ellson/graphviz,tkelman/graphviz,jho1965us/graphviz,BMJHayward/graphviz,jho1965us/graphviz,MjAbuz/graphviz,pixelglow/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz,pixelglow/graphviz,MjAbuz/graphviz,pixelglow/graphviz,BMJHayward/graphviz,tkelman/graphviz,tkelman/graphviz,ellson/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,ellson/graphviz
eb87dfe4886db065ce24f1f2db3570497366a559
src/network_os.h
src/network_os.h
#pragma once #ifndef INCL_NETWORKOS #define INCL_NETWORKOS #include <iostream> #include <memory> #include <string> #include <vector> #include <map> #include <cstdlib> #ifdef WIN32 #include <WinSock2.h> #include <WS2tcpip.h> #include <inaddr.h> #include <in6addr.h> #include <mstcpip.h> #define SHUT_RDWR SD_BOTH typedef int socklen_t; #pragma comment(lib, "ws2_32.lib") #undef SetPort #else #include <sys/ioctl.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <sys/socket.h> #include <netinet/ip.h> #include <netinet/ip6.h> #include <netinet/tcp.h> typedef unsigned int socklen_t; #define INVALID_SOCKET (-1) #endif #endif
#pragma once #ifndef INCL_NETWORKOS #define INCL_NETWORKOS #include <iostream> #include <memory> #include <string> #include <vector> #include <map> #include <cstdlib> #if defined(_MSC_VER) #include <WinSock2.h> #include <WS2tcpip.h> #include <inaddr.h> #include <in6addr.h> #include <mstcpip.h> #define SHUT_RDWR SD_BOTH typedef int socklen_t; #pragma comment(lib, "ws2_32.lib") #undef SetPort #else #include <sys/ioctl.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <sys/socket.h> #include <netinet/ip.h> #include <netinet/ip6.h> #include <netinet/tcp.h> typedef unsigned int socklen_t; #define INVALID_SOCKET (-1) #endif #endif
Use variable that cmake defines instead of specific one
Use variable that cmake defines instead of specific one
C
mit
Meisaka/NetPort