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
3f150a8d8b571ca3f072d3ced1b3272aa82b9ea9
lib/MetaProcessor/Display.h
lib/MetaProcessor/Display.h
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // version: $Id$ // author: Timur Pocheptsov <[email protected]> //------------------------------------------------------------------------------ #ifndef CLING_DISPLAY_H #define CLING_DISPLAY_H #include <string> namespace llvm { class raw_ostream; } namespace cling { void DisplayClasses(llvm::raw_ostream &stream, const class Interpreter *interpreter, bool verbose); void DisplayClass(llvm::raw_ostream &stream, const Interpreter *interpreter, const char *className, bool verbose); void DisplayGlobals(llvm::raw_ostream &stream, const Interpreter *interpreter); void DisplayGlobal(llvm::raw_ostream &stream, const Interpreter *interpreter, const std::string &name); } #endif
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // version: $Id$ // author: Timur Pocheptsov <[email protected]> //------------------------------------------------------------------------------ #ifndef CLING_DISPLAY_H #define CLING_DISPLAY_H #include <string> namespace llvm { class raw_ostream; } namespace cling { class Interpreter; void DisplayClasses(llvm::raw_ostream &stream, const Interpreter *interpreter, bool verbose); void DisplayClass(llvm::raw_ostream &stream, const Interpreter *interpreter, const char *className, bool verbose); void DisplayGlobals(llvm::raw_ostream &stream, const Interpreter *interpreter); void DisplayGlobal(llvm::raw_ostream &stream, const Interpreter *interpreter, const std::string &name); } #endif
Fix fwd decl for windows.
Fix fwd decl for windows. git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@47814 27541ba8-7e3a-0410-8455-c3a389f83636
C
lgpl-2.1
karies/cling,marsupial/cling,karies/cling,perovic/cling,marsupial/cling,marsupial/cling,perovic/cling,root-mirror/cling,marsupial/cling,perovic/cling,root-mirror/cling,marsupial/cling,perovic/cling,karies/cling,karies/cling,root-mirror/cling,karies/cling,root-mirror/cling,perovic/cling,marsupial/cling,root-mirror/cling,karies/cling,root-mirror/cling
50c59dac186f1e0de702c5b2f761c1ede995f084
indra/llcommon/llversionviewer.h
indra/llcommon/llversionviewer.h
/** * @file llversionviewer.h * @brief * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #ifndef LL_LLVERSIONVIEWER_H #define LL_LLVERSIONVIEWER_H const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 1; const S32 LL_VERSION_PATCH = 2; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; #endif
/** * @file llversionviewer.h * @brief * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #ifndef LL_LLVERSIONVIEWER_H #define LL_LLVERSIONVIEWER_H const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 2; const S32 LL_VERSION_PATCH = 1; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; #endif
Increment version number since we forked for beta.
Increment version number since we forked for beta.
C
lgpl-2.1
gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm
3983d4d1d363412b863aabd1219676c589d9ed41
src/binary.c
src/binary.c
#include <binary.h> #include <assert.h> #include <crc32.h> /* API ************************************************************************/ Binary *binary_new(Scope *scope, size_t size) { Binary *binary = scope_alloc(scope, sizeof(Binary) + size); binary->size = size; binary->header = ref_header(TYPEID_BINARY, 0); memset(binary->data, 0, binary->size); return binary; } Binary *binary(Scope *scope, const uint8_t *data, size_t size) { Binary *binary = scope_alloc(scope, sizeof(Binary) + size); binary->size = size; binary->header = ref_header(TYPEID_BINARY, 0); memcpy(binary->data, data, size); return binary; } uint32_t binary_hash32(uint32_t hash, Binary *binary) { assert(binary != NULL); return crc32(hash, binary->data, binary->size); }
#include <binary.h> #include <assert.h> #include <crc32.h> /* API ************************************************************************/ Binary *binary_new(Scope *scope, size_t size) { Binary *binary = scope_alloc(scope, sizeof(Binary) + size + 1); binary->size = size; binary->header = ref_header(TYPEID_BINARY, 0); memset(binary->data, 0, binary->size + 1); return binary; } Binary *binary(Scope *scope, const uint8_t *data, size_t size) { Binary *binary = scope_alloc(scope, sizeof(Binary) + size + 1); binary->size = size; binary->header = ref_header(TYPEID_BINARY, 0); memcpy(binary->data, data, size + 1); return binary; } uint32_t binary_hash32(uint32_t hash, Binary *binary) { assert(binary != NULL); return crc32(hash, binary->data, binary->size); }
Add ending null-byte to binaries
Add ending null-byte to binaries
C
apache-2.0
samuelotter/slang,samuelotter/slang
c22cda86143d517da8147fca81f45f595023a8ad
src/Classes/IMapEventListener.h
src/Classes/IMapEventListener.h
#ifndef MAP_EVENT_LISTENER_H #define MAP_EVENT_LISTENER_H #include "cocos2d.h" namespace tsg { namespace map { class IMapEventListener { public: virtual void onMapLoad(cocos2d::TMXTiledMap *) = 0; virtual void onViewCoordinatesChanged(cocos2d::Vec2) =0; virtual void onNightTime() =0; virtual void onDayTime() =0; virtual void onGameHourPassed() =0; virtual ~IMapEventListener(){}; }; } } #endif
#ifndef MAP_EVENT_LISTENER_H #define MAP_EVENT_LISTENER_H #include "cocos2d.h" namespace tsg { namespace map { class IMapEventListener { public: virtual void onMapLoad(cocos2d::TMXTiledMap *) = 0; virtual void onViewCoordinatesChanged(cocos2d::Vec2) = 0; virtual void onNightTime() = 0; virtual void onDayTime() = 0; virtual void onGameHourPassed() = 0; virtual ~IMapEventListener(){}; }; } } #endif
Format previos commit with clang-formatter
Format previos commit with clang-formatter
C
apache-2.0
TopSecretGames/game,apocarteres/game
3c5ab51a235a400427b364a608e679d91390f96a
Quick/Quick.h
Quick/Quick.h
#import <Foundation/Foundation.h> //! Project version number for Quick. FOUNDATION_EXPORT double QuickVersionNumber; //! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Quick/PublicHeader.h> #import <Quick/QuickSpec.h> #import <Quick/QCKDSL.h> #import <Quick/QuickConfiguration.h>
#import <Foundation/Foundation.h> //! Project version number for Quick. FOUNDATION_EXPORT double QuickVersionNumber; //! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; #import <Quick/QuickSpec.h>
Remove public headers from umbrella header
Remove public headers from umbrella header This seems to be the root cause for new projects created in Xcode 7.1 to report "Include of non-modular header inside framework Module 'Quick'". Infer: It seems like the swift compiler in Xcode 7.1 now prevents non-modular includes in umbrella header files. The public headers are assumed to be imported in modules.
C
apache-2.0
marciok/Quick,Quick/Quick,phatblat/Quick,paulyoung/Quick,DanielAsher/Quick,Quick/Quick,DanielAsher/Quick,phatblat/Quick,jeffh/Quick,ikesyo/Quick,jasonchaffee/Quick,mokagio/Quick,jeffh/Quick,dgdosen/Quick,Quick/Quick,jasonchaffee/Quick,ikesyo/Quick,phatblat/Quick,dgdosen/Quick,Quick/Quick,paulyoung/Quick,marciok/Quick,ashfurrow/Quick,phatblat/Quick,mokagio/Quick,ikesyo/Quick,paulyoung/Quick,jasonchaffee/Quick,marciok/Quick,mokagio/Quick,dgdosen/Quick,jeffh/Quick,ashfurrow/Quick
2376316b36f4d6bdbdb82bea519b6296763bb2f2
MORK/ORKTaskResult+MORK.h
MORK/ORKTaskResult+MORK.h
// // ORKCollectionResult+MORK.h // MORK // // Created by Nolan Carroll on 4/23/15. // Copyright (c) 2015 Medidata Solutions. All rights reserved. // #import "ORKResult.h" @interface ORKTaskResult (MORK) @property (readonly) NSArray *mork_fieldDataFromResults; @end
// // ORKCollectionResult+MORK.h // MORK // // Created by Nolan Carroll on 4/23/15. // Copyright (c) 2015 Medidata Solutions. All rights reserved. // #import "ORKResult.h" @interface ORKTaskResult (MORK) - (NSArray *)mork_getFieldDataFromResults; @end
Put method declaration back into category header
Put method declaration back into category header
C
mit
mdsol/MORK,mdsol/MORK
4dd9b0481fedd5fb2386865525e4e186cd88b10a
cores/esp8266/core_esp8266_noniso.c
cores/esp8266/core_esp8266_noniso.c
#include <stdlib.h> #include "stdlib_noniso.h" long atol_internal(const char* s) { return 0; } float atof_internal(const char* s) { return 0; } char * itoa (int val, char *s, int radix) { *s = 0; return s; } char * ltoa (long val, char *s, int radix) { *s = 0; return s; } char * utoa (unsigned int val, char *s, int radix) { *s = 0; return s; } char * ultoa (unsigned long val, char *s, int radix) { *s = 0; return s; } char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) { *__s = 0; return __s; } char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { *__s = 0; return __s; }
#include <stdlib.h> #include "stdlib_noniso.h" extern int ets_sprintf(char*, const char*, ...); #define sprintf ets_sprintf long atol_internal(const char* s) { long result = 0; return result; } float atof_internal(const char* s) { float result = 0; return result; } char * itoa (int val, char *s, int radix) { // todo: radix sprintf(s, "%d", val); return s; } char * ltoa (long val, char *s, int radix) { sprintf(s, "%ld", val); return s; } char * utoa (unsigned int val, char *s, int radix) { sprintf(s, "%u", val); return s; } char * ultoa (unsigned long val, char *s, int radix) { sprintf(s, "%lu", val); return s; } char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) { *__s = 0; return __s; } char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { *__s = 0; return __s; }
Add stubs for itoa, ltoa
Add stubs for itoa, ltoa
C
lgpl-2.1
gguuss/Arduino,NullMedia/Arduino,gguuss/Arduino,edog1973/Arduino,jes/Arduino,NullMedia/Arduino,Links2004/Arduino,Links2004/Arduino,me-no-dev/Arduino,gguuss/Arduino,Adam5Wu/Arduino,quertenmont/Arduino,esp8266/Arduino,KaloNK/Arduino,quertenmont/Arduino,quertenmont/Arduino,me-no-dev/Arduino,NullMedia/Arduino,NextDevBoard/Arduino,Adam5Wu/Arduino,martinayotte/ESP8266-Arduino,wemos/Arduino,martinayotte/ESP8266-Arduino,me-no-dev/Arduino,chrisfraser/Arduino,chrisfraser/Arduino,lrmoreno007/Arduino,CanTireInnovations/Arduino,sticilface/Arduino,Juppit/Arduino,NextDevBoard/Arduino,KaloNK/Arduino,Cloudino/Arduino,Adam5Wu/Arduino,toastedcode/esp8266-Arduino,lrmoreno007/Arduino,CanTireInnovations/Arduino,Cloudino/Cloudino-Arduino-IDE,Cloudino/Cloudino-Arduino-IDE,sticilface/Arduino,chrisfraser/Arduino,KaloNK/Arduino,Lan-Hekary/Arduino,CanTireInnovations/Arduino,jes/Arduino,Adam5Wu/Arduino,hallard/Arduino,me-no-dev/Arduino,Lan-Hekary/Arduino,hallard/Arduino,CanTireInnovations/Arduino,martinayotte/ESP8266-Arduino,Cloudino/Arduino,hallard/Arduino,lrmoreno007/Arduino,hallard/Arduino,Links2004/Arduino,jes/Arduino,sticilface/Arduino,Juppit/Arduino,jes/Arduino,Cloudino/Cloudino-Arduino-IDE,wemos/Arduino,NextDevBoard/Arduino,gguuss/Arduino,NextDevBoard/Arduino,Cloudino/Arduino,quertenmont/Arduino,sticilface/Arduino,jes/Arduino,NullMedia/Arduino,sticilface/Arduino,toastedcode/esp8266-Arduino,Cloudino/Cloudino-Arduino-IDE,martinayotte/ESP8266-Arduino,KaloNK/Arduino,quertenmont/Arduino,Cloudino/Cloudino-Arduino-IDE,gguuss/Arduino,edog1973/Arduino,Lan-Hekary/Arduino,CanTireInnovations/Arduino,NullMedia/Arduino,Juppit/Arduino,Cloudino/Arduino,Links2004/Arduino,martinayotte/ESP8266-Arduino,Lan-Hekary/Arduino,esp8266/Arduino,lrmoreno007/Arduino,Cloudino/Cloudino-Arduino-IDE,toastedcode/esp8266-Arduino,KaloNK/Arduino,Cloudino/Arduino,Lan-Hekary/Arduino,Juppit/Arduino,toastedcode/esp8266-Arduino,lrmoreno007/Arduino,hallard/Arduino,esp8266/Arduino,Juppit/Arduino,wemos/Arduino,toastedcode/esp8266-Arduino,CanTireInnovations/Arduino,CanTireInnovations/Arduino,wemos/Arduino,Adam5Wu/Arduino,chrisfraser/Arduino,edog1973/Arduino,chrisfraser/Arduino,edog1973/Arduino,me-no-dev/Arduino,esp8266/Arduino,wemos/Arduino,Cloudino/Arduino,Links2004/Arduino,esp8266/Arduino,NextDevBoard/Arduino,Cloudino/Cloudino-Arduino-IDE,edog1973/Arduino,Cloudino/Arduino
afb88aaf4f3b358e4ba93894c7e462a949ffd80e
elang/compiler/ast/with_modifiers.h
elang/compiler/ast/with_modifiers.h
// Copyright 2014-2015 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_COMPILER_AST_WITH_MODIFIERS_H_ #define ELANG_COMPILER_AST_WITH_MODIFIERS_H_ #include "elang/compiler/modifiers.h" namespace elang { namespace compiler { namespace ast { ////////////////////////////////////////////////////////////////////// // // WithModifiers // class WithModifiers { public: Modifiers modifiers() const { return modifiers_; } protected: explicit WithModifiers(Modifiers modifiers); ~WithModifiers(); private: Modifiers modifiers_; DISALLOW_COPY_AND_ASSIGN(WithModifiers); }; } // namespace ast } // namespace compiler } // namespace elang #endif // ELANG_COMPILER_AST_WITH_MODIFIERS_H_
// Copyright 2014-2015 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_COMPILER_AST_WITH_MODIFIERS_H_ #define ELANG_COMPILER_AST_WITH_MODIFIERS_H_ #include "elang/compiler/modifiers.h" namespace elang { namespace compiler { namespace ast { ////////////////////////////////////////////////////////////////////// // // WithModifiers // class WithModifiers { public: Modifiers modifiers() const { return modifiers_; } #define V(name, string, details) \ bool Has##name() const { return modifiers_.Has##name(); } FOR_EACH_MODIFIER(V) #undef V protected: explicit WithModifiers(Modifiers modifiers); ~WithModifiers(); private: Modifiers modifiers_; DISALLOW_COPY_AND_ASSIGN(WithModifiers); }; } // namespace ast } // namespace compiler } // namespace elang #endif // ELANG_COMPILER_AST_WITH_MODIFIERS_H_
Introduce |HasPartial()|, |HasPublic()|, and so on in |WithModifiers| class for ease of accessing modifiers.
elang/compiler: Introduce |HasPartial()|, |HasPublic()|, and so on in |WithModifiers| class for ease of accessing modifiers.
C
apache-2.0
eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang
9f0a75104da58dd1c8a88e825ff3a7815d8ca7f8
src/dump.h
src/dump.h
/** * File: dump.h * Author: Scott Bennett */ #ifndef DUMP_H #define DUMP_H void dumpMemory(); void dumpProgramRegisters(); void dumpProcessorRegisters(); #endif /* DUMP_H */
/* * File: dump.h * Author: Scott Bennett */ #ifndef DUMP_H #define DUMP_H void dumpMemory(); void dumpProgramRegisters(); void dumpProcessorRegisters(); #endif /* DUMP_H */
Change header to C style.
Change header to C style.
C
isc
sbennett1990/YESS,sbennett1990/YESS,sbennett1990/YESS
c27178386eaed213ca1eb798cc479408ad03a298
src/main.c
src/main.c
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> #include <netinet/in.h> #include <sys/uio.h> #define SERVER "127.0.0.1" #define BUFLEN 512 // max length of buffer #define PORT 3000 // destination port void die(const char *s) { perror(s); exit(1); } int main() { struct sockaddr_in si_other; int s, slen = sizeof(si_other); char buf[BUFLEN]; if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { die("socket"); } memset((char*)&si_other, 0, sizeof(si_other)); si_other.sin_family = AF_INET; si_other.sin_port = htons(PORT); if (inet_aton(SERVER, &si_other.sin_addr) == 0) { fprintf(stderr, "inet_aton() failed\n"); exit(1); } while (1) { printf("Enter message:\n"); const char* msg = "hello"; if (sendto(s, msg, strlen(msg), 0, (struct sockaddr*) &si_other, slen) == -1) { die("sendto()"); } memset(buf, '\0', BUFLEN); break; } close(s); return 0; }
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <sys/socket.h> #include <netinet/in.h> __attribute__((noreturn)) void failed(const char* s) { perror(s); exit(1); } int main() { int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (s == -1) { failed("socket()"); } }
Remove broken prototype, starting out clean
Remove broken prototype, starting out clean
C
mit
darthdeus/dit,darthdeus/dit,darthdeus/dit
29f659dfcfde7adb191065b3c2929ac9f86c4147
src/main.c
src/main.c
#include <config.h> #include "utest.h" int __attribute__((weak)) main (void) { return ut_run_all_tests() == 0; }
#include <config.h> #include "utest.h" #include <unistd.h> #include <getopt.h> #include <stdio.h> static struct option options[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'V' }, { NULL, 0, 0, 0 } }; int __attribute__((weak)) main (int argc, char **argv) { int c; while (1) { int option_index; c = getopt_long(argc, argv, "hV", options, &option_index); if (c == -1) { break; } switch (c) { case 'h': printf("Help!\n"); break; case 'V': printf("Version!\n"); break; } } return ut_run_all_tests() == 0; }
Add basic cmd options handling
Add basic cmd options handling
C
bsd-3-clause
lubomir/libutest,lubomir/libutest,lubomir/libutest
d041cc813bcfcd04f077acdcea855f08b7d55577
test/Driver/solaris-ld.c
test/Driver/solaris-ld.c
// Test ld invocation on Solaris targets. // Check sparc-sun-solaris2.1 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=sparc-sun-solaris2.11 \ // RUN: --gcc-toolchain="" \ // RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \ // RUN: | FileCheck %s // CHECK: "-cc1" "-triple" "sparc-sun-solaris2.11" // CHECK: ld{{.*}}" // CHECK: "--dynamic-linker" "{{.*}}/usr/lib/ld.so.1" // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crt1.o" // CHECK: "{{.*}}/usr/lib/crti.o" // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtbegin.o" // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/crtend.o" // CHECK: "{{.*}}/usr/lib/crtn.o"
// Test ld invocation on Solaris targets. // Check sparc-sun-solaris2.1 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=sparc-sun-solaris2.11 \ // RUN: --gcc-toolchain="" \ // RUN: --sysroot=%S/Inputs/sparc-sun-solaris2.11 \ // RUN: | FileCheck %s // CHECK: "-cc1" "-triple" "sparc-sun-solaris2.11" // CHECK: ld{{.*}}" // CHECK: "--dynamic-linker" "{{.*}}/usr/lib/ld.so.1" // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crt1.o" // CHECK: "{{.*}}/usr/lib/crti.o" // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crtbegin.o" // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crtend.o" // CHECK: "{{.*}}/usr/lib/crtn.o"
Fix path seperator for Windows.
Fix path seperator for Windows. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@246520 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
773337f15658e9d9c0104f6fd5fdf23debb4c334
include/can_compat.h
include/can_compat.h
#include <stdint.h> typedef uint8_t __u8; typedef uint32_t __u32; /* special address description flags for the CAN_ID */ #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ #define CAN_ERR_FLAG 0x20000000U /* error message frame */ /* valid bits in CAN ID for frame formats */ #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ #define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */ #define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */ typedef __u32 canid_t; #define CAN_SFF_ID_BITS11 #define CAN_EFF_ID_BITS29 typedef __u32 can_err_mask_t; #define CAN_MAX_DLC 8 #define CAN_MAX_DLEN 8 struct can_frame { canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ __u8 __pad; /* padding */ __u8 __res0; /* reserved / padding */ __u8 __res1; /* reserved / padding */ __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8))); }; struct can_filter { canid_t can_id; canid_t can_mask; };
Use socketcan data structures and defines
Use socketcan data structures and defines
C
apache-2.0
b/libusbcan,b/libusbcan
7bdf334b2c0524d4654bf1c63a2bfcba636b6cab
test/lex.c
test/lex.c
// Copyright 2012 Rui Ueyama <[email protected]> // This program is free software licensed under the MIT license. #include "test.h" #define stringify(x) #x void digraph(void) { expect_string("[", stringify(<:)); expect_string("]", stringify(:>)); expect_string("{", stringify(<%)); expect_string("}", stringify(%>)); expect_string("#", stringify(%:)); expect_string("% :", stringify(% :)); expect_string("##", stringify(%:%:)); expect_string("#%", stringify(%:%)); } void testmain(void) { print("lexer"); digraph(); }
// Copyright 2012 Rui Ueyama <[email protected]> // This program is free software licensed under the MIT license. #include "test.h" #define stringify(x) #x void digraph(void) { expect_string("[", stringify(<:)); expect_string("]", stringify(:>)); expect_string("{", stringify(<%)); expect_string("}", stringify(%>)); expect_string("#", stringify(%:)); expect_string("% :", stringify(% :)); expect_string("##", stringify(%:%:)); expect_string("#%", stringify(%:%)); } void escape(void) { int value = 10; expect(10, val\ ue); } void testmain(void) { print("lexer"); digraph(); escape(); }
Add a test for line continuation.
Add a test for line continuation.
C
mit
8l/8cc,8l/8cc,jtramm/8cc,vastin/8cc,gergo-/8cc,nobody1986/8cc,vastin/8cc,abc00/8cc,jtramm/8cc,rui314/8cc,abc00/8cc,8l/8cc,cpjreynolds/8cc,abc00/8cc,andrewchambers/8cc,gergo-/8cc,rui314/8cc,nobody1986/8cc,abc00/8cc,cpjreynolds/8cc,andrewchambers/8cc,rui314/8cc,vastin/8cc,vastin/8cc,nobody1986/8cc,cpjreynolds/8cc,gergo-/8cc,cpjreynolds/8cc,andrewchambers/8cc,andrewchambers/8cc,rui314/8cc,jtramm/8cc,jtramm/8cc,8l/8cc,nobody1986/8cc
5b40dbec30817266ae2c7833ea2599f4ba6d265d
src/TriangleStripGLWidget.h
src/TriangleStripGLWidget.h
#ifndef TRIANGLESTRIPGLWIDGET_H #define TRIANGLESTRIPGLWIDGET_H #include "GLWidget.h" #include <cmath> /** * Draws a trapezoid on screen using a triangle strip. Strips can be thought of * lists of vertices, where each triangle in the list is composed of some * adjacent group of three vertices. The vertices are colored for easy viewing. * * @author Aaron Faanes, ported by Brett Langford * */ class TriangleStripGLWidget : public GLWidget { public: TriangleStripGLWidget(QWidget* parent = 0); protected: void render(); }; TriangleStripGLWidget::TriangleStripGLWidget(QWidget* parent) : GLWidget(parent) {} void TriangleStripGLWidget::render() { glBegin(GL_TRIANGLE_STRIP); glColor3f(1, 0, 0); glVertex2f(0, 0); glColor3f(1, 1, 0); glVertex2f(50, 0); glColor3f(0, 1, 0); glVertex2f(25, 50); glColor3f(0, 1, 1); glVertex2f(75, 50); glColor3f(0, 0, 1); glVertex2f(50, 100); glEnd(); } #endif // TRIANGLESTRIPGLWIDGET_H
#ifndef TRIANGLESTRIPGLWIDGET_H #define TRIANGLESTRIPGLWIDGET_H #include "GLWidget.h" #include <cmath> /** * Draws a trapezoid on screen using a triangle strip. Strips can be thought of * lists of vertices, where each triangle in the list is composed of some * adjacent group of three vertices. The vertices are colored for easy viewing. * * @author Aaron Faanes, ported by Brett Langford * */ class TriangleStripGLWidget : public GLWidget { public: TriangleStripGLWidget(QWidget* parent = 0); protected: void render(); }; TriangleStripGLWidget::TriangleStripGLWidget(QWidget* parent) : GLWidget(parent) {} void TriangleStripGLWidget::render() { glBegin(GL_TRIANGLE_STRIP); glColor3f(1, 0, 0); glVertex2f(0, 0); glColor3f(1, 1, 0); glVertex2f(50, 0); glColor3f(0, 1, 0); glVertex2f(25, 50); glColor3f(0, 1, 1); glVertex2f(75, 50); glColor3f(0, 0, 1); glVertex2f(50, 100); glEnd(); } #endif // TRIANGLESTRIPGLWIDGET_H
Put comment right next to class def
Put comment right next to class def It's convention to have these without intervening spaces.
C
mit
dafrito/alpha,dafrito/alpha,dafrito/alpha
6e1b9916f3416fbfbda38f720bd01040532fd062
src/modules/conf_randr/e_smart_randr.h
src/modules/conf_randr/e_smart_randr.h
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon); void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); # endif #endif
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon); void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); Eina_Bool e_smart_randr_changed_get(Evas_Object *obj); void e_smart_randr_changes_apply(Evas_Object *obj, Ecore_X_Window root); # endif #endif
Add prototypes for randr_changed_get and randr_changes_apply functions.
Add prototypes for randr_changed_get and randr_changes_apply functions. Signed-off-by: Christopher Michael <[email protected]> SVN revision: 81104
C
bsd-2-clause
tizenorg/platform.upstream.enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,tasn/enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment
e1be62f3f580c1147088d58c03775603082e56d2
src/condor_includes/condor_constants.h
src/condor_includes/condor_constants.h
#ifndef CONSTANTS_H #define CONSTANTS_H #if !defined(__STDC__) && !defined(__cplusplus) #define const #endif /* Set up a boolean variable type. Since this definition could conflict with other reasonable definition of BOOLEAN, i.e. using an enumeration, it is conditional. */ #ifndef BOOLEAN_TYPE_DEFINED typedef int BOOLEAN; #endif #ifndef TRUE static const int TRUE = 1; static const int FALSE = 0; #endif /* Useful constants for turning seconds into larger units of time. Since these constants may have already been defined elsewhere, they are conditional. */ #ifndef TIME_CONSTANTS_DEFINED static const int MINUTE = 60; static const int HOUR = 60 * 60; static const int DAY = 24 * 60 * 60; #endif /* This is for use with strcmp() and related functions which will return 0 upon a match. */ #ifndef MATCH static const int MATCH = 0; #endif #endif
#ifndef CONSTANTS_H #define CONSTANTS_H #if !defined(__STDC__) && !defined(__cplusplus) #define const #endif /* Set up a boolean variable type. Since this definition could conflict with other reasonable definition of BOOLEAN, i.e. using an enumeration, it is conditional. */ #ifndef BOOLEAN_TYPE_DEFINED typedef int BOOLEAN; #endif #if defined(TRUE) # undef TRUE # undef FALSE #endif static const int TRUE = 1; static const int FALSE = 0; /* Useful constants for turning seconds into larger units of time. Since these constants may have already been defined elsewhere, they are conditional. */ #ifndef TIME_CONSTANTS_DEFINED static const int MINUTE = 60; static const int HOUR = 60 * 60; static const int DAY = 24 * 60 * 60; #endif /* This is for use with strcmp() and related functions which will return 0 upon a match. */ #ifndef MATCH static const int MATCH = 0; #endif #endif
Make sure "TRUE" and "FALSE" are undefined before setting them up as constant int's.
Make sure "TRUE" and "FALSE" are undefined before setting them up as constant int's.
C
apache-2.0
zhangzhehust/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,neurodebian/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,htcondor/htcondor,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/condor,htcondor/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/condor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/condor,djw8605/condor,djw8605/condor,djw8605/htcondor,clalancette/condor-dcloud,htcondor/htcondor,mambelli/osg-bosco-marco
c9abf0d374c53607e67a7a875433efa8280ec3e0
messages.c
messages.c
// Messages are the scrolling messages within the UI. // This file contains update and retrieval functions. #include "7drltypes.h" #define MAX_MSG_SIZE ( 80 ) static int oldest_message = ( MAX_MESSAGES - 1 ); char messages[ MAX_MESSAGES ][ MAX_MSG_SIZE ]; void init_messages( void ) { bzero( messages, ( size_t ) sizeof( messages ) ); return; } void add_message( char *message ) { } char *get_message( int pos ) { return NULL; }
Add start of messaging interface.
Add start of messaging interface.
C
bsd-3-clause
mtimjones/7drl
65c761a0d8dd7a84c9fbf9c108dafc1b8b690ac6
php_shmt.h
php_shmt.h
#ifndef PHP_SHMT_H #define PHP_SHMT_H #define PHP_SHMT_EXTNAME "SHMT" #define PHP_SHMT_EXTVER "1.0.1" #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ extern zend_module_entry shmt_module_entry; #define phpext_shmt_ptr &shmt_module_entry; #endif /* PHP_SHMT_H */
#ifndef PHP_SHMT_H #define PHP_SHMT_H #define PHP_SHMT_EXTNAME "SHMT" #define PHP_SHMT_EXTVER "1.0.2dev" #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ extern zend_module_entry shmt_module_entry; #define phpext_shmt_ptr &shmt_module_entry; #endif /* PHP_SHMT_H */
Update the version after tagging
Update the version after tagging
C
mit
sevenval/SHMT,sevenval/SHMT
3d2c4486a552db9d97ea32fd2235b2cc1358893a
src/shkutil/include/util/raii_helper.h
src/shkutil/include/util/raii_helper.h
#pragma once #include <utility> namespace shk { template< typename T, typename Return, Return (Free)(T), T EmptyValue = nullptr> class RAIIHelper { public: RAIIHelper(T obj) : _obj(obj) {} RAIIHelper(const RAIIHelper &) = delete; RAIIHelper &operator=(const RAIIHelper &) = delete; RAIIHelper(RAIIHelper &&other) : _obj(other._obj) { other._obj = EmptyValue; } ~RAIIHelper() { if (_obj != EmptyValue) { Free(_obj); } } explicit operator bool() const { return _obj != EmptyValue; } T get() const { return _obj; } private: T _obj; }; } // namespace shk
#pragma once #include <utility> namespace shk { template< typename T, typename Return, Return (Free)(T), T EmptyValue = nullptr> class RAIIHelper { public: explicit RAIIHelper(T obj) : _obj(obj) {} RAIIHelper(const RAIIHelper &) = delete; RAIIHelper &operator=(const RAIIHelper &) = delete; RAIIHelper(RAIIHelper &&other) : _obj(other._obj) { other._obj = EmptyValue; } ~RAIIHelper() { if (_obj != EmptyValue) { Free(_obj); } } explicit operator bool() const { return _obj != EmptyValue; } T get() const { return _obj; } private: T _obj; }; } // namespace shk
Make it harder to accidentally steal ownership of a RAIIHelper resource
Make it harder to accidentally steal ownership of a RAIIHelper resource
C
apache-2.0
per-gron/shuriken,per-gron/shuriken,per-gron/shuriken,per-gron/shuriken
1f52f05b9d74c601e7642ec9bd64eb38cf1452f0
Pod/Classes/VOKMappableModel.h
Pod/Classes/VOKMappableModel.h
// // VOKMappableModel.h // VOKCoreData // #import "VOKCoreDataManager.h" /** * Any models that conform to this protocol will be automatically registered for mapping with the shared instance * of VOKCoreDataManager. */ @protocol VOKMappableModel <NSObject> ///@return an array of VOKManagedObjectMap objects mapping foreign keys to local keys. + (NSArray *)coreDataMaps; ///@return the key name to use to uniquely compare two instances of a class. + (NSString *)uniqueKey; // If an optional method isn't defined, the default VOKManagedObjectMap behavior/value will be used. @optional ///@return whether to ignore remote null/nil values are ignored when updating. + (BOOL)ignoreNullValueOverwrites; ///@return whether to warn about incorrect class types when receiving null/nil values for optional properties. + (BOOL)ignoreOptionalNullValues; ///@return completion block to run after importing each foreign dictionary. + (VOKPostImportBlock)importCompletionBlock; @end
// // VOKMappableModel.h // VOKCoreData // #import "VOKCoreDataManager.h" /** * Any models that conform to this protocol will be automatically registered for mapping with the shared instance * of VOKCoreDataManager. * * Note that runtime protocol-conformance is based on declared conformance (the angle-bracketed protocol name appended * to the interface) and not by checking that the required methods are implemented. If you ignore the compiler * warnings about failing to implement required methods, your app will crash. */ @protocol VOKMappableModel <NSObject> ///@return an array of VOKManagedObjectMap objects mapping foreign keys to local keys. + (NSArray *)coreDataMaps; ///@return the key name to use to uniquely compare two instances of a class. + (NSString *)uniqueKey; // If an optional method isn't defined, the default VOKManagedObjectMap behavior/value will be used. @optional ///@return whether to ignore remote null/nil values are ignored when updating. + (BOOL)ignoreNullValueOverwrites; ///@return whether to warn about incorrect class types when receiving null/nil values for optional properties. + (BOOL)ignoreOptionalNullValues; ///@return completion block to run after importing each foreign dictionary. + (VOKPostImportBlock)importCompletionBlock; @end
Add note about how protocol conformance checking works.
Add note about how protocol conformance checking works.
C
mit
seanwolter/Vokoder,vokal-isaac/Vokoder,seanwolter/Vokoder,vokal/Vokoder,seanwolter/Vokoder,chillpop/Vokoder,seanwolter/Vokoder,vokal/Vokoder,chillpop/Vokoder,designatednerd/Vokoder,vokal-isaac/Vokoder,chillpop/Vokoder,vokal-isaac/Vokoder,vokal/Vokoder,designatednerd/Vokoder,brockboland/Vokoder,designatednerd/Vokoder,vokal-isaac/Vokoder,designatednerd/Vokoder,vokal/Vokoder,brockboland/Vokoder,vokal-isaac/Vokoder,brockboland/Vokoder,chillpop/Vokoder,seanwolter/Vokoder,brockboland/Vokoder,chillpop/Vokoder,seanwolter/Vokoder,brockboland/Vokoder
88ed9208bb1ea5b3a8d9792b497353c067915f0d
src/persistent.c
src/persistent.c
#include <stdio.h> #include <stdlib.h> #include "therm.h" /* Loads settings from persistent storage, returning the number of items read, or -1 on error. */ int persistent_load() { FILE *f = fopen(SAVEPATH, "r"); float pid[6]; int ret = 0; if(!f) { return -1; } ret += fread(&wanted_temperature, sizeof(wanted_temperature), 1, f); ret += fread(&wanted_humidity, sizeof(wanted_humidity), 1, f); ret += fread(pid, sizeof(float), 6, f); pid_setvalues(pid[0], pid[1], pid[2], pid[3], pid[4], pid[5]); fclose(f); return ret; } /* Writes settings to persistent storage, returning the number of items written, or -1 on error. */ int persistent_write() { FILE *f = fopen(SAVEPATH, "w"); float pid[6]; int ret = 0; if(!f) { fprintf(stderr, "Couldn't open " SAVEPATH " for writing.\n"); return -1; } ret += fwrite(&wanted_temperature, sizeof(wanted_temperature), 1, f); ret += fwrite(&wanted_humidity, sizeof(wanted_humidity), 1, f); pid_getvalues(pid+0, pid+1, pid+2, pid+3, pid+4, pid+5); ret += fwrite(pid, sizeof(float), 6, f); fclose(f); fprintf(stderr, "Done.\n"); return ret; }
Add file for reading/writing settings. Oops.
[hotfix/0.4.2] Add file for reading/writing settings. Oops.
C
mit
Cat-Ion/raspberrypi-incubator,Cat-Ion/raspberrypi-incubator
d11c53b1a6573cccb0283a187ef3938614089621
test/Driver/unknown-arg.c
test/Driver/unknown-arg.c
// RUN: not %clang_cc1 %s -cake-is-lie -%0 -%d 2> %t.log // RUN: FileCheck %s -input-file=%t.log // CHECK: unknown argument // CHECK: unknown argument // CHECK: unknown argument // RUN: %clang -S %s -o %t.s -funknown-to-clang-option -Wunknown-to-clang-option -munknown-to-clang-optio // IGNORED: warning: argument unused during compilation: '-funknown-to-clang-option' // IGNORED: warning: argument unused during compilation: '-munknown-to-clang-option' // IGNORED: warning: unknown warning option '-Wunknown-to-clang-option'
// RUN: not %clang_cc1 %s -cake-is-lie -%0 -%d 2> %t.log // RUN: FileCheck %s -input-file=%t.log // CHECK: unknown argument // CHECK: unknown argument // CHECK: unknown argument // RUN: %clang -S %s -o %t.s -funknown-to-clang-option -Wunknown-to-clang-option -munknown-to-clang-option 2>&1 | FileCheck --check-prefix=IGNORED %s // IGNORED: warning: argument unused during compilation: '-funknown-to-clang-option' // IGNORED: warning: argument unused during compilation: '-munknown-to-clang-option' // IGNORED: warning: unknown warning option '-Wunknown-to-clang-option'
Fix an incomplete copy and paste in my previous patch.
Fix an incomplete copy and paste in my previous patch. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@191245 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
26536e69151d5f8e083d8165421039b409c93ee3
src/rt/rust_unwind.h
src/rt/rust_unwind.h
// Unwinding stuff missing on some architectures (Mac OS X). #ifndef RUST_UNWIND_H #define RUST_UNWIND_H #ifdef __APPLE__ #include <libunwind.h> typedef int _Unwind_Action; typedef void _Unwind_Context; typedef void _Unwind_Exception; typedef int _Unwind_Reason_Code; #else #include <unwind.h> #endif #endif
// Unwinding stuff missing on some architectures (Mac OS X). #ifndef RUST_UNWIND_H #define RUST_UNWIND_H #ifdef __APPLE__ #include <libunwind.h> typedef void _Unwind_Context; typedef int _Unwind_Reason_Code; #else #include <unwind.h> #endif #if (defined __APPLE__) || (defined __clang__) typedef int _Unwind_Action; typedef void _Unwind_Exception; #endif #endif
Fix build with clang on non-Mac
rt: Fix build with clang on non-Mac
C
apache-2.0
carols10cents/rust,fabricedesre/rust,bombless/rust,erickt/rust,michaelballantyne/rust-gpu,P1start/rust,erickt/rust,pczarn/rust,rohitjoshi/rust,waynenilsen/rand,jroesch/rust,AerialX/rust,GrahamDennis/rand,SiegeLord/rust,jroesch/rust,dinfuehr/rust,nham/rust,ktossell/rust,robertg/rust,zachwick/rust,richo/rust,servo/rust,GBGamer/rust,krzysz00/rust,kimroen/rust,avdi/rust,dwillmer/rust,AerialX/rust,quornian/rust,richo/rust,dwillmer/rust,l0kod/rust,j16r/rust,mitsuhiko/rust,kmcallister/rust,mvdnes/rust,zubron/rust,servo/rust,rprichard/rust,aepsil0n/rust,omasanori/rust,zaeleus/rust,mdinger/rust,KokaKiwi/rust,defuz/rust,philyoon/rust,vhbit/rust,GBGamer/rust,zubron/rust,miniupnp/rust,vhbit/rust,victorvde/rust,mvdnes/rust,omasanori/rust,0x73/rust,ebfull/rust,nham/rust,0x73/rust,fabricedesre/rust,mitsuhiko/rust,bombless/rust-docs-chinese,aneeshusa/rust,bombless/rust,pshc/rust,kwantam/rust,omasanori/rust,pythonesque/rust,philyoon/rust,jbclements/rust,jashank/rust,fabricedesre/rust,aturon/rust,jroesch/rust,robertg/rust,michaelballantyne/rust-gpu,quornian/rust,SiegeLord/rust,Ryman/rust,nham/rust,rohitjoshi/rust,l0kod/rust,barosl/rust,aidancully/rust,kmcallister/rust,l0kod/rust,richo/rust,nham/rust,zubron/rust,XMPPwocky/rust,aturon/rust,carols10cents/rust,ejjeong/rust,jbclements/rust,KokaKiwi/rust,aepsil0n/rust,jbclements/rust,robertg/rust,P1start/rust,quornian/rust,XMPPwocky/rust,aneeshusa/rust,stepancheg/rust-ide-rust,krzysz00/rust,mvdnes/rust,quornian/rust,barosl/rust,aidancully/rust,hauleth/rust,reem/rust,pczarn/rust,mahkoh/rust,seanrivera/rust,jbclements/rust,mahkoh/rust,andars/rust,victorvde/rust,graydon/rust,j16r/rust,XMPPwocky/rust,stepancheg/rust-ide-rust,mdinger/rust,pshc/rust,mahkoh/rust,omasanori/rust,emk/rust,emk/rust,GBGamer/rust,aneeshusa/rust,vhbit/rust,erickt/rust,jroesch/rust,rohitjoshi/rust,pshc/rust,kwantam/rust,aturon/rust,XMPPwocky/rust,jashank/rust,SiegeLord/rust,mahkoh/rust,pshc/rust,retep998/rand,jbclements/rust,LeoTestard/rust,kimroen/rust,emk/rust,ejjeong/rust,kmcallister/rust,dwillmer/rust,pythonesque/rust,mdinger/rust,nwin/rust,0x73/rust,j16r/rust,jbclements/rust,michaelballantyne/rust-gpu,LeoTestard/rust,aneeshusa/rust,aepsil0n/rust,aepsil0n/rust,dinfuehr/rust,stepancheg/rust-ide-rust,TheNeikos/rust,zaeleus/rust,pczarn/rust,XMPPwocky/rust,mvdnes/rust,kmcallister/rust,zubron/rust,KokaKiwi/rust,seanrivera/rust,jbclements/rust,ebfull/rust,avdi/rust,victorvde/rust,mdinger/rust,zachwick/rust,philyoon/rust,jroesch/rust,vhbit/rust,reem/rust,zachwick/rust,gifnksm/rust,omasanori/rust,sae-bom/rust,dwillmer/rust,emk/rust,kimroen/rust,andars/rust,barosl/rust,aneeshusa/rust,l0kod/rust,jashank/rust,andars/rust,avdi/rust,Ryman/rust,kwantam/rust,servo/rust,zaeleus/rust,l0kod/rust,zubron/rust,erickt/rust,pczarn/rust,zubron/rust,michaelballantyne/rust-gpu,P1start/rust,omasanori/rust,pshc/rust,cllns/rust,stepancheg/rust-ide-rust,mihneadb/rust,untitaker/rust,GBGamer/rust,servo/rust,aturon/rust,bhickey/rand,robertg/rust,rohitjoshi/rust,servo/rust,stepancheg/rust-ide-rust,hauleth/rust,P1start/rust,seanrivera/rust,AerialX/rust-rt-minimal,mitsuhiko/rust,krzysz00/rust,Ryman/rust,richo/rust,gifnksm/rust,jroesch/rust,mihneadb/rust,LeoTestard/rust,rprichard/rust,carols10cents/rust,KokaKiwi/rust,mihneadb/rust,pelmers/rust,pythonesque/rust,stepancheg/rust-ide-rust,XMPPwocky/rust,sarojaba/rust-doc-korean,zaeleus/rust,untitaker/rust,rprichard/rust,fabricedesre/rust,seanrivera/rust,AerialX/rust,ejjeong/rust,richo/rust,erickt/rust,dinfuehr/rust,quornian/rust,graydon/rust,zaeleus/rust,mdinger/rust,ktossell/rust,dwillmer/rust,kimroen/rust,defuz/rust,cllns/rust,Ryman/rust,0x73/rust,P1start/rust,cllns/rust,kmcallister/rust,gifnksm/rust,quornian/rust,LeoTestard/rust,kmcallister/rust,ktossell/rust,zachwick/rust,dinfuehr/rust,hauleth/rust,defuz/rust,pythonesque/rust,LeoTestard/rust,jashank/rust,bluss/rand,pczarn/rust,defuz/rust,ebfull/rust,AerialX/rust,cllns/rust,nwin/rust,GBGamer/rust,l0kod/rust,zubron/rust,SiegeLord/rust,kimroen/rust,GBGamer/rust,bombless/rust,ruud-v-a/rust,AerialX/rust,pythonesque/rust,philyoon/rust,Ryman/rust,dinfuehr/rust,andars/rust,krzysz00/rust,michaelballantyne/rust-gpu,aturon/rust,huonw/rand,mihneadb/rust,nwin/rust,richo/rust,barosl/rust,AerialX/rust-rt-minimal,ktossell/rust,pshc/rust,pythonesque/rust,sarojaba/rust-doc-korean,rohitjoshi/rust,michaelballantyne/rust-gpu,sae-bom/rust,achanda/rand,erickt/rust,aturon/rust,reem/rust,aidancully/rust,reem/rust,mitsuhiko/rust,arthurprs/rand,TheNeikos/rust,pelmers/rust,pelmers/rust,gifnksm/rust,TheNeikos/rust,dwillmer/rust,ebfull/rust,miniupnp/rust,kwantam/rust,avdi/rust,victorvde/rust,seanrivera/rust,LeoTestard/rust,fabricedesre/rust,AerialX/rust-rt-minimal,miniupnp/rust,rprichard/rust,ebfull/rust,SiegeLord/rust,fabricedesre/rust,rohitjoshi/rust,LeoTestard/rust,sae-bom/rust,KokaKiwi/rust,jashank/rust,reem/rust,ebfull/rust,aidancully/rust,hauleth/rust,defuz/rust,mdinger/rust,jashank/rust,pczarn/rust,philyoon/rust,jroesch/rust,carols10cents/rust,AerialX/rust-rt-minimal,cllns/rust,servo/rust,andars/rust,sae-bom/rust,nham/rust,barosl/rust,bombless/rust,krzysz00/rust,GBGamer/rust,cllns/rust,hauleth/rust,avdi/rust,sae-bom/rust,Ryman/rust,untitaker/rust,mihneadb/rust,ejjeong/rust,zachwick/rust,fabricedesre/rust,reem/rust,hauleth/rust,SiegeLord/rust,untitaker/rust,sarojaba/rust-doc-korean,dinfuehr/rust,barosl/rust,KokaKiwi/rust,seanrivera/rust,nwin/rust,mvdnes/rust,andars/rust,bombless/rust,0x73/rust,nwin/rust,servo/rust,graydon/rust,l0kod/rust,dwillmer/rust,miniupnp/rust,TheNeikos/rust,ejjeong/rust,j16r/rust,j16r/rust,pelmers/rust,AerialX/rust-rt-minimal,jbclements/rust,ejjeong/rust,pelmers/rust,defuz/rust,pshc/rust,nwin/rust,pythonesque/rust,shepmaster/rand,jroesch/rust,miniupnp/rust,j16r/rust,Ryman/rust,pelmers/rust,untitaker/rust,zaeleus/rust,nwin/rust,aneeshusa/rust,rprichard/rust,michaelballantyne/rust-gpu,kmcallister/rust,ebfull/rand,ruud-v-a/rust,kimroen/rust,rprichard/rust,kwantam/rust,dwillmer/rust,j16r/rust,victorvde/rust,AerialX/rust-rt-minimal,krzysz00/rust,graydon/rust,TheNeikos/rust,mvdnes/rust,mihneadb/rust,vhbit/rust,SiegeLord/rust,robertg/rust,quornian/rust,bombless/rust,pshc/rust,jashank/rust,gifnksm/rust,nwin/rust,kimroen/rust,carols10cents/rust,mitsuhiko/rust,vhbit/rust,mitsuhiko/rust,AerialX/rust,emk/rust,ruud-v-a/rust,miniupnp/rust,graydon/rust,stepancheg/rust-ide-rust,robertg/rust,aepsil0n/rust,jashank/rust,aidancully/rust,pczarn/rust,barosl/rust,mahkoh/rust,emk/rust,vhbit/rust,philyoon/rust,0x73/rust,aidancully/rust,sae-bom/rust,l0kod/rust,nham/rust,P1start/rust,gifnksm/rust,ruud-v-a/rust,sarojaba/rust-doc-korean,emk/rust,sarojaba/rust-doc-korean,miniupnp/rust,graydon/rust,zubron/rust,carols10cents/rust,victorvde/rust,P1start/rust,GBGamer/rust,kwantam/rust,sarojaba/rust-doc-korean,avdi/rust,sarojaba/rust-doc-korean,untitaker/rust,mahkoh/rust,vhbit/rust,ruud-v-a/rust,nham/rust,aepsil0n/rust,TheNeikos/rust,mitsuhiko/rust,ktossell/rust,aturon/rust,0x73/rust,miniupnp/rust,ruud-v-a/rust,ktossell/rust,ktossell/rust,erickt/rust,jbclements/rust,zachwick/rust
7042ad0836fa9fc7566bd6cad8b8a430f8e1ade2
tests/c/chfl_selections.c
tests/c/chfl_selections.c
#include "chemfiles.h" // Force NDEBUG to be undefined #undef NDEBUG #include <assert.h> #include <stdlib.h> int main() { CHFL_TOPOLOGY* topology = chfl_topology(); CHFL_ATOM* O = chfl_atom("O"); CHFL_ATOM* H = chfl_atom("H"); assert(topology != NULL); assert(H != NULL); assert(O != NULL); assert(!chfl_topology_append(topology, H)); assert(!chfl_topology_append(topology, O)); assert(!chfl_topology_append(topology, O)); assert(!chfl_topology_append(topology, H)); assert(!chfl_atom_free(O)); assert(!chfl_atom_free(H)); CHFL_FRAME* frame = chfl_frame(4); assert(!chfl_frame_set_topology(frame, topology)); assert(!chfl_topology_free(topology)); bool* matched = malloc(4 * sizeof(bool)); assert(!chfl_frame_selection(frame, "name O", matched, 4)); assert(matched[0] == false); assert(matched[1] == true); assert(matched[2] == true); assert(matched[3] == false); assert(!chfl_frame_selection(frame, "not index <= 2", matched, 4)); assert(matched[0] == false); assert(matched[1] == false); assert(matched[2] == false); assert(matched[3] == true); free(matched); assert(!chfl_frame_free(frame)); return EXIT_SUCCESS; }
Add test for the C API for selections
Add test for the C API for selections
C
bsd-3-clause
chemfiles/chemfiles,chemfiles/chemfiles,chemfiles/chemfiles,lscalfi/chemfiles,lscalfi/chemfiles,Luthaf/Chemharp,Luthaf/Chemharp,chemfiles/chemfiles,Luthaf/Chemharp,lscalfi/chemfiles,lscalfi/chemfiles
a99be7b255d1ba98fd5958b9adf3a94ee62ee20f
parse_obj.c
parse_obj.c
#include <stdlib.h> #include <stdio.h> #include <string.h> typedef struct vector3f { float x, y, z; }VECTOR3F; typedef struct triangle { int32_t v1, v2, v3; }TRIANGLE; typedef struct trianglemesh { int32_t id; TRIANGLE t; // vertices number VECTOR3F v[3]; // vertices coordinates }TRIANGLEMESH; void usage(char *argv0) { fprintf(stdout, "%s <obj filename>\n", argv0); exit(1); } int parse_file(const char *filename) { FILE *fp = NULL; char buf[1024]; int vertices_count = 0; int faces_count = 0; if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "Cannot open file %s.\n", filename); return -1; } // Reading file until the end while (!feof(fp)) { memset(buf, 0, sizeof(buf)); char start_line = 0; // Read a line and save to a buffer. while (fgets(buf, sizeof(buf), fp) != NULL) { // Read the first character of the line sscanf(buf, "%c", &start_line); switch(start_line) { VECTOR3F v; TRIANGLE t; TRIANGLEMESH tm; case 'v': sscanf(buf, "%c %f %f %f", &start_line, &v.x, &v.y, &v.z); vertices_count += 1; fprintf(stdout, "%c %f %f %f\n", start_line, v.x, v.y, v.z); break; case 'f': sscanf(buf, "%c %d %d %d", &start_line, &t.v1, &t.v2, &t.v3); faces_count += 1; fprintf(stdout, "%c %d %d %d\n", start_line, t.v1, t.v2, t.v3); break; default: fprintf(stdout, "Not known start line %c\n", start_line); break; } } } return 0; } int main(int argc, char *argv[]) { if (argc != 2) { usage(argv[0]); } const char* filename = argv[1]; parse_file(filename); return 0; }
Create a utility to properly parse obj files.
Create a utility to properly parse obj files.
C
mit
svagionitis/CGShading
062b0492f34b5212704ff72eb9ebb0fe84d577b7
tests/sv-comp/basic/global_init_true-unreach-call.c
tests/sv-comp/basic/global_init_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } int g = 1; int main() { __VERIFIER_assert(g == 1); return 0; }
Add global initializer SV-COMP test
Add global initializer SV-COMP test
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
e00712b97423b86c1e8aa2eefe7c655e61d415f3
mudlib/mud/home/Text/sys/verb/wiz/ooc/object/touchall.c
mudlib/mud/home/Text/sys/verb/wiz/ooc/object/touchall.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths.h> #include <text/paths.h> #include <status.h> inherit LIB_RAWVERB; void main(object actor, string args) { mixed *st; int i, sz; int tcount; if (query_user()->query_class() < 2) { send_out("You do not have sufficient access rights to touch all clones.\n"); return; } st = status(args); if (!st) { send_out("No such object.\n"); return; } sz = status(ST_OTABSIZE); for (i = 0; i < sz; i++) { object obj; obj = find_object(args + "#" + i); if (obj) { call_touch(obj); tcount++; } } send_out(tcount + " objects touched.\n"); }
Add verb to touch all clones of a given clonable
Add verb to touch all clones of a given clonable
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
28f190e88bf324798276e4e8d4f5792cf6919fa6
Location/BackgroundTaskManager.h
Location/BackgroundTaskManager.h
// // BackgroundTaskManager.h // // Created by Puru Shukla on 20/02/13. // Copyright (c) 2013 Puru Shukla. All rights reserved. // #import <Foundation/Foundation.h> @interface BackgroundTaskManager : NSObject +(instancetype)sharedBackgroundTaskManager; -(UIBackgroundTaskIdentifier)beginNewBackgroundTask; @end
// // BackgroundTaskManager.h // // Created by Puru Shukla on 20/02/13. // Copyright (c) 2013 Puru Shukla. All rights reserved. // #import <Foundation/Foundation.h> @interface BackgroundTaskManager : NSObject +(instancetype)sharedBackgroundTaskManager; -(UIBackgroundTaskIdentifier)beginNewBackgroundTask; -(void)endAllBackgroundTasks; @end
Add endAllBackgroundTasks to the Public API
Add endAllBackgroundTasks to the Public API
C
mit
kevinnguy/Location
1656855c0467348823d4decdbd4131875381d2c9
searchcore/src/vespa/searchcore/bmcluster/bm_node_stats_reporter.h
searchcore/src/vespa/searchcore/bmcluster/bm_node_stats_reporter.h
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vespalib/util/threadstackexecutor.h> #include <chrono> #include <mutex> #include <condition_variable> namespace search::bmcluster { class BmCluster; class BmNodeStatsReporter { BmCluster& _cluster; vespalib::ThreadStackExecutor _executor; std::mutex _mutex; std::condition_variable _cond; uint32_t _pending_report; bool _started; bool _stop; void report(); void run_report_loop(std::chrono::milliseconds interval); public: BmNodeStatsReporter(BmCluster& cluster); ~BmNodeStatsReporter(); void start(std::chrono::milliseconds interval); void stop(); void report_now(); }; }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vespalib/util/threadstackexecutor.h> #include <chrono> #include <mutex> #include <condition_variable> namespace search::bmcluster { class BmCluster; /* * Class handling background reporting of node stats during feed or * document redistribution. */ class BmNodeStatsReporter { BmCluster& _cluster; vespalib::ThreadStackExecutor _executor; std::mutex _mutex; std::condition_variable _cond; uint32_t _pending_report; bool _started; bool _stop; void report(); void run_report_loop(std::chrono::milliseconds interval); public: BmNodeStatsReporter(BmCluster& cluster); ~BmNodeStatsReporter(); void start(std::chrono::milliseconds interval); void stop(); void report_now(); }; }
Add class comment for BmNodeStatsReporter.
Add class comment for BmNodeStatsReporter.
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
cd845e38761b52497ff4ad02d32490d2c7a4ac24
include/dirbrowserformaction.h
include/dirbrowserformaction.h
#ifndef NEWSBOAT_DIRBROWSERFORMACTION_H #define NEWSBOAT_DIRBROWSERFORMACTION_H #include <grp.h> #include "configcontainer.h" #include "formaction.h" namespace newsboat { class DirBrowserFormAction : public FormAction { public: DirBrowserFormAction(View*, std::string formstr, ConfigContainer* cfg); ~DirBrowserFormAction() override; void prepare() override; void init() override; KeyMapHintEntry* get_keymap_hint() override; void set_dir(const std::string& d) { dir = d; } std::string id() const override { return "filebrowser"; } std::string title() override; private: void process_operation(Operation op, bool automatic = false, std::vector<std::string>* args = nullptr) override; std::string add_directory(std::string dirname); std::string get_rwx(unsigned short val); std::string get_owner(uid_t uid); std::string get_group(gid_t gid); std::string get_formatted_dirname(std::string dirname, char ftype, mode_t mode); std::string cwd; std::string dir; }; } // namespace newsboat #endif //NEWSBOAT_DIRBROWSERFORMACTION_H
#ifndef NEWSBOAT_DIRBROWSERFORMACTION_H #define NEWSBOAT_DIRBROWSERFORMACTION_H #include <sys/stat.h> #include <grp.h> #include "configcontainer.h" #include "formaction.h" namespace newsboat { class DirBrowserFormAction : public FormAction { public: DirBrowserFormAction(View*, std::string formstr, ConfigContainer* cfg); ~DirBrowserFormAction() override; void prepare() override; void init() override; KeyMapHintEntry* get_keymap_hint() override; void set_dir(const std::string& d) { dir = d; } std::string id() const override { return "filebrowser"; } std::string title() override; private: void process_operation(Operation op, bool automatic = false, std::vector<std::string>* args = nullptr) override; std::string add_directory(std::string dirname); std::string get_rwx(unsigned short val); std::string get_owner(uid_t uid); std::string get_group(gid_t gid); std::string get_formatted_dirname(std::string dirname, char ftype, mode_t mode); std::string cwd; std::string dir; }; } // namespace newsboat #endif //NEWSBOAT_DIRBROWSERFORMACTION_H
Fix DirBrowserFormAction build on FreeBSD
Fix DirBrowserFormAction build on FreeBSD
C
mit
der-lyse/newsboat,newsboat/newsboat,newsboat/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat,der-lyse/newsboat,der-lyse/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,der-lyse/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat
87c0785d81c31a969bbf8029363ea042fdd82587
src/tileset.h
src/tileset.h
#ifndef _TILESET_H_ #define _TILESET_H_ #include <SDL.h> //#define TILESET_ROW_LENGTH 8 typedef struct tileset { SDL_Surface *image; SDL_Rect *clip; int length; } tileset; int tilesetLoad(tileset *tSet, char *fileName, int width, int height, int rowLen, int length); void tilesetUnload(tileset *tSet); #endif /* _TILESET_H_ */
#ifndef _TILESET_H_ #define _TILESET_H_ #include <SDL.h> typedef struct tileset { SDL_Surface *image; SDL_Rect *clip; int length; } tileset; int tilesetLoad(tileset *tSet, char *fileName, int width, int height, int rowLen, int length); void tilesetUnload(tileset *tSet); #endif /* _TILESET_H_ */
Remove redundant commended out code
Remove redundant commended out code
C
mit
zear/shisen-seki,zear/shisen-seki
34f818ebe0539bf77576f7b45d28a70160271754
program.c
program.c
/* Preprocessor defines added by opencl compiler * #define CONFIGS_PER_PROC */ __kernel void start_trampoline(__global char *match_configs, __global char *output) { __private unsigned int i; for (i = 0; i < 256; i++) { output[i] = CONFIGS_PER_PROC; } write_mem_fence(CLK_GLOBAL_MEM_FENCE); return; }
/* Preprocessor defines added by opencl compiler * #define CONFIGS_PER_PROC */ __kernel void start_trampoline(__global char *match_configs, __global char *output) { __private unsigned int i, startloc; // Per worker match configs. __private char local_match_configs[CONFIGS_PER_PROC * sizeof(char) * 4]; // Read in per worker match configs startloc = get_local_id(0) * CONFIGS_PER_PROC * 4; for (i = 0; i < CONFIGS_PER_PROC * 4; i++) local_match_configs[i] = match_configs[startloc + i]; for (i = 0; i < 256; i++) { output[i] = CONFIGS_PER_PROC; } write_mem_fence(CLK_GLOBAL_MEM_FENCE); return; }
Load match configs into each local proc.
Load match configs into each local proc.
C
bsd-2-clause
jmorse/worms,jmorse/worms
0b4900a73fb6206ad82511b2054843baec172618
gpm/spinner.c
gpm/spinner.c
// Calculates the 45th Fibonacci number with a visual indicator. #include <stdio.h> #include <assert.h> #include <libdill.h> // Calculates Fibonacci of x. static int fib(int x) { // Need to yield or spinner will not have any time to spin. int rc = yield(); assert(rc == 0); if (x < 2) return x; return fib(x - 1) + fib(x - 2); } coroutine void spinner(int delay) { const char spinChars[] = {'-', '\\', '|', '/'}; while (1) { for (int i = 0; i < sizeof(spinChars); i++) { printf("\r%c", spinChars[i]); msleep(now() + delay); } } } int main() { // Turn off buffering on stdout otherwise we won't see the spinner. setbuf(stdout, NULL); int rc = go(spinner(100)); assert(rc != -1); const int n = 45; int fibN = fib(n); printf("\rFibonacci(%d) = %d\n", n, fibN); }
// Calculates the 45th Fibonacci number with a visual indicator. // Note: using yield() in fib() may allow the spinner to actually spin, but // fib() takes a lot longer to complete. E.g. Over 2 minutes with yield() // vs. 10 seconds without it. #include <stdio.h> #include <assert.h> #include <libdill.h> // Calculates Fibonacci of x. static int fib(int x) { // Need to yield or spinner will not have any time to spin. int rc = yield(); assert(rc == 0); if (x < 2) return x; return fib(x - 1) + fib(x - 2); } coroutine void spinner(int delay) { const char spinChars[] = {'-', '\\', '|', '/'}; while (1) { for (int i = 0; i < sizeof(spinChars); i++) { printf("\r%c", spinChars[i]); msleep(now() + delay); } } } int main() { // Turn off buffering on stdout otherwise we won't see the spinner. setbuf(stdout, NULL); int rc = go(spinner(500)); assert(rc != -1); const int n = 45; int fibN = fib(n); printf("\rFibonacci(%d) = %d\n", n, fibN); }
Add note about using yield().
Add note about using yield().
C
mit
jppunnett/libdill-tutorial
64c9fe48234cd49ae730f3d2f80a0b7eb3c6d897
Josh_Zane_Sebastian/src/parser/parser.c
Josh_Zane_Sebastian/src/parser/parser.c
#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);
#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 = malloc(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; } char** spcTokenize(char* regCode) { int n = 0; int i; for(i = 0; regCode[i]; i++) { if(regCode[i] == ' ') { n++; } } char** spcTokens = malloc(sizeof(char*) * (n+1)); int k; for(i = 0; i < n+1; i++) { k = strchr(regCode, ' ') - regCode; regCode[k] = NULL; spcTokens[i] = regCode + k + 1; } }
Refactor the space tokenizer to be its own function; parse() no longer exists.
Refactor the space tokenizer to be its own function; parse() no longer exists.
C
mit
aacoppa/final,aacoppa/final
02d72c81af73bdd765beb3af9b7915209e18a747
atom/common/common_message_generator.h
atom/common/common_message_generator.h
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. // Multiply-included file, no traditional include guard. #include "atom/common/api/api_messages.h" #include "chrome/common/print_messages.h" #include "chrome/common/tts_messages.h" #include "chrome/common/widevine_cdm_messages.h"
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. // Multiply-included file, no traditional include guard. #include "atom/common/api/api_messages.h" #include "chrome/common/print_messages.h" #include "chrome/common/tts_messages.h" #include "chrome/common/widevine_cdm_messages.h" #include "chrome/common/chrome_utility_messages.h"
Fix linking problem with IPC::MessageT
Fix linking problem with IPC::MessageT IPC::MessageT<ChromeUtilityHostMsg_ProcessStarted_Meta, std::__1::tuple<>, void>::MessageT(IPC::Routing)
C
mit
seanchas116/electron,shiftkey/electron,shiftkey/electron,Floato/electron,brenca/electron,thompsonemerson/electron,thomsonreuters/electron,jhen0409/electron,tinydew4/electron,twolfson/electron,tonyganch/electron,tonyganch/electron,aichingm/electron,kcrt/electron,stevekinney/electron,kokdemo/electron,the-ress/electron,stevekinney/electron,noikiy/electron,gabriel/electron,rajatsingla28/electron,miniak/electron,electron/electron,brave/electron,dongjoon-hyun/electron,rajatsingla28/electron,gerhardberger/electron,thompsonemerson/electron,bpasero/electron,gabriel/electron,tinydew4/electron,twolfson/electron,gerhardberger/electron,kokdemo/electron,shiftkey/electron,rajatsingla28/electron,brave/muon,rajatsingla28/electron,tinydew4/electron,wan-qy/electron,leethomas/electron,preco21/electron,seanchas116/electron,kokdemo/electron,miniak/electron,leethomas/electron,the-ress/electron,posix4e/electron,wan-qy/electron,shiftkey/electron,thomsonreuters/electron,brave/electron,rreimann/electron,miniak/electron,gerhardberger/electron,MaxWhere/electron,renaesop/electron,MaxWhere/electron,bpasero/electron,gabriel/electron,jhen0409/electron,kcrt/electron,deed02392/electron,voidbridge/electron,brave/muon,aliib/electron,aichingm/electron,shiftkey/electron,aliib/electron,renaesop/electron,noikiy/electron,brave/muon,bpasero/electron,leethomas/electron,aliib/electron,gerhardberger/electron,biblerule/UMCTelnetHub,preco21/electron,stevekinney/electron,aichingm/electron,biblerule/UMCTelnetHub,electron/electron,thompsonemerson/electron,MaxWhere/electron,joaomoreno/atom-shell,gabriel/electron,dongjoon-hyun/electron,thomsonreuters/electron,Floato/electron,noikiy/electron,leethomas/electron,the-ress/electron,thompsonemerson/electron,leethomas/electron,rajatsingla28/electron,bpasero/electron,tinydew4/electron,MaxWhere/electron,minggo/electron,tinydew4/electron,deed02392/electron,joaomoreno/atom-shell,rreimann/electron,voidbridge/electron,preco21/electron,thomsonreuters/electron,wan-qy/electron,rajatsingla28/electron,bbondy/electron,preco21/electron,minggo/electron,gabriel/electron,wan-qy/electron,seanchas116/electron,kcrt/electron,bpasero/electron,tonyganch/electron,renaesop/electron,Floato/electron,dongjoon-hyun/electron,stevekinney/electron,preco21/electron,brave/muon,Gerhut/electron,rreimann/electron,Floato/electron,gerhardberger/electron,tonyganch/electron,noikiy/electron,biblerule/UMCTelnetHub,twolfson/electron,kokdemo/electron,deed02392/electron,Gerhut/electron,preco21/electron,stevekinney/electron,miniak/electron,joaomoreno/atom-shell,aliib/electron,gerhardberger/electron,dongjoon-hyun/electron,voidbridge/electron,thomsonreuters/electron,Floato/electron,jhen0409/electron,aichingm/electron,deed02392/electron,voidbridge/electron,seanchas116/electron,brenca/electron,posix4e/electron,minggo/electron,bbondy/electron,brenca/electron,thompsonemerson/electron,kokdemo/electron,aliib/electron,bbondy/electron,gerhardberger/electron,kcrt/electron,Gerhut/electron,the-ress/electron,the-ress/electron,stevekinney/electron,bpasero/electron,brenca/electron,aliib/electron,Gerhut/electron,bbondy/electron,rreimann/electron,electron/electron,renaesop/electron,twolfson/electron,Floato/electron,noikiy/electron,kcrt/electron,thomsonreuters/electron,biblerule/UMCTelnetHub,brave/electron,wan-qy/electron,kcrt/electron,leethomas/electron,shiftkey/electron,joaomoreno/atom-shell,brenca/electron,minggo/electron,bbondy/electron,brenca/electron,biblerule/UMCTelnetHub,joaomoreno/atom-shell,seanchas116/electron,tonyganch/electron,bbondy/electron,posix4e/electron,dongjoon-hyun/electron,brave/electron,jhen0409/electron,dongjoon-hyun/electron,brave/electron,tonyganch/electron,brave/electron,voidbridge/electron,brave/muon,posix4e/electron,biblerule/UMCTelnetHub,deed02392/electron,posix4e/electron,Gerhut/electron,electron/electron,electron/electron,minggo/electron,twolfson/electron,MaxWhere/electron,Gerhut/electron,jhen0409/electron,noikiy/electron,electron/electron,the-ress/electron,renaesop/electron,aichingm/electron,rreimann/electron,voidbridge/electron,bpasero/electron,renaesop/electron,thompsonemerson/electron,jhen0409/electron,MaxWhere/electron,tinydew4/electron,electron/electron,deed02392/electron,kokdemo/electron,twolfson/electron,brave/muon,posix4e/electron,miniak/electron,rreimann/electron,wan-qy/electron,seanchas116/electron,joaomoreno/atom-shell,aichingm/electron,minggo/electron,miniak/electron,gabriel/electron,the-ress/electron
851b80ea96383be2e95f36b238f390e9c2f9880e
Include/boolobject.h
Include/boolobject.h
/* Boolean object interface */ typedef PyIntObject PyBoolObject; extern DL_IMPORT(PyTypeObject) PyBool_Type; #define PyBool_Check(x) ((x)->ob_type == &PyBool_Type) /* Py_False and Py_True are the only two bools in existence. Don't forget to apply Py_INCREF() when returning either!!! */ /* Don't use these directly */ extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; /* Use these macros */ #define Py_False ((PyObject *) &_Py_ZeroStruct) #define Py_True ((PyObject *) &_Py_TrueStruct) /* Function to return a bool from a C long */ PyObject *PyBool_FromLong(long);
/* Boolean object interface */ #ifndef Py_BOOLOBJECT_H #define Py_BOOLOBJECT_H #ifdef __cplusplus extern "C" { #endif typedef PyIntObject PyBoolObject; extern DL_IMPORT(PyTypeObject) PyBool_Type; #define PyBool_Check(x) ((x)->ob_type == &PyBool_Type) /* Py_False and Py_True are the only two bools in existence. Don't forget to apply Py_INCREF() when returning either!!! */ /* Don't use these directly */ extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; /* Use these macros */ #define Py_False ((PyObject *) &_Py_ZeroStruct) #define Py_True ((PyObject *) &_Py_TrueStruct) /* Function to return a bool from a C long */ PyObject *PyBool_FromLong(long); #ifdef __cplusplus } #endif #endif /* !Py_BOOLOBJECT_H */
Add standard header preamble and footer, a-la intobject.h. Main purpose is extern "C" for C++ programs.
Add standard header preamble and footer, a-la intobject.h. Main purpose is extern "C" for C++ programs.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
62e863f35270846b5cb74fd5425f9d041bcb659b
solutions/uri/1039/1039.c
solutions/uri/1039/1039.c
#include <math.h> #include <stdio.h> int main() { double r1, x1, y1, r2, x2, y2; double distance; while (scanf("%lf %lf %lf %lf %lf %lf", &r1, &x1, &y1, &r2, &x2, &y2) != EOF) { distance = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); if (r1 >= distance + r2) { puts("RICO"); } else { puts("MORTO"); } } return 0; }
Solve Fire Flowers in c
Solve Fire Flowers in c
C
mit
deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground
aad15687e0b91cba541cb939df092a15dbf43ae5
src/core/kms-utils.c
src/core/kms-utils.c
#include <gst/gst.h> #include "kms-core.h" static GstElement *pipe = NULL; static G_LOCK_DEFINE(mutex); static gboolean init = FALSE; static gboolean bus_watch(GstBus *bus, GstMessage *message, gpointer data) { KMS_LOG_DEBUG("TODO: implement bus watcher\n"); return TRUE; } void kms_init(gint *argc, gchar **argv[]) { G_LOCK(mutex); if (!init) { GstBus *bus; g_type_init(); gst_init(argc, argv); pipe = gst_pipeline_new(NULL); gst_element_set_state(pipe, GST_STATE_PLAYING); bus = gst_element_get_bus(pipe); gst_bus_add_watch(bus, bus_watch, NULL); init = TRUE; } G_UNLOCK(mutex); } GstElement* kms_get_pipeline() { return pipe; }
#include <gst/gst.h> #include "kms-core.h" static GstElement *pipe = NULL; static G_LOCK_DEFINE(mutex); static gboolean init = FALSE; static gpointer gstreamer_thread(gpointer data) { GMainLoop *loop; loop = g_main_loop_new(NULL, TRUE); g_main_loop_run(loop); return NULL; } void kms_init(gint *argc, gchar **argv[]) { G_LOCK(mutex); if (!init) { GstBus *bus; g_type_init(); gst_init(argc, argv); pipe = gst_pipeline_new(NULL); gst_element_set_state(pipe, GST_STATE_PLAYING); bus = gst_element_get_bus(pipe); gst_bus_add_watch(bus, gst_bus_async_signal_func, NULL); g_thread_create(gstreamer_thread, NULL, TRUE, NULL); init = TRUE; } G_UNLOCK(mutex); } GstElement* kms_get_pipeline() { return pipe; }
Make all bus events to be signals
Make all bus events to be signals
C
lgpl-2.1
shelsonjava/kurento-media-server,mparis/kurento-media-server,todotobe1/kurento-media-server,todotobe1/kurento-media-server,lulufei/kurento-media-server,TribeMedia/kurento-media-server,shelsonjava/kurento-media-server,Kurento/kurento-media-server,lulufei/kurento-media-server,mparis/kurento-media-server,Kurento/kurento-media-server,TribeMedia/kurento-media-server
b817c6cc5a0231a0ad9bb1e71a69a15df05e4d80
cmacros/effectless.h
cmacros/effectless.h
#ifndef _EFFECTLESS #define EFFECTLESS /* Macros without multiple execution of side-effects. */ /* Generic min and max without double execution of side-effects: http://stackoverflow.com/questions/3437404/min-and-max-in-c */ #define _CHOOSE(boolop, a, b, uid) \ ({ \ decltype(a) _a_ ## uid = (a); \ decltype(b) _b_ ## uid = (b); \ (a) boolop (b) ? (a) : (b); \ }) #undef MIN #undef MAX #define MIN(a, b) _CHOOSE(<, a, b, __COUNTER__) #define MAX(a, b) _CHOOSE(>, a, b, __COUNTER__) #endif
#ifndef _EFFECTLESS #define EFFECTLESS /* Macros without multiple execution of side-effects. */ /* Generic min and max without double execution of side-effects: http://stackoverflow.com/questions/3437404/min-and-max-in-c */ #define _CHOOSE(boolop, a, b, uid) \ ({ \ decltype(a) _a_ ## uid = (a); \ decltype(b) _b_ ## uid = (b); \ (_a_ ## uid) boolop (_b_ ## uid) ? (_a_ ## uid) : (_b_ ## uid); \ }) #undef MIN #undef MAX #define MIN(a, b) _CHOOSE(<, a, b, __COUNTER__) #define MAX(a, b) _CHOOSE(>, a, b, __COUNTER__) #endif
Fix `_CHOOSE` to use the copies instead of double execution of side-effects (issue reported by tromp at bitcointalk.org)
Fix `_CHOOSE` to use the copies instead of double execution of side-effects (issue reported by tromp at bitcointalk.org)
C
unlicense
shelby3/cmacros,shelby3/cmacros
ab2bf7a582302431dec4de7ec7f1434fdac6ebac
mudlib/mud/home/Help/initd.c
mudlib/mud/home/Help/initd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2009, 2012, 2013, 2014 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/bigstruct.h> #include <kotaka/paths/system.h> #include <kotaka/privilege.h> inherit LIB_INITD; inherit UTILITY_COMPILE; static void create() { KERNELD->set_global_access("Help", 1); load_dir("obj", 1); load_dir("sys", 1); }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2009, 2012, 2013, 2014 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/bigstruct.h> #include <kotaka/paths/system.h> #include <kotaka/privilege.h> inherit LIB_INITD; inherit UTILITY_COMPILE; static void create() { KERNELD->set_global_access("Help", 1); load_dir("obj", 1); load_dir("sys", 1); } void do_upgrade() { INITD->shutdown_subsystem("Help"); }
Make gutted help subsystem shut itself down on next upgrade
Make gutted help subsystem shut itself down on next upgrade
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
f93e670354840c8f31b1c4898329c219a4abb701
kernel/extra/debugpanel/dp_mem_chunks.c
kernel/extra/debugpanel/dp_mem_chunks.c
/* SPDX-License-Identifier: BSD-2-Clause */ #include <tilck/common/basic_defs.h> #include <tilck/common/string_util.h> #include <tilck/kernel/kmalloc.h> #include <tilck/kernel/cmdline.h> #include "termutil.h" #include "dp_int.h" static debug_kmalloc_chunk_stat chunks_arr[1024]; static void dp_show_chunks(void) { debug_kmalloc_stats stats; int row = dp_screen_start_row; if (!KMALLOC_HEAVY_STATS) { dp_writeln("Not available: recompile with KMALLOC_HEAVY_STATS=1"); return; } debug_kmalloc_get_stats(&stats); if (stats.chunk_sizes_count > ARRAY_SIZE(chunks_arr)) { dp_writeln("Not enough space in chunks_arr!"); return; } debug_kmalloc_get_chunks_info(chunks_arr); for (size_t i = 0; i < stats.chunk_sizes_count; i++) { dp_writeln("Size: %8u -> %6u allocs", chunks_arr[i].size, chunks_arr[i].count); } } static dp_screen dp_chunks_screen = { .index = 5, .label = "MemChunks", .draw_func = dp_show_chunks, .on_keypress_func = NULL, }; __attribute__((constructor)) static void dp_chunks_init(void) { dp_register_screen(&dp_chunks_screen); }
Add the MemChunks screen [for kmalloc heavy stats]
[debugpanel] Add the MemChunks screen [for kmalloc heavy stats]
C
bsd-2-clause
vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs
76de586faadc195b372248b8f52e66568c31ec1a
src/port/getrusage.c
src/port/getrusage.c
#include "../sccs.h" #ifdef WIN32 #include <psapi.h> u64 maxrss(void) { PROCESS_MEMORY_COUNTERS cnt; if (GetProcessMemoryInfo(GetCurrentProcess(), &cnt, sizeof(cnt))) { return (cnt.PeakWorkingSetSize); } return (0); } #else #include <sys/resource.h> u64 maxrss(void) { struct rusage ru; if (!getrusage(RUSAGE_SELF, &ru)) return (1024 * ru.ru_maxrss); return (0); } #endif
#include "../sccs.h" #ifdef WIN32 #include <psapi.h> u64 maxrss(void) { PROCESS_MEMORY_COUNTERS cnt; if (GetProcessMemoryInfo(GetCurrentProcess(), &cnt, sizeof(cnt))) { return (cnt.PeakWorkingSetSize); } return (0); } #else #include <sys/resource.h> u64 maxrss(void) { struct rusage ru; #if defined(sun) int factor = getpagesize(); #elif defined(__APPLE__) int factor = 1; #else int factor = 1024; #endif if (getrusage(RUSAGE_SELF, &ru)) return (0); return (ru.ru_maxrss * factor); } #endif
Adjust for the fact that MacOS X and Solaris report maxrss in different units.
Adjust for the fact that MacOS X and Solaris report maxrss in different units. bk: 5489ebbfQIN1Wbpf9Qa4aY-VK6F8xw
C
apache-2.0
bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper
54d4ca4f7db1a12316b03a839710437765f5273a
src/ZeroField.h
src/ZeroField.h
#ifndef __ZERO_FIELD_H__ #define __ZERO_FIELD_H__ #include "Field.h" namespace cigma { class ZeroField; } class cigma::ZeroField : public cigma::Field { public: ZeroField(); ~ZeroField(); void set_shape(int dim, int rank); public: int n_dim() { return dim; } int n_rank() { return rank; } FieldType getType() { return USER_FIELD; } public: bool eval(double *point, double *value); public: int dim; int rank; }; #endif
#ifndef __ZERO_FIELD_H__ #define __ZERO_FIELD_H__ #include "UserField.h" namespace cigma { class ZeroField; } class cigma::ZeroField : public cigma::UserField { public: ZeroField(); ~ZeroField(); void set_shape(int dim, int rank); public: int n_dim() { return dim; } int n_rank() { return rank; } public: bool eval(double *point, double *value); public: int dim; int rank; }; #endif
Make zero a user field
Make zero a user field
C
lgpl-2.1
geodynamics/cigma,geodynamics/cigma,geodynamics/cigma,geodynamics/cigma,geodynamics/cigma
ee6f262065dc3957de34372ca9d059c7190024ad
java/include/pstore-jni.h
java/include/pstore-jni.h
#ifndef PSTOREJNI_H #define PSTOREJNI_H #include <inttypes.h> #ifdef __i386__ #define LONG_TO_PTR(ptr) (void *) (uint32_t) ptr #elif __X86_64__ #define LONG_TO_PTR(ptr) (void *) ptr #endif #define PTR_TO_LONG(ptr) (long) ptr #endif
Add 'LONG_TO_PTR' and 'PTR_TO_LONG' macros
java: Add 'LONG_TO_PTR' and 'PTR_TO_LONG' macros Signed-off-by: Karim Osman <[email protected]> Signed-off-by: Pekka Enberg <[email protected]>
C
lgpl-2.1
penberg/pstore,penberg/pstore,penberg/pstore,penberg/pstore
2f329161a12024e003427fc98e2ce6b7cfcfce48
MORK/MORK.h
MORK/MORK.h
// // MORK.h // MORK // // Created by Nolan Carroll on 4/23/15. // Copyright (c) 2015 Medidata Solutions. All rights reserved. // #import <UIKit/UIKit.h> #import "ORKTaskResult+MORK.h" #import "ORKQuestionResult+MORK.h" //! Project version number for MORK. FOUNDATION_EXPORT double MORKVersionNumber; //! Project version string for MORK. FOUNDATION_EXPORT const unsigned char MORKVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <MORK/PublicHeader.h>
// // MORK.h // MORK // // Created by Nolan Carroll on 4/23/15. // Copyright (c) 2015 Medidata Solutions. All rights reserved. // #import <UIKit/UIKit.h> #import "ORKCollectionResult+MORK.h" #import "ORKQuestionResult+MORK.h" //! Project version number for MORK. FOUNDATION_EXPORT double MORKVersionNumber; //! Project version string for MORK. FOUNDATION_EXPORT const unsigned char MORKVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <MORK/PublicHeader.h>
Update import in main header file
Update import in main header file
C
mit
mdsol/MORK,mdsol/MORK
cae22b0d5dbd38fff95f3730914ae03e12e7b5bd
core/metacling/inc/LinkDef.h
core/metacling/inc/LinkDef.h
/* @(#)root/meta:$Id: 4660ec009138a70261265c65fc5a10398706fbd1 $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifdef __CINT__ #pragma link C++ class TCling; #endif
/* @(#)root/meta:$Id$ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifdef __CINT__ #pragma link C++ class TCling; #endif
Clean up versioning commit hash.
Clean up versioning commit hash.
C
lgpl-2.1
karies/root,root-mirror/root,agarciamontoro/root,bbockelm/root,zzxuanyuan/root,root-mirror/root,bbockelm/root,karies/root,gbitzes/root,zzxuanyuan/root,mhuwiler/rootauto,gbitzes/root,gganis/root,karies/root,zzxuanyuan/root,agarciamontoro/root,olifre/root,BerserkerTroll/root,buuck/root,karies/root,bbockelm/root,mhuwiler/rootauto,root-mirror/root,BerserkerTroll/root,zzxuanyuan/root,simonpf/root,satyarth934/root,abhinavmoudgil95/root,mhuwiler/rootauto,olifre/root,karies/root,buuck/root,gganis/root,olifre/root,abhinavmoudgil95/root,BerserkerTroll/root,agarciamontoro/root,mhuwiler/rootauto,root-mirror/root,abhinavmoudgil95/root,zzxuanyuan/root,beniz/root,olifre/root,agarciamontoro/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,davidlt/root,satyarth934/root,davidlt/root,agarciamontoro/root,mhuwiler/rootauto,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,root-mirror/root,simonpf/root,satyarth934/root,bbockelm/root,karies/root,beniz/root,karies/root,zzxuanyuan/root-compressor-dummy,gganis/root,zzxuanyuan/root-compressor-dummy,beniz/root,satyarth934/root,simonpf/root,davidlt/root,mhuwiler/rootauto,buuck/root,agarciamontoro/root,satyarth934/root,agarciamontoro/root,buuck/root,BerserkerTroll/root,BerserkerTroll/root,abhinavmoudgil95/root,abhinavmoudgil95/root,bbockelm/root,davidlt/root,gganis/root,abhinavmoudgil95/root,gbitzes/root,buuck/root,zzxuanyuan/root,beniz/root,olifre/root,agarciamontoro/root,agarciamontoro/root,davidlt/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,gbitzes/root,satyarth934/root,root-mirror/root,zzxuanyuan/root-compressor-dummy,root-mirror/root,zzxuanyuan/root-compressor-dummy,gganis/root,abhinavmoudgil95/root,olifre/root,satyarth934/root,zzxuanyuan/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,beniz/root,satyarth934/root,davidlt/root,bbockelm/root,satyarth934/root,BerserkerTroll/root,bbockelm/root,simonpf/root,gbitzes/root,gbitzes/root,gganis/root,abhinavmoudgil95/root,agarciamontoro/root,mhuwiler/rootauto,davidlt/root,zzxuanyuan/root-compressor-dummy,mhuwiler/rootauto,olifre/root,mhuwiler/rootauto,BerserkerTroll/root,karies/root,mhuwiler/rootauto,satyarth934/root,beniz/root,buuck/root,gbitzes/root,simonpf/root,gbitzes/root,davidlt/root,gganis/root,buuck/root,zzxuanyuan/root,gganis/root,olifre/root,beniz/root,bbockelm/root,root-mirror/root,simonpf/root,beniz/root,bbockelm/root,buuck/root,agarciamontoro/root,zzxuanyuan/root,olifre/root,olifre/root,mhuwiler/rootauto,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,gganis/root,beniz/root,simonpf/root,root-mirror/root,davidlt/root,olifre/root,buuck/root,gbitzes/root,buuck/root,davidlt/root,karies/root,beniz/root,simonpf/root,root-mirror/root,gbitzes/root,abhinavmoudgil95/root,simonpf/root,gganis/root,bbockelm/root,gbitzes/root,bbockelm/root,gganis/root,karies/root,satyarth934/root,simonpf/root,karies/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,BerserkerTroll/root,buuck/root,davidlt/root,simonpf/root,root-mirror/root,beniz/root
ec47d75d7c8610c81b402d20885ecf2f5e80c784
test/CodeGen/forwarding-blocks-if.c
test/CodeGen/forwarding-blocks-if.c
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // Check that no empty blocks are generated for nested ifs. extern void func(); int f0(int val) { if (val == 0) { func(); } else if (val == 1) { func(); } return 0; } // CHECK-LABEL: define i32 @f0 // CHECK: call void {{.*}} @func // CHECK: call void {{.*}} @func // CHECK: br label %[[RETBLOCK1:[^ ]*]] // CHECK: [[RETBLOCK1]]: // CHECK-NOT: br label // CHECK: ret i32 int f1(int val, int g) { if (val == 0) if (g == 1) { func(); } return 0; } // CHECK-LABEL: define i32 @f1 // CHECK: call void {{.*}} @func // CHECK: br label %[[RETBLOCK2:[^ ]*]] // CHECK: [[RETBLOCK2]]: // CHECK-NOT: br label // CHECK: ret i32
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // Check that no empty blocks are generated for nested ifs. extern void func(); int f0(int val) { if (val == 0) { func(); } else if (val == 1) { func(); } return 0; } // CHECK-LABEL: define {{.*}} i32 @f0 // CHECK: call void {{.*}} @func // CHECK: call void {{.*}} @func // CHECK: br label %[[RETBLOCK1:[^ ]*]] // CHECK: [[RETBLOCK1]]: // CHECK-NOT: br label // CHECK: ret i32 int f1(int val, int g) { if (val == 0) if (g == 1) { func(); } return 0; } // CHECK-LABEL: define {{.*}} i32 @f1 // CHECK: call void {{.*}} @func // CHECK: br label %[[RETBLOCK2:[^ ]*]] // CHECK: [[RETBLOCK2]]: // CHECK-NOT: br label // CHECK: ret i32
Fix test submitted with r275115 (failed on ppc64 buildbots).
Fix test submitted with r275115 (failed on ppc64 buildbots). git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@275127 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
3864a8322e66280ad9c142810b80f9ac645b9754
test_fft.c
test_fft.c
// Taken from: http://stackoverflow.com/a/14537855 #include <math.h> #include <stdio.h> #include <stdlib.h> #ifndef M_PI #define M_PI 3.14159265358979324 #endif #define N 16 #define kiss_fft_scalar double #include "kiss_fftr.h" void TestFftReal(const char *title, const kiss_fft_scalar in[N], kiss_fft_cpx out[N / 2 + 1]) { kiss_fftr_cfg cfg; printf("%s\n", title); if ((cfg = kiss_fftr_alloc(N, 0 /*is_inverse_fft*/, NULL, NULL)) != NULL) { size_t i; kiss_fftr(cfg, in, out); free(cfg); for (i = 0; i < N; i++) { printf(" in[%2zu] = %+f ", i, in[i]); if (i < N / 2 + 1) printf("out[%2zu] = %+f , %+f", i, out[i].r, out[i].i); printf("\n"); } } else { printf("not enough memory?\n"); exit(-1); } } int main(void) { kiss_fft_scalar in[N]; kiss_fft_cpx out[N / 2 + 1]; size_t i; for (i = 0; i < N; i++) in[i] = 0; TestFftReal("Zeroes (real)", in, out); for (i = 0; i < N; i++) in[i] = 1; TestFftReal("Ones (real)", in, out); for (i = 0; i < N; i++) in[i] = sin(2 * M_PI * 4 * i / N); TestFftReal("SineWave (real)", in, out); return 0; }
Add a program to test Kiss FFT.
Add a program to test Kiss FFT.
C
mit
mpoullet/audio-tools,mpoullet/audio-tools,mpoullet/audio-tools,mpoullet/audio-tools,mpoullet/audio-tools
43835c1c83c36527a5c7fae307b4118509775fbe
tests/fake_readdir.c
tests/fake_readdir.c
/* Small library to test implementation of option -Z and FPART_PARTERRNO Inspired from: https://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00058.html $ cc -fPIC -shared -o libfake_readdir.so fake_readdir.c $ mkdir -p /tmp/test/a/b/c/d/e/f/g/h/i/j $ LD_PRELOAD=./libfake_readdir.so fpart -L -E -zz -Z -f 2 -vvv /tmp/test $ mkdir -p /tmp/test/b/{c,d} $ touch /tmp/test/b/{c,d}/{a..z} $ LD_PRELOAD=./libfake_readdir.so fpart -L -E -zz -Z -f 2 -vvv /tmp/test/b */ #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <string.h> #include <dirent.h> #include <errno.h> #include <dlfcn.h> static size_t counter = 0; #define FAIL_EVERY 7 static struct dirent *(*real_readdir)(DIR *dirp) = NULL; struct dirent *readdir(DIR *dirp) { /* Keep original pointer */ if(real_readdir == NULL) real_readdir = dlsym(RTLD_NEXT, "readdir"); counter++; if((counter % FAIL_EVERY) == 0) { fprintf(stderr, "XXX Failing call to readdir(), counter = %zu\n", counter); fflush(stderr); errno=EIO; return NULL; } return real_readdir(dirp); }
Add a small wrapper to simulate readdir() errors
Add a small wrapper to simulate readdir() errors Useful to test recently-patched embedded fts and option -Z
C
bsd-2-clause
martymac/fpart,martymac/fpart
e4dfaad868cf5f29058a081422cdb4420d853311
7segments.c
7segments.c
#define L for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="w$]m.k{%\177o"[*c++-48])&u/4?124:32,y&u?95:32,y&u/2?124:32,*c?32:10);u*=8; main(int u,char**a){u=1;L;L;L}
#define L for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="w$]m.k{%\177o"[*c++-48])&u/4?33:32,y&u?95:32,y&u/2?33:32,*c?32:10);u*=8; main(int u,char**a){u=1;L;L;L}
Use ! instead of |, looks nicer also saves two bytes
Use ! instead of |, looks nicer also saves two bytes
C
mit
McZonk/7segements,McZonk/7segements
faf1826dc91d379da0258dc23adc115a5a42890d
texor.c
texor.c
#include <unistd.h> int main() { char c; while (read(STDIN_FILENO, &c, 1) == 1 && c!= 'q'); return 0; }
#include <termios.h> #include <unistd.h> void enableRawMode() { struct termios raw; tcgetattr(STDIN_FILENO, &raw); raw.c_lflag &= ~(ECHO); tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw); } int main() { enableRawMode(); char c; while (read(STDIN_FILENO, &c, 1) == 1 && c!= 'q'); return 0; }
Enable raw mode in terminal
Enable raw mode in terminal
C
bsd-2-clause
kyletolle/texor
e9d185a4d126adf5ea6c27fc4d6dc1a55cb104e4
Python/strtod.c
Python/strtod.c
/* This is not a proper strtod() implementation, but sufficient for Python. Python won't detect floating point constant overflow, though. */ extern int strlen(); extern double atof(); double strtod(p, pp) char *p; char **pp; { if (pp) *pp = p + strlen(p); return atof(p); }
/* This is not a proper strtod() implementation, but sufficient for Python. Python won't detect floating point constant overflow, though. */ extern int errno; extern int strlen(); extern double atof(); double strtod(p, pp) char *p; char **pp; { double res; if (pp) *pp = p + strlen(p); res = atof(p); errno = 0; return res; }
Clear errno, just to be sure.
Clear errno, just to be sure.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
ad5f95a1151e450413b45f81eb1f8b9b70974e68
Sources/NimbleObjectiveC/NMBStringify.h
Sources/NimbleObjectiveC/NMBStringify.h
@class NSString; /** * Returns a string appropriate for displaying in test output * from the provided value. * * @param value A value that will show up in a test's output. * * @return The string that is returned can be * customized per type by conforming a type to the `TestOutputStringConvertible` * protocol. When stringifying a non-`TestOutputStringConvertible` type, this * function will return the value's debug description and then its * normal description if available and in that order. Otherwise it * will return the result of constructing a string from the value. * * @see `TestOutputStringConvertible` */ extern NSString *_Nonnull NMBStringify(id _Nullable anyObject) __attribute__((warn_unused_result));
@class NSString; /** * Returns a string appropriate for displaying in test output * from the provided value. * * @param anyObject A value that will show up in a test's output. * * @return The string that is returned can be * customized per type by conforming a type to the `TestOutputStringConvertible` * protocol. When stringifying a non-`TestOutputStringConvertible` type, this * function will return the value's debug description and then its * normal description if available and in that order. Otherwise it * will return the result of constructing a string from the value. * * @see `TestOutputStringConvertible` */ extern NSString *_Nonnull NMBStringify(id _Nullable anyObject) __attribute__((warn_unused_result));
Fix documentation parameter name warnings
Fix documentation parameter name warnings value is not matching `anyObject`
C
apache-2.0
abbeycode/Nimble,Quick/Nimble,twobitlabs/Nimble,twobitlabs/Nimble,AnthonyMDev/Nimble,phatblat/Nimble,abbeycode/Nimble,phatblat/Nimble,Quick/Nimble,phatblat/Nimble,DanielAsher/Nimble,DanielAsher/Nimble,AnthonyMDev/Nimble,Quick/Nimble,abbeycode/Nimble,twobitlabs/Nimble,DanielAsher/Nimble,abbeycode/Nimble,AnthonyMDev/Nimble
82f655c48263612edfc4e145bc5da18ca25cf8ec
3RVX/DiskInfo.h
3RVX/DiskInfo.h
#pragma once #include <Windows.h> #include <string> class DiskInfo { public: DiskInfo(wchar_t driveLetter); static std::wstring DriveFileName(wchar_t &driveLetter); static std::wstring DriveFileName(std::wstring &driveLetter); private: HANDLE _devHandle; };
#pragma once #include <Windows.h> #include <string> class DiskInfo { public: DiskInfo(wchar_t driveLetter); static std::wstring DriveFileName(wchar_t &driveLetter); static std::wstring DriveFileName(std::wstring &driveLetter); private: HANDLE _devHandle; std::wstring _productId; std::wstring _vendorId; };
Add member variables for storing disk info
Add member variables for storing disk info
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
9f59142ee7ca004fb39be638463ad0ef0ba3a713
alura/c/forca.c
alura/c/forca.c
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); printf("%s\n", palavrasecreta); /* palavrasecreta[0] = 'M'; palavrasecreta[1] = 'E'; palavrasecreta[2] = 'L'; palavrasecreta[3] = 'A'; palavrasecreta[4] = 'N'; palavrasecreta[5] = 'C'; palavrasecreta[6] = 'I'; palavrasecreta[7] = 'A'; printf("%c%c%c%c%c%c%c%c\n", palavrasecreta[0], palavrasecreta[1], palavrasecreta[2], palavrasecreta[3], palavrasecreta[4], palavrasecreta[5], palavrasecreta[6], palavrasecreta[7]); */ }
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); printf("%s\n", palavrasecreta); /* palavrasecreta[0] = 'M'; palavrasecreta[1] = 'E'; palavrasecreta[2] = 'L'; palavrasecreta[3] = 'A'; palavrasecreta[4] = 'N'; palavrasecreta[5] = 'C'; palavrasecreta[6] = 'I'; palavrasecreta[7] = 'A'; palavrasecreta[8] = '\0'; printf("%c%c%c%c%c%c%c%c\n", palavrasecreta[0], palavrasecreta[1], palavrasecreta[2], palavrasecreta[3], palavrasecreta[4], palavrasecreta[5], palavrasecreta[6], palavrasecreta[7]); */ }
Update files, Alura, Introdução a C - Parte 2, Aula 2.2
Update files, Alura, Introdução a C - Parte 2, Aula 2.2
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
b57aae70855946e5e6a223f10b29af082937e20c
BBBAPI/BBBAPI/Classes/BBAAPIErrors.h
BBBAPI/BBBAPI/Classes/BBAAPIErrors.h
// // BBAAPIErrors.h // BBAAPI // // Created by Owen Worley on 11/08/2014. // Copyright (c) 2014 Blinkbox Books. All rights reserved. // NS_ENUM(NSInteger, BBAAPIError) { /** * Used when needed parameter is not supplied to the method * or when object is supplied but it has wrong type or * for example one of it's needed properties is not set */ BBAAPIWrongUsage = 700, /** * Error returned when for any reason API call cannot connect to the server */ BBAAPIErrorCouldNotConnect = 701, /** * Returned when call cannot be authenticated, or when server returns 401 */ BBAAPIErrorUnauthorised = 702, /** * Used when server cannot find a resource and returns 404 */ BBAAPIErrorNotFound = 703, /** * Used when server returns 500 */ BBAAPIServerError = 704, /** * Used when server returns 403 */ BBAAPIErrorForbidden = 705, /** * Used when we cannot decode or read data returned from the server */ BBAAPIUnreadableData = 706, };
// // BBAAPIErrors.h // BBAAPI // // Created by Owen Worley on 11/08/2014. // Copyright (c) 2014 Blinkbox Books. All rights reserved. // NS_ENUM(NSInteger, BBAAPIError) { /** * Used when needed parameter is not supplied to the method * or when object is supplied but it has wrong type or * for example one of it's needed properties is not set */ BBAAPIWrongUsage = 700, /** * Error returned when for any reason API call cannot connect to the server */ BBAAPIErrorCouldNotConnect = 701, /** * Returned when call cannot be authenticated, or when server returns 401 */ BBAAPIErrorUnauthorised = 702, /** * Used when server cannot find a resource and returns 404 */ BBAAPIErrorNotFound = 703, /** * Used when server returns 500 */ BBAAPIServerError = 704, /** * Used when server returns 403 */ BBAAPIErrorForbidden = 705, /** * Used when we cannot decode or read data returned from the server */ BBAAPIUnreadableData = 706, /** * Used when the server returns a 400 (Bad Request) */ BBAAPIBadRequest = 707, };
Add Bad Request error code
Add Bad Request error code
C
mit
blinkboxbooks/blinkbox-network.objc,blinkboxbooks/blinkbox-network.objc
2d67979dc01cb98b74941246685e9853439dd4a8
blocklist.h
blocklist.h
#ifndef SQREDIR_BLOCKLIST_H #define SQREDIR_BLOCKLIST_H #include <cstdio> #include <string> using namespace std; // reads the given configuration file // returns: true/false for success/failure bool read_config(string filename); // tries to match the Squid request & writes the response to the output stream // input: a request line as passed by Squid // output: response output stream (usually stdout) void match_and_reply(const char* input, FILE* output); #endif
#ifndef SQREDIR_BLOCKLIST_H #define SQREDIR_BLOCKLIST_H #include <cstdio> #include <string> // reads the given configuration file // returns: true/false for success/failure bool read_config(std::string filename); // tries to match the Squid request & writes the response to the output stream // input: a request line as passed by Squid // output: response output stream (usually stdout) void match_and_reply(const char* input, FILE* output); #endif
Remove 'using' directive from header, explicitly qualify std namespace.
Remove 'using' directive from header, explicitly qualify std namespace.
C
apache-2.0
hhoffstaette/sqredir
b60ffe69ae77c59e05f2f3985955b0034ba93b7a
MC/JPetMCDecayTree/JPetMCDecayTree.h
MC/JPetMCDecayTree/JPetMCDecayTree.h
/** * @copyright Copyright 2018 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file JPetMCDecayTree.h */ #ifndef _JPETMCHIT_H_ #define _JPETMCHIT_H_ #include "./JPetHit/JPetHit.h" /** * @brief Data class representing a hit of a photon in the scintillator strip based on Monte Carlo simulation. * */ class JPetMCDecayTree : public TObject { public: JPetMCDecayTree(); private: UInt_t fMCMCDecayTreeIndex = 0u; UInt_t fMCVtxIndex = 0u; UInt_t fnVertices = 0u; UInt_t fnTracks = 0u; // add also track and vertices structures ClassDef(JPetMCDecayTree, 1); }; #endif
/** * @copyright Copyright 2018 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file JPetMCDecayTree.h */ #ifndef _JPETMCDECAYTREE_H_ #define _JPETMCDECAYTREE_H_ #include "./JPetHit/JPetHit.h" /** * @brief Data class representing a hit of a photon in the scintillator strip based on Monte Carlo simulation. * */ class JPetMCDecayTree : public TObject { public: JPetMCDecayTree(); private: UInt_t fMCMCDecayTreeIndex = 0u; UInt_t fMCVtxIndex = 0u; UInt_t fnVertices = 0u; UInt_t fnTracks = 0u; // add also track and vertices structures ClassDef(JPetMCDecayTree, 1); }; #endif
Change header guard name to do not colide with JPetMCHit
Change header guard name to do not colide with JPetMCHit
C
apache-2.0
JPETTomography/j-pet-framework,JPETTomography/j-pet-framework,JPETTomography/j-pet-framework
0aad78ead3cc061a0cb6135ba8833ba5edc491d3
Sources/Mile/Components/ActorComponent.h
Sources/Mile/Components/ActorComponent.h
#pragma once #include "MileObject.h" namespace Mile { /** * ActorComponent Actor ߰ ִ ϴ Component ⺻ ŬԴϴ. */ class Actor; class MILE_API ActorComponent : public MileObject { friend Actor; public: ActorComponent( const MString& NewName ) : bIsTick( false ), OwnerPrivate( nullptr ), TickPriority( 0 ), MileObject( NewName ) { } ActorComponent( ActorComponent&& MovedObject ) : OwnerPrivate( MovedObject.OwnerPrivate ), bIsTick( MovedObject.bIsTick ), TickPriority( MovedObject.TickPriority ), MileObject( std::move( MovedObject ) ) { this->SetOwner( MovedObject.GetOwner( ) ); MovedObject.SetOwner( nullptr ); MovedObject.bIsTick = false; MovedObject.TickPriority = UINT64_MAX; } ActorComponent& operator=( ActorComponent&& MovedObject ) = delete; void SetOwner( Actor* Owner, bool bIsDetachBeforeSetNewOwner = true ); virtual void SetOwnerRecursively( Actor* NewOwner, bool bIsDetachBeforeSetNewOwner = true ); FORCEINLINE Actor* GetOwner( ) const { return OwnerPrivate; } virtual void TickComponent( float DeltaTime ) {} private: Actor* OwnerPrivate; public: bool bIsTick; uint64 TickPriority; }; }
#pragma once #include "MileObject.h" namespace Mile { /** * ActorComponent Actor ߰ ִ ϴ Component ⺻ ŬԴϴ. */ class Actor; class MILE_API ActorComponent : public MileObject { friend Actor; public: ActorComponent( const MString& NewName ) : bIsTick( false ), OwnerPrivate( nullptr ), TickPriority( 0 ), MileObject( NewName ) { } ActorComponent( ActorComponent&& MovedObject ) : OwnerPrivate( MovedObject.OwnerPrivate ), bIsTick( MovedObject.bIsTick ), TickPriority( MovedObject.TickPriority ), MileObject( std::move( MovedObject ) ) { this->SetOwner( MovedObject.GetOwner( ) ); MovedObject.SetOwner( nullptr ); MovedObject.bIsTick = false; MovedObject.TickPriority = UINT64_MAX; } ActorComponent& operator=( ActorComponent&& MovedObject ) = delete; void SetOwner( Actor* Owner, bool bIsDetachBeforeSetNewOwner = true ); virtual void SetOwnerRecursively( Actor* NewOwner, bool bIsDetachBeforeSetNewOwner = true ); FORCEINLINE Actor* GetOwner( ) const { return OwnerPrivate; } virtual void Tick( float DeltaTime ) { UNUSED_PARAM( DeltaTime ); } private: Actor* OwnerPrivate; bool bIsTick; uint64 TickPriority; }; }
Delete TickComponent ( because of tick manager )
Delete TickComponent ( because of tick manager )
C
mit
HoRangDev/MileEngine,HoRangDev/MileEngine
25955e1264eec2fec804d7786e2f640bf9e0d189
src/platforms/esp/32/led_sysdefs_esp32.h
src/platforms/esp/32/led_sysdefs_esp32.h
#pragma once #include "esp32-hal.h" #ifndef ESP32 #define ESP32 #endif #define FASTLED_ESP32 #if CONFIG_IDF_TARGET_ARCH_RISCV #define FASTLED_RISCV #endif #if CONFIG_IDF_TARGET_ARCH_XTENSA || CONFIG_XTENSA_IMPL #define FASTLED_XTENSA #endif // Use system millis timer #define FASTLED_HAS_MILLIS typedef volatile uint32_t RoReg; typedef volatile uint32_t RwReg; typedef unsigned long prog_uint32_t; // Default to NOT using PROGMEM here #ifndef FASTLED_USE_PROGMEM # define FASTLED_USE_PROGMEM 0 #endif #ifndef FASTLED_ALLOW_INTERRUPTS # define FASTLED_ALLOW_INTERRUPTS 1 # define INTERRUPT_THRESHOLD 0 #endif #define NEED_CXX_BITS // These can be overridden # define FASTLED_ESP32_RAW_PIN_ORDER
#pragma once #include "esp32-hal.h" #ifndef ESP32 #define ESP32 #endif #define FASTLED_ESP32 #if CONFIG_IDF_TARGET_ARCH_RISCV #define FASTLED_RISCV #else #define FASTLED_XTENSA #endif // Handling for older versions of ESP32 Arduino core #if !defined(ESP_IDF_VERSION) // Older versions of ESP_IDF only supported ESP32 #define CONFIG_IDF_TARGET_ESP32 1 // Define missing version macros. Hard code older version 3.0 since actual version is unknown #define ESP_IDF_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) #define ESP_IDF_VERSION ESP_IDF_VERSION_VAL(3, 0, 0) #endif // Use system millis timer #define FASTLED_HAS_MILLIS typedef volatile uint32_t RoReg; typedef volatile uint32_t RwReg; typedef unsigned long prog_uint32_t; // Default to NOT using PROGMEM here #ifndef FASTLED_USE_PROGMEM # define FASTLED_USE_PROGMEM 0 #endif #ifndef FASTLED_ALLOW_INTERRUPTS # define FASTLED_ALLOW_INTERRUPTS 1 # define INTERRUPT_THRESHOLD 0 #endif #define NEED_CXX_BITS // These can be overridden # define FASTLED_ESP32_RAW_PIN_ORDER
Improve compatibility with older ESP32 Arduino core versions
Improve compatibility with older ESP32 Arduino core versions
C
mit
FastLED/FastLED,FastLED/FastLED,FastLED/FastLED,FastLED/FastLED
72f1d4f87a8a107ceaddb455fca34c59737e1d33
mudlib/mud/home/Bigstruct/lib/base/node.c
mudlib/mud/home/Bigstruct/lib/base/node.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/assert.h> #include <kotaka/paths.h> #include <kotaka/privilege.h> #include <kotaka/log.h> private object root; static void create() { root = previous_object(); } static void destruct() { } static void check_caller() { ACCESS_CHECK(previous_object() == root); } nomask object query_root() { return root; }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/assert.h> #include <kotaka/paths.h> #include <kotaka/privilege.h> #include <kotaka/log.h> private object root; static void create() { root = previous_object(); } static void destruct() { } static void check_caller() { ASSERT(root); ACCESS_CHECK(previous_object() == root); } nomask object query_root() { return root; }
Add another debug check to bigstructs
Add another debug check to bigstructs
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
dbc4a86f3cf652826ad0b0ad2528535273f581c3
core/core.h
core/core.h
#if defined(WIN32) || defined(_WIN32) || \ defined(__WIN32) && !defined(__CYGWIN__) #include <BaseTsd.h> #include <windows.h> typedef SSIZE_T ssize_t; #endif #ifndef _WIN32 #include <unistd.h> #endif #include <inttypes.h> typedef char *String; typedef char *Pattern; typedef int64_t Long; #if defined NDEBUG #define CHK_INDEX(i, n) #else #define CHK_INDEX_FORMAT_STRING ":%u: bad index: %zd < %zd\n" #define CHK_INDEX(i, n) \ do { \ size_t __si = (size_t)i; \ size_t __ni = (size_t)n; \ if (!(__si < __ni)) { \ printf(__FILE__ CHK_INDEX_FORMAT_STRING, __LINE__, (ssize_t)i, \ (ssize_t)n); \ abort(); \ } \ } while (0) #endif // Array typedef struct { size_t len; size_t capacity; void *data; } Array; // Lambdas typedef struct { void *callback; void *env; void *delete; void *copy; } Lambda; typedef void *LambdaEnv;
#if defined(WIN32) || defined(_WIN32) || \ defined(__WIN32) && !defined(__CYGWIN__) #include <BaseTsd.h> #include <windows.h> typedef SSIZE_T ssize_t; #define SIZE_T_FORMAT_SPECIFIER "%ld" #endif #ifndef _WIN32 #include <unistd.h> #define SIZE_T_FORMAT_SPECIFIER "%zd" #endif #include <inttypes.h> typedef char *String; typedef char *Pattern; typedef int64_t Long; #if defined NDEBUG #define CHK_INDEX(i, n) #else #define CHK_INDEX_FORMAT_STRING ":%u: bad index: " SIZE_T_FORMAT_SPECIFIER " < " SIZE_T_FORMAT_SPECIFIER "\n" #define CHK_INDEX(i, n) \ do { \ size_t __si = (size_t)i; \ size_t __ni = (size_t)n; \ if (!(__si < __ni)) { \ printf(__FILE__ CHK_INDEX_FORMAT_STRING, __LINE__, (ssize_t)i, \ (ssize_t)n); \ abort(); \ } \ } while (0) #endif // Array typedef struct { size_t len; size_t capacity; void *data; } Array; // Lambdas typedef struct { void *callback; void *env; void *delete; void *copy; } Lambda; typedef void *LambdaEnv;
Use other format specifers on Windows.
Use other format specifers on Windows.
C
apache-2.0
carp-lang/Carp,eriksvedang/Carp,eriksvedang/Carp,carp-lang/Carp,carp-lang/Carp
49115b57cb9d260ddd49a6905ee87af63b3ab066
tools/android/SkBRDAllocator.h
tools/android/SkBRDAllocator.h
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkBitmap.h" #include "SkCodec.h" /** * Abstract subclass of SkBitmap's allocator. * Allows the allocator to indicate if the memory it allocates * is zero initialized. */ class SkBRDAllocator : public SkBitmap::Allocator { public: /** * Indicates if the memory allocated by this allocator is * zero initialized. */ virtual SkCodec::ZeroInitialized zeroInit() const = 0; };
Add an Allocator interface that indicates if memory is zero init
Add an Allocator interface that indicates if memory is zero init This is the first step in a three part change: (1) Skia: Add SkBRDAllocator. (2) Android: Make JavaPixelAllocator and RecyclingClippingPixelAllocator implement SkBRDAllocator. (3) Skia: Change SkBitmapRegionDecoder to use SkBRDAllocator and take advantage of zero allocated memory when possible. BUG=skia: Review URL: https://codereview.chromium.org/1423253004
C
bsd-3-clause
google/skia,rubenvb/skia,google/skia,tmpvar/skia.cc,qrealka/skia-hc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,google/skia,qrealka/skia-hc,rubenvb/skia,aosp-mirror/platform_external_skia,qrealka/skia-hc,qrealka/skia-hc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,qrealka/skia-hc,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,qrealka/skia-hc,tmpvar/skia.cc,rubenvb/skia,rubenvb/skia,google/skia,tmpvar/skia.cc,google/skia,aosp-mirror/platform_external_skia,qrealka/skia-hc,tmpvar/skia.cc,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,tmpvar/skia.cc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,tmpvar/skia.cc,HalCanary/skia-hc,tmpvar/skia.cc,HalCanary/skia-hc,google/skia,tmpvar/skia.cc,tmpvar/skia.cc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,qrealka/skia-hc,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc
1afc2d2704568e5d587eb2ceb18802a4d9bdf7af
core/cortex-m0/config_core.h
core/cortex-m0/config_core.h
/* Copyright 2014 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_CONFIG_CORE_H #define __CROS_EC_CONFIG_CORE_H /* Linker binary architecture and format */ #define BFD_ARCH arm #define BFD_FORMAT "elf32-littlearm" /* Emulate the CLZ/CTZ instructions since the CPU core is lacking support */ #define CONFIG_SOFTWARE_CLZ #define CONFIG_SOFTWARE_CTZ #define CONFIG_SOFTWARE_PANIC #define CONFIG_ASSEMBLY_MULA32 #endif /* __CROS_EC_CONFIG_CORE_H */
/* Copyright 2014 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_CONFIG_CORE_H #define __CROS_EC_CONFIG_CORE_H /* Linker binary architecture and format */ #define BFD_ARCH arm #define BFD_FORMAT "elf32-littlearm" /* * Emulate the CLZ/CTZ instructions since the CPU core is lacking support. * When building with clang, we rely on compiler_rt to provide this support. */ #ifndef __clang__ #define CONFIG_SOFTWARE_CLZ #define CONFIG_SOFTWARE_CTZ #endif /* __clang__ */ #define CONFIG_SOFTWARE_PANIC #define CONFIG_ASSEMBLY_MULA32 #endif /* __CROS_EC_CONFIG_CORE_H */
Use compiler_rt version of clz and ctz
core/cortex-m0: Use compiler_rt version of clz and ctz Use __clzsi2 and __ctzsi2 from compiler_rt instead of our own version. Using the compiler_rt versions result in a slightly smaller image. servo_micro before this change: RO: 18744 bytes in flash remaining RW: 23192 bytes in flash remaining servo_micro after this change: RO: 18808 bytes in flash remaining RW: 23256 bytes in flash remaining BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=servo_micro TEST=make buildall Signed-off-by: Tom Hughes <[email protected]> Change-Id: Ibc19a3670127dde211fb20d247c1284d0aec5f61 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3199739 Reviewed-by: Jack Rosenthal <[email protected]>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
173dee2eb85f7d8ea0ca491f3683382ae8754ca7
include/effects/SkStippleMaskFilter.h
include/effects/SkStippleMaskFilter.h
/* * Copyright 2012 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkStippleMaskFilter_DEFINED #define SkStippleMaskFilter_DEFINED #include "SkMaskFilter.h" /** * Simple MaskFilter that creates a screen door stipple pattern */ class SkStippleMaskFilter : public SkMaskFilter { public: SkStippleMaskFilter() : INHERITED() { } virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix& matrix, SkIPoint* margin) SK_OVERRIDE; // getFormat is from SkMaskFilter virtual SkMask::Format getFormat() SK_OVERRIDE { return SkMask::kA8_Format; } SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkStippleMaskFilter); protected: SkStippleMaskFilter::SkStippleMaskFilter(SkFlattenableReadBuffer& buffer) : SkMaskFilter(buffer) { } private: typedef SkMaskFilter INHERITED; }; #endif // SkStippleMaskFilter_DEFINED
/* * Copyright 2012 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkStippleMaskFilter_DEFINED #define SkStippleMaskFilter_DEFINED #include "SkMaskFilter.h" /** * Simple MaskFilter that creates a screen door stipple pattern */ class SkStippleMaskFilter : public SkMaskFilter { public: SkStippleMaskFilter() : INHERITED() { } virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix& matrix, SkIPoint* margin) SK_OVERRIDE; // getFormat is from SkMaskFilter virtual SkMask::Format getFormat() SK_OVERRIDE { return SkMask::kA8_Format; } SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkStippleMaskFilter); protected: SkStippleMaskFilter(SkFlattenableReadBuffer& buffer) : SkMaskFilter(buffer) { } private: typedef SkMaskFilter INHERITED; }; #endif // SkStippleMaskFilter_DEFINED
Fix for compiler error in r4154
Fix for compiler error in r4154 git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@4155 2bbb7eff-a529-9590-31e7-b0007b416f81
C
bsd-3-clause
mrobinson/skia,mrobinson/skia,metajack/skia,metajack/skia,mrobinson/skia,mrobinson/skia,Cue/skia,Cue/skia,metajack/skia,mrobinson/skia,Cue/skia,metajack/skia,Cue/skia
f0fb14cade4f14185481851a739313bf81d4f8c6
include/samplers/stratified_sampler.h
include/samplers/stratified_sampler.h
#ifndef STRATIFIED_SAMPLER_H #define STRATIFIED_SAMPLER_H #include <random> #include <memory> #include <array> #include <vector> #include "sampler.h" /* * A stratified sampler, generates multipled jittered * samples per pixel in its sample region */ class StratifiedSampler : public Sampler { const int spp; std::mt19937 rng; std::uniform_real_distribution<float> distrib; public: StratifiedSampler(int x_start, int x_end, int y_start, int y_end, int spp); /* * Get some {x, y} positions to sample in the space being sampled * If the sampler has finished sampling samples will be empty */ void get_samples(std::vector<Sample> &samples) override; /* * Get subsamplers that divide the space to be sampled * into count disjoint subsections where each samples a w x h * section of the original sampler */ std::vector<std::unique_ptr<Sampler>> get_subsamplers(int w, int h) const override; private: /* * Generate a 2d pattern of stratified samples and return them * sample positions will be normalized between [0, 1) */ void sample2d(std::vector<Sample> &samples); }; #endif
#ifndef STRATIFIED_SAMPLER_H #define STRATIFIED_SAMPLER_H #include <random> #include <memory> #include <array> #include <vector> #include "sampler.h" /* * A stratified sampler, generates multipled jittered * samples per pixel in its sample region */ class StratifiedSampler : public Sampler { const int spp; std::minstd_rand rng; std::uniform_real_distribution<float> distrib; public: StratifiedSampler(int x_start, int x_end, int y_start, int y_end, int spp); /* * Get some {x, y} positions to sample in the space being sampled * If the sampler has finished sampling samples will be empty */ void get_samples(std::vector<Sample> &samples) override; /* * Get subsamplers that divide the space to be sampled * into count disjoint subsections where each samples a w x h * section of the original sampler */ std::vector<std::unique_ptr<Sampler>> get_subsamplers(int w, int h) const override; private: /* * Generate a 2d pattern of stratified samples and return them * sample positions will be normalized between [0, 1) */ void sample2d(std::vector<Sample> &samples); }; #endif
Fix stratified sampler to use minstd_rand
Fix stratified sampler to use minstd_rand still unsure why mt19937 suddenly started segfaulting
C
mit
Twinklebear/tray,Twinklebear/tray
d536ccd55ebdcded7dddc53f93022b0366d6739c
OrbitGl/ThreadStateTrack.h
OrbitGl/ThreadStateTrack.h
// Copyright (c) 2020 The Orbit 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 ORBIT_GL_THREAD_STATE_TRACK_H_ #define ORBIT_GL_THREAD_STATE_TRACK_H_ #include "Track.h" // This is a track dedicated to displaying thread states in different colors // and with the corresponding tooltips. // It is a thin sub-track of ThreadTrack, added above the callstack track (EventTrack). // The colors are determined only by the states, not by the color assigned to the thread. class ThreadStateTrack final : public Track { public: ThreadStateTrack(TimeGraph* time_graph, int32_t thread_id); Type GetType() const override { return kThreadStateTrack; } void Draw(GlCanvas* canvas, PickingMode picking_mode, float z_offset) override; void UpdatePrimitives(uint64_t min_tick, uint64_t max_tick, PickingMode picking_mode, float z_offset) override; void OnPick(int x, int y) override; void OnRelease() override { picked_ = false; }; float GetHeight() const override { return size_[1]; } bool IsEmpty() const; private: std::string GetThreadStateSliceTooltip(PickingId id) const; }; #endif // ORBIT_GL_THREAD_STATE_TRACK_H_
// Copyright (c) 2020 The Orbit 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 ORBIT_GL_THREAD_STATE_TRACK_H_ #define ORBIT_GL_THREAD_STATE_TRACK_H_ #include "Track.h" // This is a track dedicated to displaying thread states in different colors // and with the corresponding tooltips. // It is a thin sub-track of ThreadTrack, added above the callstack track (EventTrack). // The colors are determined only by the states, not by the color assigned to the thread. class ThreadStateTrack final : public Track { public: ThreadStateTrack(TimeGraph* time_graph, int32_t thread_id); Type GetType() const override { return kThreadStateTrack; } void Draw(GlCanvas* canvas, PickingMode picking_mode, float z_offset) override; void UpdatePrimitives(uint64_t min_tick, uint64_t max_tick, PickingMode picking_mode, float z_offset) override; void OnPick(int x, int y) override; void OnDrag(int, int) override {} void OnRelease() override { picked_ = false; }; float GetHeight() const override { return size_[1]; } bool IsEmpty() const; private: std::string GetThreadStateSliceTooltip(PickingId id) const; }; #endif // ORBIT_GL_THREAD_STATE_TRACK_H_
Fix crash when dragging a thread state track
Fix crash when dragging a thread state track Only when you have enabled track_ordering_feature, this class inherit OnDrag from Track and crashed. Related to b/173093860.
C
bsd-2-clause
google/orbit,google/orbit,google/orbit,google/orbit
27ce98404fc179d292bfc53f1c6b937b5b988461
oak/server/logging_channel.h
oak/server/logging_channel.h
/* * Copyright 2019 The Project Oak Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef OAK_SERVER_LOGGING_CHANNEL_H #define OAK_SERVER_LOGGING_CHANNEL_H #include "oak/server/channel.h" namespace oak { // A channel implementation that only has a send half, which logs to stderr the data written to it. class LoggingChannelHalf final : public ChannelHalf { public: uint32_t Write(absl::Span<const char> data) override { std::string log_message(data.cbegin(), data.cend()); LOG(INFO) << "LOG: " << log_message; }; }; } // namespace oak #endif // OAK_SERVER_LOGGING_CHANNEL_H
/* * Copyright 2019 The Project Oak Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef OAK_SERVER_LOGGING_CHANNEL_H #define OAK_SERVER_LOGGING_CHANNEL_H #include "oak/server/channel.h" namespace oak { // A channel implementation that only has a send half, which logs to stderr the data written to it. class LoggingChannelHalf final : public ChannelHalf { public: uint32_t Write(absl::Span<const char> data) override { std::string log_message(data.cbegin(), data.cend()); LOG(INFO) << "LOG: " << log_message; return data.size(); } }; } // namespace oak #endif // OAK_SERVER_LOGGING_CHANNEL_H
Fix return value for logging channel write
Fix return value for logging channel write
C
apache-2.0
project-oak/oak,project-oak/oak,project-oak/oak,project-oak/oak,project-oak/oak,project-oak/oak,project-oak/oak
7883bff6a155c116fd60000f10a2d4dd4c06b411
src/Pythia/stdafx.h
src/Pythia/stdafx.h
#pragma once #ifdef _WIN32 #include <SDKDDKVer.h> //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include <windows.h> #define tstring std::wstring #define WidenHelper(x) L##x #define LITERAL(x) WidenHelper(x) #else // ifdef _WIN32 #define tstring std::string #define LITERAL(x) (x) #endif /* Don't let Python.h #define (v)snprintf as macro because they are implemented properly in Visual Studio since 2015. */ #if defined(_MSC_VER) && _MSC_VER >= 1900 # define HAVE_SNPRINTF 1 #endif #include <queue> #include <random> #include <string> #include <vector> #include <unordered_set> #include <unordered_map> #include "third_party/spdlog/spdlog.h"
#pragma once #ifdef _WIN32 #include <SDKDDKVer.h> //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include <windows.h> #define tstring std::wstring #define WidenHelper(x) L##x #define LITERAL(x) WidenHelper(x) #else // ifdef _WIN32 #define tstring std::string #define LITERAL(x) (x) // Prevents this error: Failed getting file size from fd: Value too large for defined data type #define _FILE_OFFSET_BITS 64 #endif /* Don't let Python.h #define (v)snprintf as macro because they are implemented properly in Visual Studio since 2015. */ #if defined(_MSC_VER) && _MSC_VER >= 1900 # define HAVE_SNPRINTF 1 #endif #include <queue> #include <random> #include <string> #include <vector> #include <unordered_set> #include <unordered_map> #include "third_party/spdlog/spdlog.h"
Fix the spdlog issue on 32bit systems: Failed getting file size from fd
Fix the spdlog issue on 32bit systems: Failed getting file size from fd
C
mit
overfl0/Pythia,overfl0/Pythia,overfl0/Pythia,overfl0/Pythia
b010d64f92a5b1c17aff474a6a7fcc872cb747d5
test/CFrontend/2005-12-04-AttributeUsed.c
test/CFrontend/2005-12-04-AttributeUsed.c
// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llvm-dis | grep llvm.used | grep foo | grep X int X __attribute__((used)); int Y; void foo() __attribute__((used)); void foo() {}
// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llvm-dis | grep llvm.used | grep foo | grep X int X __attribute__((used)); int Y; __attribute__((used)) void foo() {}
Adjust this to the wonky syntax that GCC expects.
Adjust this to the wonky syntax that GCC expects. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@30670 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm
839be02ee16872973c68acfe3fad9e51c57c8c5e
src/backend/nodes/nodes.c
src/backend/nodes/nodes.c
/*------------------------------------------------------------------------- * * nodes.c * support code for nodes (now that we get rid of the home-brew * inheritance system, our support code for nodes get much simpler) * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $PostgreSQL: pgsql/src/backend/nodes/nodes.c,v 1.22 2003/11/29 19:51:49 pgsql Exp $ * * HISTORY * Andrew Yu Oct 20, 1994 file creation * *------------------------------------------------------------------------- */ #include "postgres.h" #include "nodes/nodes.h" /* * Support for newNode() macro */ Node *newNodeMacroHolder;
/*------------------------------------------------------------------------- * * nodes.c * support code for nodes (now that we have removed the home-brew * inheritance system, our support code for nodes is much simpler) * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $PostgreSQL: pgsql/src/backend/nodes/nodes.c,v 1.23 2004/05/06 06:11:01 neilc Exp $ * * HISTORY * Andrew Yu Oct 20, 1994 file creation * *------------------------------------------------------------------------- */ #include "postgres.h" #include "nodes/nodes.h" /* * Support for newNode() macro */ Node *newNodeMacroHolder;
Fix grammatical error in comment.
Fix grammatical error in comment.
C
apache-2.0
lintzc/gpdb,Quikling/gpdb,ovr/postgres-xl,greenplum-db/gpdb,Postgres-XL/Postgres-XL,edespino/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,cjcjameson/gpdb,Chibin/gpdb,atris/gpdb,tpostgres-projects/tPostgres,postmind-net/postgres-xl,janebeckman/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,randomtask1155/gpdb,Chibin/gpdb,xuegang/gpdb,adam8157/gpdb,xinzweb/gpdb,0x0FFF/gpdb,50wu/gpdb,techdragon/Postgres-XL,rubikloud/gpdb,ahachete/gpdb,xuegang/gpdb,ahachete/gpdb,lintzc/gpdb,Quikling/gpdb,tpostgres-projects/tPostgres,zaksoup/gpdb,foyzur/gpdb,lisakowen/gpdb,lpetrov-pivotal/gpdb,zeroae/postgres-xl,adam8157/gpdb,xuegang/gpdb,ahachete/gpdb,lisakowen/gpdb,zeroae/postgres-xl,lisakowen/gpdb,yuanzhao/gpdb,snaga/postgres-xl,rvs/gpdb,kaknikhil/gpdb,xinzweb/gpdb,ashwinstar/gpdb,zaksoup/gpdb,xuegang/gpdb,arcivanov/postgres-xl,cjcjameson/gpdb,CraigHarris/gpdb,rvs/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,zaksoup/gpdb,cjcjameson/gpdb,jmcatamney/gpdb,atris/gpdb,adam8157/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,yazun/postgres-xl,xuegang/gpdb,chrishajas/gpdb,yuanzhao/gpdb,ahachete/gpdb,adam8157/gpdb,50wu/gpdb,kmjungersen/PostgresXL,Postgres-XL/Postgres-XL,yuanzhao/gpdb,lpetrov-pivotal/gpdb,chrishajas/gpdb,edespino/gpdb,tangp3/gpdb,0x0FFF/gpdb,xuegang/gpdb,pavanvd/postgres-xl,adam8157/gpdb,rubikloud/gpdb,jmcatamney/gpdb,rvs/gpdb,ovr/postgres-xl,foyzur/gpdb,cjcjameson/gpdb,edespino/gpdb,Chibin/gpdb,tangp3/gpdb,rvs/gpdb,royc1/gpdb,Quikling/gpdb,tangp3/gpdb,0x0FFF/gpdb,foyzur/gpdb,cjcjameson/gpdb,kmjungersen/PostgresXL,ahachete/gpdb,tangp3/gpdb,tangp3/gpdb,royc1/gpdb,randomtask1155/gpdb,50wu/gpdb,royc1/gpdb,yazun/postgres-xl,jmcatamney/gpdb,lisakowen/gpdb,0x0FFF/gpdb,0x0FFF/gpdb,zaksoup/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,Quikling/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,50wu/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,zeroae/postgres-xl,randomtask1155/gpdb,rubikloud/gpdb,edespino/gpdb,chrishajas/gpdb,tangp3/gpdb,xuegang/gpdb,0x0FFF/gpdb,Quikling/gpdb,zaksoup/gpdb,oberstet/postgres-xl,Chibin/gpdb,Chibin/gpdb,kaknikhil/gpdb,postmind-net/postgres-xl,royc1/gpdb,cjcjameson/gpdb,Chibin/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,cjcjameson/gpdb,yazun/postgres-xl,50wu/gpdb,CraigHarris/gpdb,Quikling/gpdb,rubikloud/gpdb,pavanvd/postgres-xl,greenplum-db/gpdb,ahachete/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,arcivanov/postgres-xl,atris/gpdb,ovr/postgres-xl,Quikling/gpdb,CraigHarris/gpdb,randomtask1155/gpdb,randomtask1155/gpdb,yuanzhao/gpdb,oberstet/postgres-xl,janebeckman/gpdb,chrishajas/gpdb,Quikling/gpdb,xuegang/gpdb,rubikloud/gpdb,rvs/gpdb,edespino/gpdb,Quikling/gpdb,royc1/gpdb,50wu/gpdb,chrishajas/gpdb,janebeckman/gpdb,randomtask1155/gpdb,foyzur/gpdb,ashwinstar/gpdb,adam8157/gpdb,kaknikhil/gpdb,zeroae/postgres-xl,Chibin/gpdb,lintzc/gpdb,Postgres-XL/Postgres-XL,snaga/postgres-xl,snaga/postgres-xl,lisakowen/gpdb,edespino/gpdb,Chibin/gpdb,tpostgres-projects/tPostgres,randomtask1155/gpdb,50wu/gpdb,jmcatamney/gpdb,yazun/postgres-xl,lpetrov-pivotal/gpdb,atris/gpdb,xuegang/gpdb,lpetrov-pivotal/gpdb,postmind-net/postgres-xl,ashwinstar/gpdb,janebeckman/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,Chibin/gpdb,janebeckman/gpdb,rvs/gpdb,chrishajas/gpdb,Chibin/gpdb,greenplum-db/gpdb,ahachete/gpdb,ashwinstar/gpdb,rvs/gpdb,kaknikhil/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,lintzc/gpdb,edespino/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,pavanvd/postgres-xl,ahachete/gpdb,rubikloud/gpdb,rvs/gpdb,lintzc/gpdb,lisakowen/gpdb,Quikling/gpdb,jmcatamney/gpdb,rvs/gpdb,adam8157/gpdb,zaksoup/gpdb,foyzur/gpdb,zeroae/postgres-xl,janebeckman/gpdb,tangp3/gpdb,lintzc/gpdb,CraigHarris/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,foyzur/gpdb,ashwinstar/gpdb,janebeckman/gpdb,janebeckman/gpdb,royc1/gpdb,rubikloud/gpdb,edespino/gpdb,Postgres-XL/Postgres-XL,royc1/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,xinzweb/gpdb,rvs/gpdb,lintzc/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,kaknikhil/gpdb,atris/gpdb,postmind-net/postgres-xl,kmjungersen/PostgresXL,edespino/gpdb,CraigHarris/gpdb,kmjungersen/PostgresXL,xinzweb/gpdb,yuanzhao/gpdb,techdragon/Postgres-XL,zaksoup/gpdb,randomtask1155/gpdb,royc1/gpdb,CraigHarris/gpdb,tpostgres-projects/tPostgres,adam8157/gpdb,chrishajas/gpdb,chrishajas/gpdb,tangp3/gpdb,lisakowen/gpdb,greenplum-db/gpdb,50wu/gpdb,yazun/postgres-xl,arcivanov/postgres-xl,ashwinstar/gpdb,yuanzhao/gpdb,foyzur/gpdb,ashwinstar/gpdb,lintzc/gpdb,yuanzhao/gpdb,edespino/gpdb,oberstet/postgres-xl,rubikloud/gpdb,atris/gpdb,ovr/postgres-xl,postmind-net/postgres-xl,atris/gpdb,foyzur/gpdb,xinzweb/gpdb,lpetrov-pivotal/gpdb,xinzweb/gpdb,xinzweb/gpdb,oberstet/postgres-xl,techdragon/Postgres-XL,lpetrov-pivotal/gpdb,yuanzhao/gpdb,0x0FFF/gpdb,0x0FFF/gpdb,janebeckman/gpdb,tpostgres-projects/tPostgres,pavanvd/postgres-xl,snaga/postgres-xl
9be737da6e5afe90306f7e66d72024b7507323dc
src/arch/relic_arch_avr.c
src/arch/relic_arch_avr.c
/* * RELIC is an Efficient LIbrary for Cryptography * Copyright (C) 2007-2011 RELIC Authors * * This file is part of RELIC. RELIC is legal property of its developers, * whose names are not listed here. Please refer to the COPYRIGHT file * for contact information. * * RELIC 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. * * RELIC 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 RELIC. If not, see <http://www.gnu.org/licenses/>. */ /** * @file * * Implementation of AVR-dependent routines. * * @version $Id$ * @ingroup arch */ /*============================================================================*/ /* Public definitions */ /*============================================================================*/ void arch_init(void) { } void arch_clean(void) { }
Add missing file for ARCH = AVR.
Add missing file for ARCH = AVR.
C
lgpl-2.1
ukscone/relic,sruesch/relic,tfar/relic,OlegHahm/relic,ukscone/relic,ace0/relic,ukscone/relic,OlegHahm/relic,ace0/relic,sruesch/relic,ace0/relic,tfar/relic,ace0/relic,OlegHahm/relic,tfar/relic,sruesch/relic
76665d06735e1b15af877bcaceae645d77488b55
Source/Library/Object/HCThrowsException.h
Source/Library/Object/HCThrowsException.h
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/ // Copyright 2015 hamcrest.org. See LICENSE.txt #import <OCHamcrest/HCDiagnosingMatcher.h> /*! * @abstract Does executing a block throw an exception which satisfies a nested matcher? */ @interface HCThrowsException : HCDiagnosingMatcher - (id)initWithExceptionMatcher:(id)exceptionMatcher; @end FOUNDATION_EXPORT id HC_throwsException(id exceptionMatcher); #ifndef HC_DISABLE_SHORT_SYNTAX /*! * @abstract Creates a matcher that matches when the examined object is a block which, when * executed, throws an exception satisfying the specified matcher. * @param exceptionMatcher The matcher to satisfy when passed the exception. * @discussion * <b>Example</b><br /> * <pre>assertThat(^{ [obj somethingBad]; }, throwsException(anything())</pre> * * <b>Name Clash</b><br /> * In the event of a name clash, <code>#define HC_DISABLE_SHORT_SYNTAX</code> and use the synonym * HC_throwsException instead. */ static inline id throwsException(id exceptionMatcher) { return HC_throwsException(exceptionMatcher); } #endif
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/ // Copyright 2015 hamcrest.org. See LICENSE.txt #import <OCHamcrest/HCDiagnosingMatcher.h> /*! * @abstract Does executing a block throw an exception which satisfies a nested matcher? */ @interface HCThrowsException : HCDiagnosingMatcher - (id)initWithExceptionMatcher:(id)exceptionMatcher; @end FOUNDATION_EXPORT id HC_throwsException(id exceptionMatcher); #ifndef HC_DISABLE_SHORT_SYNTAX /*! * @abstract Creates a matcher that matches when the examined object is a block which, when * executed, throws an exception satisfying the specified matcher. * @param exceptionMatcher The matcher to satisfy when passed the exception. * @discussion * <b>Example</b><br /> * <pre>assertThat(^{ [obj somethingBad]; }, throwsException(hasProperty(@"reason", @"EXPECTED REASON")))</pre> * * <b>Name Clash</b><br /> * In the event of a name clash, <code>#define HC_DISABLE_SHORT_SYNTAX</code> and use the synonym * HC_throwsException instead. */ static inline id throwsException(id exceptionMatcher) { return HC_throwsException(exceptionMatcher); } #endif
Improve throwsException example to use hasProperty
Improve throwsException example to use hasProperty
C
bsd-2-clause
hamcrest/OCHamcrest,hamcrest/OCHamcrest,hamcrest/OCHamcrest
2658baee614225bb6cc32a89843cbf455c1a5799
libyaul/common/internal_exception_show.c
libyaul/common/internal_exception_show.c
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <[email protected]> */ #include <stdlib.h> #include <vdp1.h> #include <vdp2.h> #include <vdp2/tvmd.h> #include <vdp2/vram.h> #include <cons.h> void __noreturn internal_exception_show(const char *buffer) { /* Reset the VDP1 */ vdp1_init(); /* Reset the VDP2 */ vdp2_init(); vdp2_tvmd_display_res_set(TVMD_INTERLACE_NONE, TVMD_HORZ_NORMAL_A, TVMD_VERT_224); vdp2_scrn_back_screen_color_set(VRAM_ADDR_4MBIT(0, 0x01FFFE), COLOR_RGB555(0, 7, 0)); vdp2_tvmd_display_set(); cons_init(CONS_DRIVER_VDP2, 40, 28); cons_buffer(buffer); vdp2_tvmd_vblank_out_wait(); vdp2_tvmd_vblank_in_wait(); vdp2_commit(); cons_flush(); abort(); }
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <[email protected]> */ #include <stdlib.h> #include <vdp1.h> #include <vdp2.h> #include <vdp2/tvmd.h> #include <vdp2/vram.h> #include <cons.h> void __noreturn internal_exception_show(const char *buffer) { /* Reset the VDP1 */ vdp1_init(); /* Reset the VDP2 */ vdp2_init(); vdp2_tvmd_display_res_set(TVMD_INTERLACE_NONE, TVMD_HORZ_NORMAL_A, TVMD_VERT_224); vdp2_scrn_back_screen_color_set(VRAM_ADDR_4MBIT(0, 0x01FFFE), COLOR_RGB555(0, 7, 0)); /* Set sprite to type 0 and set its priority to 0 (invisible) */ vdp2_sprite_type_set(0); vdp2_sprite_priority_set(0, 0); vdp2_tvmd_display_set(); cons_init(CONS_DRIVER_VDP2, 40, 28); cons_buffer(buffer); vdp2_tvmd_vblank_out_wait(); vdp2_tvmd_vblank_in_wait(); vdp2_commit(); cons_flush(); abort(); }
Hide VDP1 even if FB hasn't been erased and changed
Hide VDP1 even if FB hasn't been erased and changed
C
mit
ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul
ccf5eaf49f000109d2d479156913154fd68c37b2
polygon.h
polygon.h
/** Author : Paul TREHIOU & Victor SENE * Date : November 2014 **/ /** * Declaration Point structure * x - real wich is the abscisse of the point * y - real wich is the ordinate of the point */ typedef struct { float x; float y; }Point; /** * Function wich create a point with a specified abscisse and ordinate * abscisse - real * ordinate - real * return a new point */ createPoint(float abscisse, float ordinate); typedef struct pointelem{ Point value; pointelem* next; pointelem* before; }PointElement; typedef PointElement* Polygon;
/** Author : Paul TREHIOU & Victor SENE * Date : November 2014 **/ /** * Declaration Point structure * x - real wich is the abscisse of the point * y - real wich is the ordinate of the point */ typedef struct { float x; float y; }Point; /** * Function wich create a point with a specified abscisse and ordinate * abscisse - real * ordinate - real * return a new point */ createPoint(float abscisse, float ordinate); typedef struct pointelem{ Point value; pointelem* next; pointelem* before; }PointElement; typedef PointElement* Polygon;
Add some spaces and enters
Add some spaces and enters
C
mit
UTBroM/GeometricLib
cdcea87381a6ff1711d039dec46ec01a919acb8e
test/CodeGen/union-init2.c
test/CodeGen/union-init2.c
// RUN: clang-cc -emit-llvm %s -o - | not grep ptrtoint // Make sure we generate something sane instead of a ptrtoint union x {long long b;union x* a;} r = {.a = &r};
// RUN: clang-cc -emit-llvm %s -o - -triple i686-pc-linux-gnu | grep "bitcast (%0\* @r to %union.x\*), \[4 x i8\] zeroinitializer" // Make sure we generate something sane instead of a ptrtoint union x {long long b;union x* a;} r = {.a = &r};
Make test a bit more precise.
Make test a bit more precise. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@79073 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
b2187a9f743a7821ce764989f938916fe74ead06
Binart_Search_Tree_BST/BST_min_max.c
Binart_Search_Tree_BST/BST_min_max.c
#include <stdio.h> #include <stdlib.h> /* This is a code for binary search tree basic implementtion */ //Contains code for PreOrder, InOrder and PostOrder Traversals i.e. Depth First typedef struct node{ int data; struct node* left; struct node* right; } node; node* head; node* create(int data){ node* temp = (node* ) malloc(sizeof(node)); temp->data = data; temp->left = NULL; temp->right = NULL; return temp; } node* insert(node* current, int data){ if(head == NULL){ node* temp; temp = create(data); head = temp; return temp; } else{ if(current == NULL){ node* temp; temp = create(data); return temp; } if(data <= current->data){ current->left = insert(current->left,data); } else if ( data > current->data){ current->right = insert(current->right,data); } } return current; } void print_preorder_all(node* temp){ if(temp != NULL){ printf("data %d ",temp->data); if(temp->left != NULL){ printf("left child %d ",temp->left->data);} else { printf("left child NULL "); } if(temp->right != NULL){ printf("right child %d \n",temp->right->data);} else { printf("right child NULL \n"); } print_preorder_all(temp->left); print_preorder_all(temp->right); } return; } /* Size of tree i.e. number of nodes */ int min_tree(node* root){ node* temp; temp =root; if(temp == NULL ){ return 0; } else{ while (temp->left!=NULL){ temp = temp->left; } return temp->data; } } int max_tree(node* root){ node* temp; temp =root; if(temp == NULL ){ return 0; } else{ while (temp->right!=NULL){ temp = temp->right; } return temp->data; } } int main(){ head = NULL; node* temp; int A[7] = {9,4,15,2,6,12,17}; int i; for(i =0 ; i<7 ; i ++){ temp = insert(head,A[i]); } printf("all info\n"); print_preorder_all(head); printf("\n"); printf("The min of tree is %d \n",min_tree(head)); printf("The max of tree is %d \n",max_tree(head)); return 0; }
Add BST find min and max value node
Add BST find min and max value node
C
mit
anaghajoshi/C_DataStructures_Algorithms
9d58853f5797b062e68509c2afcfe5375309d145
Classes/GTDiffFile.h
Classes/GTDiffFile.h
// // GTDiffFile.h // ObjectiveGitFramework // // Created by Danny Greg on 30/11/2012. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import "git2.h" // Flags which may be set on the file. // // See diff.h for individual documentation. typedef enum : git_diff_file_flag_t { GTDiffFileFlagValidOID = GIT_DIFF_FILE_VALID_OID, GTDiffFileFlagFreePath = GIT_DIFF_FILE_FREE_PATH, GTDiffFileFlagBinary = GIT_DIFF_FILE_BINARY, GTDiffFileFlagNotBinary = GIT_DIFF_FILE_NOT_BINARY, GTDiffFileFlagFreeData = GIT_DIFF_FILE_FREE_DATA, GTDiffFileFlagUnmapData = GIT_DIFF_FILE_UNMAP_DATA, GTDiffFileFlagNoData = GIT_DIFF_FILE_NO_DATA, } GTDiffFileFlag; // A class representing a file on one side of a diff. @interface GTDiffFile : NSObject // The location within the working directory of the file. @property (nonatomic, readonly, copy) NSString *path; // The size (in bytes) of the file. @property (nonatomic, readonly) NSUInteger size; // Any flags set on the file (see `GTDiffFileFlag` for more info). @property (nonatomic, readonly) GTDiffFileFlag flags; // The mode of the file. @property (nonatomic, readonly) mode_t mode; // Designated initialiser. - (instancetype)initWithGitDiffFile:(git_diff_file)file; @end
// // GTDiffFile.h // ObjectiveGitFramework // // Created by Danny Greg on 30/11/2012. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import "git2.h" // Flags which may be set on the file. // // See diff.h for individual documentation. typedef enum : git_diff_flag_t { GTDiffFileFlagValidOID = GIT_DIFF_FLAG_VALID_OID, GTDiffFileFlagBinary = GIT_DIFF_FLAG_BINARY, GTDiffFileFlagNotBinary = GIT_DIFF_FLAG_NOT_BINARY, } GTDiffFileFlag; // A class representing a file on one side of a diff. @interface GTDiffFile : NSObject // The location within the working directory of the file. @property (nonatomic, readonly, copy) NSString *path; // The size (in bytes) of the file. @property (nonatomic, readonly) NSUInteger size; // Any flags set on the file (see `GTDiffFileFlag` for more info). @property (nonatomic, readonly) GTDiffFileFlag flags; // The mode of the file. @property (nonatomic, readonly) mode_t mode; // Designated initialiser. - (instancetype)initWithGitDiffFile:(git_diff_file)file; @end
Remove some diff file flags
Remove some diff file flags
C
mit
libgit2/objective-git,TOMalley104/objective-git,alehed/objective-git,pietbrauer/objective-git,nerdishbynature/objective-git,c9s/objective-git,misterfifths/objective-git,dleehr/objective-git,Acidburn0zzz/objective-git,phatblat/objective-git,dleehr/objective-git,blackpixel/objective-git,slavikus/objective-git,slavikus/objective-git,nerdishbynature/objective-git,dleehr/objective-git,pietbrauer/objective-git,libgit2/objective-git,misterfifths/objective-git,0x4a616e/objective-git,blackpixel/objective-git,c9s/objective-git,javiertoledo/objective-git,pietbrauer/objective-git,libgit2/objective-git,tiennou/objective-git,libgit2/objective-git,phatblat/objective-git,alehed/objective-git,tiennou/objective-git,TOMalley104/objective-git,phatblat/objective-git,0x4a616e/objective-git,blackpixel/objective-git,javiertoledo/objective-git,blackpixel/objective-git,alehed/objective-git,misterfifths/objective-git,misterfifths/objective-git,javiertoledo/objective-git,nerdishbynature/objective-git,c9s/objective-git,javiertoledo/objective-git,TOMalley104/objective-git,TOMalley104/objective-git,pietbrauer/objective-git,0x4a616e/objective-git,Acidburn0zzz/objective-git,c9s/objective-git,Acidburn0zzz/objective-git,tiennou/objective-git,slavikus/objective-git,dleehr/objective-git,Acidburn0zzz/objective-git
7aefbf7e8a5917cf482a097a1670153c7a4c893b
event/event_system.h
event/event_system.h
#ifndef EVENT_SYSTEM_H #define EVENT_SYSTEM_H #include <event/event_thread.h> /* * XXX * This is kind of an awful shim while we move * towards something thread-oriented. */ class EventSystem { EventThread td_; private: EventSystem(void) : td_() { } ~EventSystem() { } public: Action *poll(const EventPoll::Type& type, int fd, EventCallback *cb) { return (td_.poll(type, fd, cb)); } Action *register_interest(const EventInterest& interest, Callback *cb) { return (td_.register_interest(interest, cb)); } Action *schedule(Callback *cb) { return (td_.schedule(cb)); } Action *timeout(unsigned ms, Callback *cb) { return (td_.timeout(ms, cb)); } void start(void) { td_.start(); td_.join(); } static EventSystem *instance(void) { static EventSystem *instance; if (instance == NULL) instance = new EventSystem(); return (instance); } }; #endif /* !EVENT_SYSTEM_H */
Add EventSystem shim missed in r588.
Add EventSystem shim missed in r588.
C
bsd-2-clause
wanproxy/wanproxy,wanproxy/wanproxy,wanproxy/wanproxy
d6ab18fa7eb560259922cdaaafc0804d6e42a05e
benchmarks/move_only.h
benchmarks/move_only.h
/* * The MIT License (MIT) * * Copyright (c) 2015 Morwenn * * 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. */ #include <stdexcept> #include <utility> //////////////////////////////////////////////////////////// // Move-only type for benchmarks // // std::sort and std::stable_sort are supposed to be able to // sort collections of types that are move-only and that are // not default-constructible. The class template move_only // wraps such a type and can be fed to algorithms to check // whether they still compile. // // Additionally, move_only detects attempts to read the value // after a move has been performed and throws an exceptions // when it happens. // template<typename T> struct move_only { // Not default-constructible move_only() = delete; // Move-only move_only(const move_only&) = delete; move_only& operator=(const move_only&) = delete; // Can be constructed from a T for convenience move_only(const T& value): can_read(true), value(value) {} // Move operators move_only(move_only&& other): can_read(true), value(std::move(other.value)) { if (not std::exchange(other.can_read, false)) { throw std::logic_error("illegal read from a moved-from value"); } } auto operator=(move_only&& other) -> move_only& { if (&other != this) { if (not std::exchange(other.can_read, false)) { throw std::logic_error("illegal read from a moved-from value"); } can_read = true; value = std::move(other.value); } return *this; } // Whether the value can be read bool can_read = false; // Actual value T value; }; template<typename T> auto operator<(const move_only<T>& lhs, const move_only<T>& rhs) -> bool { return lhs.value < rhs.value; }
Add move-only type for testing/benchmarking.
Add move-only type for testing/benchmarking.
C
mit
Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort
9bb74efd41b19d80944a9769378421a148434283
sdch_request_context.h
sdch_request_context.h
// Copyright (c) 2015 Yandex LLC. All rights reserved. // Author: Vasily Chekalkin <[email protected]> #ifndef SDCH_REQUEST_CONTEXT_H_ #define SDCH_REQUEST_CONTEXT_H_ extern "C" { #include <ngx_config.h> #include <nginx.h> #include <ngx_core.h> #include <ngx_http.h> } namespace sdch { class Handler; // Context used inside nginx to keep relevant data. struct RequestContext { ngx_http_request_t *request; ngx_chain_t *in; ngx_chain_t *free; ngx_chain_t *busy; ngx_chain_t *out; ngx_chain_t **last_out; ngx_chain_t *copied; ngx_chain_t *copy_buf; ngx_buf_t *in_buf; ngx_buf_t *out_buf; ngx_int_t bufs; struct sdch_dict *dict; struct sdch_dict fdict; unsigned started:1; unsigned flush:4; unsigned redo:1; unsigned done:1; unsigned nomem:1; unsigned buffering:1; unsigned store:1; size_t zin; size_t zout; z_stream zstream; struct sv *stuc; }; private: }; } // namespace sdch #endif // SDCH_REQUEST_CONTEXT_H_
Add copy-pasted stub for future RequestContext
Add copy-pasted stub for future RequestContext
C
mit
yandex/sdch_module,yandex/sdch_module,yandex/sdch_module,yandex/sdch_module
07630a37beefe8e4401c602f04e3e5bcbba50b31
include/asm-powerpc/code-patching.h
include/asm-powerpc/code-patching.h
#ifndef _ASM_POWERPC_CODE_PATCHING_H #define _ASM_POWERPC_CODE_PATCHING_H /* * Copyright 2008, Michael Ellerman, IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ /* Flags for create_branch: * "b" == create_branch(addr, target, 0); * "ba" == create_branch(addr, target, BRANCH_ABSOLUTE); * "bl" == create_branch(addr, target, BRANCH_SET_LINK); * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK); */ #define BRANCH_SET_LINK 0x1 #define BRANCH_ABSOLUTE 0x2 unsigned int create_branch(const unsigned int *addr, unsigned long target, int flags); void patch_branch(unsigned int *addr, unsigned long target, int flags); void patch_instruction(unsigned int *addr, unsigned int instr); #endif /* _ASM_POWERPC_CODE_PATCHING_H */
#ifndef _ASM_POWERPC_CODE_PATCHING_H #define _ASM_POWERPC_CODE_PATCHING_H /* * Copyright 2008, Michael Ellerman, IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <asm/types.h> /* Flags for create_branch: * "b" == create_branch(addr, target, 0); * "ba" == create_branch(addr, target, BRANCH_ABSOLUTE); * "bl" == create_branch(addr, target, BRANCH_SET_LINK); * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK); */ #define BRANCH_SET_LINK 0x1 #define BRANCH_ABSOLUTE 0x2 unsigned int create_branch(const unsigned int *addr, unsigned long target, int flags); void patch_branch(unsigned int *addr, unsigned long target, int flags); void patch_instruction(unsigned int *addr, unsigned int instr); static inline unsigned long ppc_function_entry(void *func) { #ifdef CONFIG_PPC64 /* * On PPC64 the function pointer actually points to the function's * descriptor. The first entry in the descriptor is the address * of the function text. */ return ((func_descr_t *)func)->entry; #else return (unsigned long)func; #endif } #endif /* _ASM_POWERPC_CODE_PATCHING_H */
Add ppc_function_entry() which gets the entry point for a function
powerpc: Add ppc_function_entry() which gets the entry point for a function Because function pointers point to different things on 32-bit vs 64-bit, add a macro that deals with dereferencing the OPD on 64-bit. The soon to be merged ftrace wants this, as well as other code I am working on. Signed-off-by: Michael Ellerman <[email protected]> Acked-by: Kumar Gala <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
e3eaf3ba1da697344a1323715a0cd53c5163ba5f
include/exceptions/file_not_found.h
include/exceptions/file_not_found.h
#pragma once #include <stdexcept> namespace erebus { /** * This is a exception for the case a stated file doenst exist. */ class file_not_found : public std::runtime_error { public: /** * Constructor. */ explicit file_not_found(const std::string& msg) : std::runtime_error(msg) { } }; }
Add file not found exception
Add file not found exception
C
apache-2.0
GuardianRG/erebus,GuardianRG/erebus
05039aede1e3a411978e89c4683caa9909f23c55
libftl/posix/socket.c
libftl/posix/socket.c
/** * \file socket.c - Windows Socket Abstractions * * Copyright (c) 2015 Michael Casadevall * * 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 __FTL_INTERNAL #include "ftl.h" #include <unistd.h> void ftl_init_sockets() { //BSD sockets are smarter and don't need silly init } int ftl_close_socket(int sock) { return close(sock); } char * ftl_get_socket_error() { return strerror(errno); }
Add POSIX files, yay. Almost fixes compile
Add POSIX files, yay. Almost fixes compile
C
mit
WatchBeam/ftl-sdk,WatchBeam/ftl-sdk
b2a3bd280e31b194b9cff3e44915f6344e959bef
moses/TranslationModel/UG/generic/threading/ug_ref_counter.h
moses/TranslationModel/UG/generic/threading/ug_ref_counter.h
#include "ug_thread_safe_counter.h" #pragma once // obsolete once intrusive_ref_counter is available everywhere namespace Moses { class reference_counter { public: friend void intrusive_ptr_add_ref(reference_counter* p) { if (p) ++p->m_refcount; } friend void intrusive_ptr_release(reference_counter* p) { if (p && --p->m_refcount == 0) delete p; } protected: reference_counter() {} virtual ~reference_counter() {}; private: mutable ThreadSafeCounter m_refcount; }; }
#include "ug_thread_safe_counter.h" #pragma once // obsolete once intrusive_ref_counter is available everywhere namespace Moses { class reference_counter { public: friend void intrusive_ptr_add_ref(reference_counter const* p) { if (p) ++p->m_refcount; } friend void intrusive_ptr_release(reference_counter const* p) { if (p && --p->m_refcount == 0) delete p; } protected: reference_counter() {} virtual ~reference_counter() {}; private: mutable ThreadSafeCounter m_refcount; }; }
Allow intrusive pointers to const objects.
Allow intrusive pointers to const objects.
C
lgpl-2.1
pjwilliams/mosesdecoder,KonceptGeek/mosesdecoder,tofula/mosesdecoder,pjwilliams/mosesdecoder,pjwilliams/mosesdecoder,KonceptGeek/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,alvations/mosesdecoder,KonceptGeek/mosesdecoder,moses-smt/mosesdecoder,pjwilliams/mosesdecoder,alvations/mosesdecoder,hychyc07/mosesdecoder,emjotde/mosesdecoder_nmt,emjotde/mosesdecoder_nmt,tofula/mosesdecoder,hychyc07/mosesdecoder,emjotde/mosesdecoder_nmt,tofula/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,tofula/mosesdecoder,KonceptGeek/mosesdecoder,hychyc07/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,alvations/mosesdecoder,emjotde/mosesdecoder_nmt,emjotde/mosesdecoder_nmt,hychyc07/mosesdecoder,alvations/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,KonceptGeek/mosesdecoder,tofula/mosesdecoder,emjotde/mosesdecoder_nmt,moses-smt/mosesdecoder,alvations/mosesdecoder,alvations/mosesdecoder,tofula/mosesdecoder,alvations/mosesdecoder,pjwilliams/mosesdecoder,alvations/mosesdecoder,hychyc07/mosesdecoder,moses-smt/mosesdecoder,KonceptGeek/mosesdecoder,moses-smt/mosesdecoder,KonceptGeek/mosesdecoder,moses-smt/mosesdecoder,emjotde/mosesdecoder_nmt,moses-smt/mosesdecoder,pjwilliams/mosesdecoder,emjotde/mosesdecoder_nmt,emjotde/mosesdecoder_nmt,KonceptGeek/mosesdecoder,emjotde/mosesdecoder_nmt,alvations/mosesdecoder,hychyc07/mosesdecoder,pjwilliams/mosesdecoder,pjwilliams/mosesdecoder,pjwilliams/mosesdecoder,hychyc07/mosesdecoder,moses-smt/mosesdecoder,alvations/mosesdecoder,hychyc07/mosesdecoder,tofula/mosesdecoder,pjwilliams/mosesdecoder,alvations/mosesdecoder,KonceptGeek/mosesdecoder,hychyc07/mosesdecoder,hychyc07/mosesdecoder,KonceptGeek/mosesdecoder
dbb8a82f627267067dee720b38bdc77a7c83bcc1
src/tests/log_mock.c
src/tests/log_mock.c
#include "log.h" #include <stdio.h> #include <stdarg.h> void debug(const char* format, ...) { #ifdef __DEBUG__ va_list args; va_start(args, format); vprintf(format, args); va_end(args); #endif // __DEBUG__ } void initializeLogging() { }
#include "log.h" #include <stdio.h> #include <stdarg.h> void debugNoNewline(const char* format, ...) { #ifdef __DEBUG__ va_list args; va_start(args, format); vprintf(format, args); va_end(args); #endif // __DEBUG__ } void initializeLogging() { }
Rename test suite version of debug to match the header.
Rename test suite version of debug to match the header.
C
bsd-3-clause
mgiannikouris/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware
7a02c1174d819be374c24fd8b406ff3d66c9bbab
src/util.h
src/util.h
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ALLOC_N(type, 1) #define ALLOC_N(type, n) ((type*) xmalloc(sizeof(type) * (n))) void *xmalloc(size_t); char *hextoa(const char *, int); #define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0) #endif /* UTIL_H */
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ALLOC_N(type, 1) #define ALLOC_N(type, n) ((type*) xmalloc(sizeof(type) * (n))) #define MEMCPY(dst, src, type) MEMCPY_N(dst, src, type, 1) #define MEMCPY_N(dst, src, type, n) (memcpy((dst), (src), sizeof(type) * (n))) void *xmalloc(size_t); char *hextoa(const char *, int); #define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0) #endif /* UTIL_H */
Add MEMCPY and MEMCPY_N macros
Add MEMCPY and MEMCPY_N macros
C
apache-2.0
mopidy/libmockspotify,mopidy/libmockspotify,mopidy/libmockspotify
cb694769f0d0c1f6fb8c9dc806c0a68da1056055
arch/powerpc/include/asm/sparsemem.h
arch/powerpc/include/asm/sparsemem.h
#ifndef _ASM_POWERPC_SPARSEMEM_H #define _ASM_POWERPC_SPARSEMEM_H 1 #ifdef __KERNEL__ #ifdef CONFIG_SPARSEMEM /* * SECTION_SIZE_BITS 2^N: how big each section will be * MAX_PHYSADDR_BITS 2^N: how much physical address space we have * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space */ #define SECTION_SIZE_BITS 28 #define MAX_PHYSADDR_BITS 44 #define MAX_PHYSMEM_BITS 44 #endif /* CONFIG_SPARSEMEM */ #ifdef CONFIG_MEMORY_HOTPLUG extern void create_section_mapping(unsigned long start, unsigned long end); extern int remove_section_mapping(unsigned long start, unsigned long end); #ifdef CONFIG_NUMA extern int hot_add_scn_to_nid(unsigned long scn_addr); #else static inline int hot_add_scn_to_nid(unsigned long scn_addr) { return 0; } #endif /* CONFIG_NUMA */ #endif /* CONFIG_MEMORY_HOTPLUG */ #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_SPARSEMEM_H */
#ifndef _ASM_POWERPC_SPARSEMEM_H #define _ASM_POWERPC_SPARSEMEM_H 1 #ifdef __KERNEL__ #ifdef CONFIG_SPARSEMEM /* * SECTION_SIZE_BITS 2^N: how big each section will be * MAX_PHYSADDR_BITS 2^N: how much physical address space we have * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space */ #define SECTION_SIZE_BITS 24 #define MAX_PHYSADDR_BITS 44 #define MAX_PHYSMEM_BITS 44 #endif /* CONFIG_SPARSEMEM */ #ifdef CONFIG_MEMORY_HOTPLUG extern void create_section_mapping(unsigned long start, unsigned long end); extern int remove_section_mapping(unsigned long start, unsigned long end); #ifdef CONFIG_NUMA extern int hot_add_scn_to_nid(unsigned long scn_addr); #else static inline int hot_add_scn_to_nid(unsigned long scn_addr) { return 0; } #endif /* CONFIG_NUMA */ #endif /* CONFIG_MEMORY_HOTPLUG */ #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_SPARSEMEM_H */
Revert "powerpc/mm: Bump SECTION_SIZE_BITS from 16MB to 256MB"
Revert "powerpc/mm: Bump SECTION_SIZE_BITS from 16MB to 256MB" This reverts commit 7545ba6f82924d4523f8f8a2baf2e517a750265d. It breaks eHEA among other issues
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
b59b6012f5562764a817aeb0670bbeda196adb84
c_src/erl_nif_compat.h
c_src/erl_nif_compat.h
#ifndef ERL_NIF_COMPAT_H_ #define ERL_NIF_COMPAT_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "erl_nif.h" #if ERL_NIF_MAJOR_VERSION == 1 && ERL_NIF_MINOR_VERSION == 0 #define enif_open_resource_type_compat enif_open_resource_type #define enif_alloc_resource_compat enif_alloc_resource #define enif_release_resource_compat enif_release_resource #define enif_alloc_binary_compat enif_alloc_binary #define enif_realloc_binary_compat enif_realloc_binary #define enif_release_binary_compat enif_release_binary #define enif_alloc_compat enif_alloc #define enif_free_compat enif_free #define enif_get_atom_compat(E, T, B, S, C) \ enif_get_atom(E, T, B, S) #endif /* R13B04 */ #if ERL_NIF_MAJOR_VERSION == 2 && ERL_NIF_MINOR_VERSION == 0 #define enif_open_resource_type_compat(E, N, D, F, T) \ enif_open_resource_type(E, NULL, N, D, F, T) #define enif_alloc_resource_compat(E, T, S) \ enif_alloc_resource(T, S) #define enif_release_resource_compat(E, H) \ enif_release_resource(H) #define enif_alloc_binary_compat(E, S, B) \ enif_alloc_binary(S, B) #define enif_realloc_binary_compat(E, B, S) \ enif_realloc_binary(B, S) #define enif_release_binary_compat(E, B) \ enif_release_binary(B) #define enif_alloc_compat(E, S) \ enif_alloc(S) #define enif_free_compat(E, P) \ enif_free(P) #define enif_get_atom_compat enif_get_atom #endif /* R14 */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* ERL_NIF_COMPAT_H_ */
Add compatibility header and use compatibility macros to enable builds on both R13 and R14.
Add compatibility header and use compatibility macros to enable builds on both R13 and R14.
C
apache-2.0
beerriot/icu4e
933211fa8d30fba9c689b28f30e0aa353341c345
include/Information/GameModeWidget.h
include/Information/GameModeWidget.h
#ifndef GAMEMODEWIDGET_H #define GAMEMODEWIDGET_H #include <QtWidgets> #include "PlayerActivatedWidget.h" #include "PlayerControlModeWidget.h" #include "Game\Player.h" #include "Game\State.h" class GameModeWidget : public QWidget { public: GameModeWidget(QWidget * parent = 0); ~GameModeWidget(); Player currentPlayer()const; State currentMode()const; protected: private: PlayerActivatedWidget * m_player1Indicator, *m_player2Indicator; PlayerControlModeWidget * m_playerControlAngle, * m_playerControlPower, * m_playerControlFire; public slots: void setCurrentMode(State gameMode); void setCurrentPlayer(Player player); }; #endif
#ifndef GAMEMODEWIDGET_H #define GAMEMODEWIDGET_H #include <QtWidgets> #include "PlayerActivatedWidget.h" #include "PlayerControlModeWidget.h" #include "Game/Player.h" #include "Game/State.h" class GameModeWidget : public QWidget { public: GameModeWidget(QWidget * parent = 0); ~GameModeWidget(); Player currentPlayer()const; State currentMode()const; protected: private: PlayerActivatedWidget * m_player1Indicator, *m_player2Indicator; PlayerControlModeWidget * m_playerControlAngle, * m_playerControlPower, * m_playerControlFire; public slots: void setCurrentMode(State gameMode); void setCurrentPlayer(Player player); }; #endif
Update relative path of includes
Update relative path of includes
C
mit
Sytten/Scorch,Sytten/Scorch
df36a4196cfc8fd8b6a4ac8231d56b3c1a6b8edc
include/h2o/httpparser.h
include/h2o/httpparser.h
/* * Copyright (c) 2016 Domingo Alvarez Duarte * * The software is licensed under either the MIT License (below) or the Perl * license. * * 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 HTTPPARSER_H #define HTTPPARSER_H #include "picohttpparser.h" #endif // HTTPPARSER_H
Add the h2o/httparser.h forgotten on previous commit
Add the h2o/httparser.h forgotten on previous commit
C
mit
mingodad/h2o,mingodad/h2o,mingodad/h2o,mingodad/h2o,mingodad/h2o,mingodad/h2o,mingodad/h2o,mingodad/h2o
c203f03fc14b048592445ee37620fa5c366b2251
views/view_constants.h
views/view_constants.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_VIEW_CONSTANTS_H_ #define VIEWS_VIEW_CONSTANTS_H_ #pragma once #include "views/views_export.h" namespace views { // Size (width or height) within which the user can hold the mouse and the // view should scroll. extern const int kAutoscrollSize; // Time in milliseconds to autoscroll by a row. This is used during drag and // drop. extern const int kAutoscrollRowTimerMS; // Used to determine whether a drop is on an item or before/after it. If a drop // occurs kDropBetweenPixels from the top/bottom it is considered before/after // the item, otherwise it is on the item. VIEWS_EXPORT extern const int kDropBetweenPixels; } // namespace views #endif // VIEWS_VIEW_CONSTANTS_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_VIEW_CONSTANTS_H_ #define VIEWS_VIEW_CONSTANTS_H_ #pragma once #include "views/views_export.h" namespace views { // Size (width or height) within which the user can hold the mouse and the // view should scroll. VIEWS_EXPORT extern const int kAutoscrollSize; // Time in milliseconds to autoscroll by a row. This is used during drag and // drop. VIEWS_EXPORT extern const int kAutoscrollRowTimerMS; // Used to determine whether a drop is on an item or before/after it. If a drop // occurs kDropBetweenPixels from the top/bottom it is considered before/after // the item, otherwise it is on the item. VIEWS_EXPORT extern const int kDropBetweenPixels; } // namespace views #endif // VIEWS_VIEW_CONSTANTS_H_
Add VIEWS_EXPORT to autoscroll constants.
Add VIEWS_EXPORT to autoscroll constants. Referenced by browser/bookmarks/bookmark_drop_info.cc, fixes link when in component and incremental linking on Windows. BUG= TEST=Links in Component build mode Review URL: http://codereview.chromium.org/7741017 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@98281 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk,robclark/chromium,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,keishi/chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,Just-D/chromium-1,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,patrickm/chromium.src,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,patrickm/chromium.src,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,patrickm/chromium.src,dednal/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,nacl-webkit/chrome_deps,anirudhSK/chromium,robclark/chromium,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,hujiajie/pa-chromium,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,anirudhSK/chromium,jaruba/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,keishi/chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,patrickm/chromium.src,hujiajie/pa-chromium,jaruba/chromium.src,ltilve/chromium,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,robclark/chromium,robclark/chromium,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,rogerwang/chromium,ltilve/chromium,nacl-webkit/chrome_deps,Chilledheart/chromium,rogerwang/chromium,anirudhSK/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,keishi/chromium,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,keishi/chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,rogerwang/chromium,zcbenz/cefode-chromium,M4sse/chromium.src,jaruba/chromium.src,keishi/chromium,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,keishi/chromium,chuan9/chromium-crosswalk,ltilve/chromium,anirudhSK/chromium,Just-D/chromium-1,markYoungH/chromium.src,Jonekee/chromium.src,keishi/chromium,Jonekee/chromium.src,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,chuan9/chromium-crosswalk,keishi/chromium,hgl888/chromium-crosswalk,ondra-novak/chromium.src,robclark/chromium,ondra-novak/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk,Just-D/chromium-1,robclark/chromium,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,keishi/chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,M4sse/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,dednal/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,hujiajie/pa-chromium,robclark/chromium,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,Chilledheart/chromium,bright-sparks/chromium-spacewalk,jaruba/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,dednal/chromium.src,Pluto-tv/chromium-crosswalk,keishi/chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,rogerwang/chromium,rogerwang/chromium,ChromiumWebApps/chromium,littlstar/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,bright-sparks/chromium-spacewalk,anirudhSK/chromium,jaruba/chromium.src,rogerwang/chromium,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,zcbenz/cefode-chromium,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,patrickm/chromium.src,robclark/chromium,Jonekee/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,markYoungH/chromium.src,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,jaruba/chromium.src,mogoweb/chromium-crosswalk,rogerwang/chromium,dednal/chromium.src,ChromiumWebApps/chromium,Jonekee/chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,Chilledheart/chromium,littlstar/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,M4sse/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,jaruba/chromium.src,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,littlstar/chromium.src,axinging/chromium-crosswalk,hujiajie/pa-chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,markYoungH/chromium.src,patrickm/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,robclark/chromium,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dednal/chromium.src,anirudhSK/chromium,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,hujiajie/pa-chromium,keishi/chromium,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,ChromiumWebApps/chromium,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,M4sse/chromium.src,nacl-webkit/chrome_deps,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,littlstar/chromium.src,chuan9/chromium-crosswalk,littlstar/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,robclark/chromium,dushu1203/chromium.src,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,ltilve/chromium,rogerwang/chromium,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,dednal/chromium.src,dednal/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,ChromiumWebApps/chromium,M4sse/chromium.src,dushu1203/chromium.src,ltilve/chromium,zcbenz/cefode-chromium,zcbenz/cefode-chromium
f819adcbf7fac24094690db9f46c44727b4c1f81
program/driver/us100.c
program/driver/us100.c
/*==============================================================================================*/ /*==============================================================================================*/ #include "QuadCopterConfig.h" Ultrasonic_t Ultrasonic = { .lenHigh = 0, .lenLow = 0, .d = 0 }; /*==============================================================================================*/ /*==============================================================================================* **函數 : us100_distant **功能 : get 1 calculated distant data from the data received by USART **輸入 : Ultrasonic.lenHigh, Ultrasonic.lenLow **輸出 : Ultrasonic.d (mm) **使用 : us100_distant(); **==============================================================================================*/ /*==============================================================================================*/ void us100_distant(){ //reading data serial.putc('U'); serial2.putc('1'); //vTaskDelay(500); //calculating the distance //if(serial2.getc()){ Ultrasonic.lenHigh = serial.getc(); serial2.putc('2'); Ultrasonic.lenLow = serial.getc(); serial2.putc('3'); Ultrasonic.d = Ultrasonic.lenHigh*256 + Ultrasonic.lenLow; //} }
/*==============================================================================================*/ /*==============================================================================================*/ #include "QuadCopterConfig.h" /* Connection methods of Ultrasonic */ #define ULT_USE_UART2 1 #define ULT_USE_PWM 0 Ultrasonic_t Ultrasonic = { .lenHigh = 0, .lenLow = 0, .d = 0 }; /*==============================================================================================*/ /*==============================================================================================* **函數 : us100_distant **功能 : get 1 calculated distant data from the data received by USART **輸入 : Ultrasonic.lenHigh, Ultrasonic.lenLow **輸出 : Ultrasonic.d (mm) **使用 : print_us100_distant(); **==============================================================================================*/ /*==============================================================================================*/ void print_us100_distant(){ #if ULT_USE_UART2 serial2.putc('U'); vTaskDelay(500); Ultrasonic.lenHigh = serial2.getc(); Ultrasonic.lenLow = serial2.getc(); Ultrasonic.d = (Ultrasonic.lenHigh*256 + Ultrasonic.lenLow)*0.1; serial.printf("Distance: "); serial.printf("%d",Ultrasonic.d); serial.printf(" cm\n\r"); vTaskDelay(30); #endif }
Make US100 sensor get distance successfully.
Make US100 sensor get distance successfully.
C
mit
zxc2694/STM32F429_Quadrotor,zxc2694/STM32F429_Quadrotor,zxc2694/STM32F429_Quadrotor
b5514486424d446e30afd645827c79101e28d096
src/lib/convenienceMap/mapPutIndividualContextEntityAttribute.h
src/lib/convenienceMap/mapPutIndividualContextEntityAttribute.h
#ifndef MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H #define MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H /* * * Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U * * This file is part of Orion Context Broker. * * Orion Context Broker 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. * * Orion Context Broker 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 Orion Context Broker. If not, see http://www.gnu.org/licenses/. * * For those usages not covered by this license please contact with * fermin at tid dot es * * Author: TID Developer */ #include "convenience/UpdateContextAttributeRequest.h" #include "mongoBackend/MongoGlobal.h" /* **************************************************************************** * * mapPutIndividualContextEntityAttributes - */ extern HttpStatusCode mapPutIndividualContextEntityAttribute(std::string entityId, std::string attributeName, UpdateContextAttributeRequest* request, StatusCode* response); #endif
#ifndef MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H #define MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H /* * * Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U * * This file is part of Orion Context Broker. * * Orion Context Broker 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. * * Orion Context Broker 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 Orion Context Broker. If not, see http://www.gnu.org/licenses/. * * For those usages not covered by this license please contact with * fermin at tid dot es * * Author: TID Developer */ #include "convenience/UpdateContextAttributeRequest.h" #include "mongoBackend/MongoGlobal.h" /* **************************************************************************** * * mapPutIndividualContextEntityAttributes - */ extern HttpStatusCode mapPutIndividualContextEntityAttribute(std::string entityId, std::string attributeName, UpdateContextAttributeRequest* request, StatusCode* response); #endif
Change date of copyright notice
Change date of copyright notice
C
agpl-3.0
jmcanterafonseca/fiware-orion,Fiware/data.Orion,gavioto/fiware-orion,guerrerocarlos/fiware-orion,Fiware/data.Orion,Fiware/context.Orion,Fiware/data.Orion,fiwareulpgcmirror/fiware-orion,pacificIT/fiware-orion,gavioto/fiware-orion,telefonicaid/fiware-orion,McMutton/fiware-orion,Fiware/context.Orion,yalp/fiware-orion,McMutton/fiware-orion,gavioto/fiware-orion,jmcanterafonseca/fiware-orion,pacificIT/fiware-orion,yalp/fiware-orion,j1fig/fiware-orion,Fiware/context.Orion,telefonicaid/fiware-orion,gavioto/fiware-orion,j1fig/fiware-orion,McMutton/fiware-orion,telefonicaid/fiware-orion,jmcanterafonseca/fiware-orion,telefonicaid/fiware-orion,pacificIT/fiware-orion,Fiware/data.Orion,guerrerocarlos/fiware-orion,fiwareulpgcmirror/fiware-orion,fiwareulpgcmirror/fiware-orion,jmcanterafonseca/fiware-orion,yalp/fiware-orion,McMutton/fiware-orion,McMutton/fiware-orion,pacificIT/fiware-orion,pacificIT/fiware-orion,fiwareulpgcmirror/fiware-orion,guerrerocarlos/fiware-orion,guerrerocarlos/fiware-orion,j1fig/fiware-orion,McMutton/fiware-orion,yalp/fiware-orion,Fiware/context.Orion,fortizc/fiware-orion,jmcanterafonseca/fiware-orion,fiwareulpgcmirror/fiware-orion,fortizc/fiware-orion,telefonicaid/fiware-orion,Fiware/data.Orion,telefonicaid/fiware-orion,guerrerocarlos/fiware-orion,fiwareulpgcmirror/fiware-orion,fortizc/fiware-orion,fortizc/fiware-orion,j1fig/fiware-orion,j1fig/fiware-orion,yalp/fiware-orion,McMutton/fiware-orion,Fiware/context.Orion,jmcanterafonseca/fiware-orion,gavioto/fiware-orion,fortizc/fiware-orion,Fiware/data.Orion,fortizc/fiware-orion,Fiware/context.Orion
232073b0d97756ee4b3961c99050f4e20aa29a44
src/gallium/auxiliary/target-helpers/inline_debug_helper.h
src/gallium/auxiliary/target-helpers/inline_debug_helper.h
#ifndef INLINE_DEBUG_HELPER_H #define INLINE_DEBUG_HELPER_H #include "pipe/p_compiler.h" #include "util/u_debug.h" /* Helper function to wrap a screen with * one or more debug driver: rbug, trace. */ #ifdef GALLIUM_TRACE #include "trace/tr_public.h" #endif #ifdef GALLIUM_RBUG #include "rbug/rbug_public.h" #endif #ifdef GALLIUM_GALAHAD #include "galahad/glhd_public.h" #endif #ifdef GALLIUM_NOOP #include "noop/noop_public.h" #endif static INLINE struct pipe_screen * debug_screen_wrap(struct pipe_screen *screen) { #if defined(GALLIUM_RBUG) screen = rbug_screen_create(screen); #endif #if defined(GALLIUM_TRACE) screen = trace_screen_create(screen); #endif #if defined(GALLIUM_GALAHAD) screen = galahad_screen_create(screen); #endif #if defined(GALLIUM_NOOP) screen = noop_screen_create(screen); #endif return screen; } #endif
#ifndef INLINE_DEBUG_HELPER_H #define INLINE_DEBUG_HELPER_H #include "pipe/p_compiler.h" #include "util/u_debug.h" /* Helper function to wrap a screen with * one or more debug driver: rbug, trace. */ #ifdef DEBUG #ifdef GALLIUM_TRACE #include "trace/tr_public.h" #endif #ifdef GALLIUM_RBUG #include "rbug/rbug_public.h" #endif #ifdef GALLIUM_GALAHAD #include "galahad/glhd_public.h" #endif #ifdef GALLIUM_NOOP #include "noop/noop_public.h" #endif #endif /* DEBUG */ static INLINE struct pipe_screen * debug_screen_wrap(struct pipe_screen *screen) { #ifdef DEBUG #if defined(GALLIUM_RBUG) screen = rbug_screen_create(screen); #endif #if defined(GALLIUM_TRACE) screen = trace_screen_create(screen); #endif #if defined(GALLIUM_GALAHAD) screen = galahad_screen_create(screen); #endif #if defined(GALLIUM_NOOP) screen = noop_screen_create(screen); #endif #endif /* DEBUG */ return screen; } #endif
Enable debug helpers only on debug builds.
target-helpers: Enable debug helpers only on debug builds. Some of these helpers use debug_get_option, which works also on releases.
C
mit
mcanthony/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,dellis1972/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,jbarczak/glsl-optimizer,djreep81/glsl-optimizer,jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,bkaradzic/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,djreep81/glsl-optimizer,metora/MesaGLSLCompiler,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer
305cbdf45f2e9414d283abb7c7f4adcf1de546fc
samplecode/GMSampleView.h
samplecode/GMSampleView.h
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GMSampleView_DEFINED #define GMSampleView_DEFINED #include "SampleCode.h" #include "gm.h" class GMSampleView : public SampleView { private: typedef skiagm::GM GM; public: GMSampleView(GM* gm) : fGM(gm) {} virtual ~GMSampleView() { delete fGM; } protected: virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { SkString name("GM "); name.append(fGM->shortName()); SampleCode::TitleR(evt, name.c_str()); return true; } return this->INHERITED::onQuery(evt); } virtual void onDrawContent(SkCanvas* canvas) { fGM->drawContent(canvas); } virtual void onDrawBackground(SkCanvas* canvas) { fGM->drawBackground(canvas); } private: GM* fGM; typedef SampleView INHERITED; }; #endif
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GMSampleView_DEFINED #define GMSampleView_DEFINED #include "SampleCode.h" #include "gm.h" class GMSampleView : public SampleView { private: typedef skiagm::GM GM; public: GMSampleView(GM* gm) : fGM(gm) {} virtual ~GMSampleView() { delete fGM; } protected: virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { SkString name("GM:"); name.append(fGM->shortName()); SampleCode::TitleR(evt, name.c_str()); return true; } return this->INHERITED::onQuery(evt); } virtual void onDrawContent(SkCanvas* canvas) { fGM->drawContent(canvas); } virtual void onDrawBackground(SkCanvas* canvas) { fGM->drawBackground(canvas); } private: GM* fGM; typedef SampleView INHERITED; }; #endif
Use : as separator between "GM" and slide name in SampleApp. This makes it easier to jump to a GM slide using command line args on windows.
Use : as separator between "GM" and slide name in SampleApp. This makes it easier to jump to a GM slide using command line args on windows.
C
bsd-3-clause
csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia
6647f18c6da873cfda4320efff02bf1aa28c2888
projects/PathosEngine/src/pathos/mesh/static_mesh_component.h
projects/PathosEngine/src/pathos/mesh/static_mesh_component.h
#pragma once #include "pathos/actor/scene_component.h" #include "badger/types/matrix_types.h" namespace pathos { class Mesh; class MeshGeometry; class Material; // #todo-renderer: Further decompose struct StaticMeshProxy : public SceneComponentProxy { uint32 doubleSided : 1; uint32 renderInternal : 1; matrix4 modelMatrix; MeshGeometry* geometry; Material* material; }; struct ShadowMeshProxy : public SceneComponentProxy { matrix4 modelMatrix; MeshGeometry* geometry; }; class StaticMeshComponent : public SceneComponent { friend class GodRay; // due to createRenderProxy_internal() public: virtual void createRenderProxy(Scene* scene); inline Mesh* getStaticMesh() const { return mesh; } void setStaticMesh(Mesh* inMesh) { mesh = inMesh; } private: void createRenderProxy_internal(Scene* scene, std::vector<StaticMeshProxy*>& outProxyList); public: bool castsShadow = true; private: Mesh* mesh; }; }
#pragma once #include "pathos/actor/scene_component.h" #include "badger/types/matrix_types.h" namespace pathos { class Mesh; class MeshGeometry; class Material; // #todo-renderer: Further decompose struct StaticMeshProxy : public SceneComponentProxy { uint32 doubleSided : 1; uint32 renderInternal : 1; matrix4 modelMatrix; MeshGeometry* geometry; Material* material; }; struct ShadowMeshProxy : public SceneComponentProxy { matrix4 modelMatrix; MeshGeometry* geometry; }; class StaticMeshComponent : public SceneComponent { friend class GodRay; // due to createRenderProxy_internal() public: virtual void createRenderProxy(Scene* scene); inline Mesh* getStaticMesh() const { return mesh; } void setStaticMesh(Mesh* inMesh) { mesh = inMesh; } private: void createRenderProxy_internal(Scene* scene, std::vector<StaticMeshProxy*>& outProxyList); public: bool castsShadow = true; private: Mesh* mesh = nullptr; }; }
Set default value of StaticMeshComponent::mesh to nullptr
Set default value of StaticMeshComponent::mesh to nullptr
C
mit
codeonwort/pathosengine,codeonwort/pathosengine,codeonwort/pathosengine
2f92cee416aef4684471c539e370772824ae7854
tests/tgen-mstring.c
tests/tgen-mstring.c
/* * Copyright (c) 2017-2022, Patrick Pelissier * 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. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS AND 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 "m-string.h" size_t fsize(const char str[]) { return m_str1ng_utf8_length(str); } void convert(string_t s, unsigned n) { m_string_set_ui(s, n); }
/* * Copyright (c) 2017-2022, Patrick Pelissier * 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. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS AND 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 "m-string.h" size_t fsize(const char str[]) { return m_str1ng_utf8_length(str); } void convert(string_t s, unsigned n) { m_string_set_ui(s, n); } void construct(char s[], unsigned n) { strcpy(s, M_CSTR("Hello %u worlds")); }
Update code for generated asm analysis
Update code for generated asm analysis
C
bsd-2-clause
P-p-H-d/mlib,P-p-H-d/mlib
d0d9cd60fdfb44d71e61dca4737fc6a2c70a266e
WebSocketTransport/WebSocketTransport.h
WebSocketTransport/WebSocketTransport.h
// // WebSocketTransport.h // WebSocketTransport // // Created by Paul Young on 27/08/2014. // Copyright (c) 2014 CocoaFlow. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for WebSocketTransport. FOUNDATION_EXPORT double WebSocketTransportVersionNumber; //! Project version string for WebSocketTransport. FOUNDATION_EXPORT const unsigned char WebSocketTransportVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <WebSocketTransport/PublicHeader.h>
// // WebSocketTransport.h // WebSocketTransport // // Created by Paul Young on 27/08/2014. // Copyright (c) 2014 CocoaFlow. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for WebSocketTransport. FOUNDATION_EXPORT double WebSocketTransportVersionNumber; //! Project version string for WebSocketTransport. FOUNDATION_EXPORT const unsigned char WebSocketTransportVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <WebSocketTransport/PublicHeader.h> #import "BLWebSocketsServer.h"
Make BLWebSocketsServer available in Swift.
Make BLWebSocketsServer available in Swift.
C
apache-2.0
CocoaFlow/WebSocketTransport