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
95ee667503b8b3123951242e3f7b93598cb9f9b9
test/CodeGen/2003-08-18-SigSetJmp.c
test/CodeGen/2003-08-18-SigSetJmp.c
// RUN: %clang -S -emit-llvm %s -o /dev/null // XFAIL: mingw,win32 #include <setjmp.h> sigjmp_buf B; int foo() { sigsetjmp(B, 1); bar(); }
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o /dev/null #define _JBLEN ((9 * 2) + 3 + 16) typedef int sigjmp_buf[_JBLEN + 1]; int sigsetjmp(sigjmp_buf env, int savemask); sigjmp_buf B; int foo() { sigsetjmp(B, 1); bar(); }
Remove the need for a header and specify a triple so that the type sizes make sense.
Remove the need for a header and specify a triple so that the type sizes make sense. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136309 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
ac74c205b0faa35640922b55095f27913fc2158c
misc/clang_cast_align.c
misc/clang_cast_align.c
#include <stdio.h> #include <stdlib.h> struct dummy { double d; }; int main(int argc, char *argv[]) { struct dummy *d; char *p; (void) argc; (void) argv; /* This causes a warning with clang -Wcast-align: * * clang_cast_align.c:13:6: warning: cast from 'char *' to 'struct dummy *' increases required alignment * from 1 to 8 [-Wcast-align] * d = (struct dummy *) p; * * Note that malloc() alignment guarantees are enough to make the * warning harmless, so it'd be nice to suppress. */ p = (char *) malloc(sizeof(struct dummy)); d = (struct dummy *) p; /* Casting through a void pointer suppressed the warning for clang. */ p = (char *) malloc(sizeof(struct dummy)); d = (struct dummy *) (void *) p; return 0; }
Add example of suppressing clang -Wcast-align
Add example of suppressing clang -Wcast-align
C
mit
svaarala/duktape,reqshark/duktape,nivertech/duktape,kphillisjr/duktape,sloth4413/duktape,reqshark/duktape,sloth4413/duktape,svaarala/duktape,reqshark/duktape,zeropool/duktape,jmptrader/duktape,tassmjau/duktape,chenyaqiuqiu/duktape,zeropool/duktape,reqshark/duktape,harold-b/duktape,kphillisjr/duktape,harold-b/duktape,markand/duktape,jmptrader/duktape,zeropool/duktape,tassmjau/duktape,harold-b/duktape,markand/duktape,chenyaqiuqiu/duktape,chenyaqiuqiu/duktape,zeropool/duktape,jmptrader/duktape,nivertech/duktape,tassmjau/duktape,markand/duktape,chenyaqiuqiu/duktape,tassmjau/duktape,svaarala/duktape,svaarala/duktape,chenyaqiuqiu/duktape,sloth4413/duktape,harold-b/duktape,zeropool/duktape,harold-b/duktape,nivertech/duktape,kphillisjr/duktape,chenyaqiuqiu/duktape,jmptrader/duktape,harold-b/duktape,sloth4413/duktape,svaarala/duktape,svaarala/duktape,nivertech/duktape,markand/duktape,reqshark/duktape,zeropool/duktape,zeropool/duktape,tassmjau/duktape,jmptrader/duktape,reqshark/duktape,nivertech/duktape,chenyaqiuqiu/duktape,reqshark/duktape,kphillisjr/duktape,kphillisjr/duktape,tassmjau/duktape,kphillisjr/duktape,tassmjau/duktape,sloth4413/duktape,svaarala/duktape,jmptrader/duktape,markand/duktape,nivertech/duktape,zeropool/duktape,nivertech/duktape,harold-b/duktape,markand/duktape,jmptrader/duktape,kphillisjr/duktape,markand/duktape,reqshark/duktape,chenyaqiuqiu/duktape,tassmjau/duktape,reqshark/duktape,chenyaqiuqiu/duktape,harold-b/duktape,zeropool/duktape,tassmjau/duktape,kphillisjr/duktape,svaarala/duktape,markand/duktape,reqshark/duktape,zeropool/duktape,sloth4413/duktape,sloth4413/duktape,nivertech/duktape,sloth4413/duktape,nivertech/duktape,markand/duktape,nivertech/duktape,markand/duktape,chenyaqiuqiu/duktape,harold-b/duktape,kphillisjr/duktape,sloth4413/duktape,kphillisjr/duktape,sloth4413/duktape,jmptrader/duktape,jmptrader/duktape,svaarala/duktape,harold-b/duktape,jmptrader/duktape,tassmjau/duktape
9be47d768eb967add11f6ac218ccb49973f9d5ee
src/main.c
src/main.c
int main() { return 0; }
#include <fcntl.h> #include <stdio.h> #include <unistd.h> const char usage[] = "Usage: %s <filenname>\n"; #define READ_SIZE 2048 int main(int argc, char *argv[]) { if (argc != 2) { printf(usage, argv[0]); return 1; } //FILE *file = fopen(argv[1], "r"); int fd = open(argv[1], O_RDONLY); char buf[READ_SIZE]; ssize_t bytes; do { bytes = read(fd, buf, READ_SIZE); if (bytes == -1) { perror("error reading file"); return 1; } write(STDOUT_FILENO, buf, bytes); } while (bytes == READ_SIZE); return 0; }
Read file passed as argv[1]
Read file passed as argv[1]
C
mit
orodley/imgprint
070f63791af1c9190388ee715a2c9c0b68bc9b2c
machine/include/diag.h
machine/include/diag.h
#ifndef KERN_DIAG #define KERN_DIAG #include <stdarg.h> void panic(const char* diagnostic_message, ...); void shutdown() __attribute__((noreturn)); extern void hang_machine() __attribute__((noreturn)); #ifdef DEBUG #define assert(x) if (!(x)) panic("Assertion failed: " __FILE__ ":%u: " #x, __LINE__) #else #define assert(x) (void) 0 #endif #endif /* KERN_DIAG */
#ifndef KERN_DIAG #define KERN_DIAG #include <stdarg.h> void panic(const char* diagnostic_message, ...) __attribute__((noreturn)); void shutdown() __attribute__((noreturn)); extern void hang_machine() __attribute__((noreturn)); #ifdef DEBUG #define assert(x) if (!(x)) panic("Assertion failed: " __FILE__ ":%u: " #x, __LINE__) #else #define assert(x) (void) 0 #endif #endif /* KERN_DIAG */
Declare panic function as noreturn
machine: Declare panic function as noreturn
C
bsd-2-clause
cksystemsteaching/selfie,cksystemsteaching/selfie,cksystemsteaching/selfie
60890cc60ccfc7000791a47f1f3d69fdb8884dd7
compat/win32mmap.c
compat/win32mmap.c
#include "../git-compat-util.h" void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) { HANDLE hmap; void *temp; size_t len; struct stat st; uint64_t o = offset; uint32_t l = o & 0xFFFFFFFF; uint32_t h = (o >> 32) & 0xFFFFFFFF; if (!fstat(fd, &st)) len = xsize_t(st.st_size); else die("mmap: could not determine filesize"); if ((length + offset) > len) length = len - offset; if (!(flags & MAP_PRIVATE)) die("Invalid usage of mmap when built with USE_WIN32_MMAP"); hmap = CreateFileMapping((HANDLE)_get_osfhandle(fd), 0, PAGE_WRITECOPY, 0, 0, 0); if (!hmap) return MAP_FAILED; temp = MapViewOfFileEx(hmap, FILE_MAP_COPY, h, l, length, start); if (!CloseHandle(hmap)) warning("unable to close file mapping handle\n"); return temp ? temp : MAP_FAILED; } int git_munmap(void *start, size_t length) { return !UnmapViewOfFile(start); }
#include "../git-compat-util.h" void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) { HANDLE hmap; void *temp; off_t len; struct stat st; uint64_t o = offset; uint32_t l = o & 0xFFFFFFFF; uint32_t h = (o >> 32) & 0xFFFFFFFF; if (!fstat(fd, &st)) len = st.st_size; else die("mmap: could not determine filesize"); if ((length + offset) > len) length = xsize_t(len - offset); if (!(flags & MAP_PRIVATE)) die("Invalid usage of mmap when built with USE_WIN32_MMAP"); hmap = CreateFileMapping((HANDLE)_get_osfhandle(fd), 0, PAGE_WRITECOPY, 0, 0, 0); if (!hmap) return MAP_FAILED; temp = MapViewOfFileEx(hmap, FILE_MAP_COPY, h, l, length, start); if (!CloseHandle(hmap)) warning("unable to close file mapping handle\n"); return temp ? temp : MAP_FAILED; } int git_munmap(void *start, size_t length) { return !UnmapViewOfFile(start); }
Fix "Out of memory? mmap failed" for files larger than 4GB on Windows
Fix "Out of memory? mmap failed" for files larger than 4GB on Windows The git_mmap implementation was broken for file sizes that wouldn't fit into a size_t (32 bits). This was caused by intermediate variables that were only 32 bits wide when they should be 64 bits. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
C
mit
destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git
38c576c56e89b6dd232d3c072a1294cd1e519135
test/CFrontend/2007-11-07-CopyAggregateAlign.c
test/CFrontend/2007-11-07-CopyAggregateAlign.c
// RUN: %llvmgcc -S %s -o - | grep "align 2" | count 6 struct A { char s, t, u, v; short a; }; void q() { struct A a, b; a = b; }
Check that the first and third characters, s and u, are accessed with an alignment of 2 not 1.
Check that the first and third characters, s and u, are accessed with an alignment of 2 not 1. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@43932 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm
2964992cd8409df9870b8c38e95261c56b58145b
src/appjs_window.h
src/appjs_window.h
#ifndef APPJS_WINDOW_H #define APPJS_WINDOW_H #pragma once #include "appjs.h" // GTK+ binding for linux #if defined(__LINUX__) #include "linux/mainwindow.h" #endif /* end of linux */ // GTK+ binding for linux #if defined(__WIN__) #include "linux/mainwindow.h" #endif /* end of linux */ namespace appjs { using namespace v8; class Window : public node::ObjectWrap { DECLARE_NODE_OBJECT_FACTORY(Window); DEFINE_CPP_METHOD(Show); DEFINE_CPP_METHOD(Hide); }; } /* appjs */ #endif /* end of APPJS_WINDOW_H */
#ifndef APPJS_WINDOW_H #define APPJS_WINDOW_H #pragma once #include "appjs.h" // GTK+ binding for linux #if defined(__LINUX__) #include "linux/mainwindow.h" #endif /* end of linux */ // Windows necessary files #if defined(__WIN__) #include "windows/mainwindow.h" #endif /* end of windows */ namespace appjs { using namespace v8; class Window : public node::ObjectWrap { DECLARE_NODE_OBJECT_FACTORY(Window); DEFINE_CPP_METHOD(Show); DEFINE_CPP_METHOD(Hide); }; } /* appjs */ #endif /* end of APPJS_WINDOW_H */
Copy paste always introduce bugs:|
Copy paste always introduce bugs:|
C
mit
milani/appjs,appjs/appjs,milani/appjs,modulexcite/appjs,imshibaji/appjs,SaravananRajaraman/appjs,yuhangwang/appjs,eric-seekas/appjs,tempbottle/appjs,imshibaji/appjs,imshibaji/appjs,SaravananRajaraman/appjs,modulexcite/appjs,yuhangwang/appjs,tempbottle/appjs,reekoheek/appjs,SaravananRajaraman/appjs,yuhangwang/appjs,modulexcite/appjs,reekoheek/appjs,appjs/appjs,eric-seekas/appjs,milani/appjs,modulexcite/appjs,appjs/appjs,eric-seekas/appjs,tempbottle/appjs,tempbottle/appjs,SaravananRajaraman/appjs,SaravananRajaraman/appjs,reekoheek/appjs,yuhangwang/appjs,imshibaji/appjs,appjs/appjs,eric-seekas/appjs,SaravananRajaraman/appjs
06d59e057530edb17d4532fb92bdbf7599c98339
Firmware/Src/board_id.c
Firmware/Src/board_id.c
#include "board_id.h" //FIXME rm #include "iprintf.h" #include <stdint.h> /** * Returns an approximate GUID (in STM32 land) based on a bunch of fabrication-related metadata. * * See Technical Reference Manual pg933 ("Unique device ID register") for address and explanation. * First 32 bits are wafer X Y coordinates in BCD * Next 8 are wafer number * Next 56 are lot number in ASCII */ #define UNIQUE_ID_REG_ADDR 0x1FFFF7AC #define UNIQUE_ID_REG_GET8(x) ((x >= 0 && x < 12) ? (*(uint8_t *) (UNIQUE_ID_REG_ADDR + (x))) : 0) uint32_t bid_GetID(void) { int i; for(i = 0; i < 12; i++) { //FIXME rm printing iprintf("ID #%d - 0x%x (%c)\n", i, UNIQUE_ID_REG_GET8(i), UNIQUE_ID_REG_GET8(i)); } //use ASCII lot number as u32 board ID return UNIQUE_ID_REG_GET8( 8) << 0 | UNIQUE_ID_REG_GET8( 9) << 8 | UNIQUE_ID_REG_GET8(10) << 16| UNIQUE_ID_REG_GET8(11) << 24; }
#include "board_id.h" //FIXME rm #include "iprintf.h" #include <stdint.h> /** * Returns an approximate GUID (in STM32 land) based on a bunch of fabrication-related metadata. * * See Technical Reference Manual pg933 ("Unique device ID register") for address and explanation. * First 32 bits are wafer X Y coordinates in BCD * Next 8 are wafer number * Next 56 are lot number in ASCII */ #define UNIQUE_ID_REG_ADDR 0x1FFFF7AC #define UNIQUE_ID_REG_GET8(x) ((x >= 0 && x < 12) ? (*(uint8_t *) (UNIQUE_ID_REG_ADDR + (x))) : 0) uint32_t bid_GetID(void) { int i; for(i = 0; i < 12; i++) { //FIXME rm printing iprintf("ID #%d - 0x%x (%c)\n", i, UNIQUE_ID_REG_GET8(i), UNIQUE_ID_REG_GET8(i)); } // use wafer X/Y for ID. The tray I got all has the same lot number return UNIQUE_ID_REG_GET8(0) << 0 | UNIQUE_ID_REG_GET8(1) << 8 | UNIQUE_ID_REG_GET8(2) << 16| UNIQUE_ID_REG_GET8(3) << 24; }
Switch to wafer X/Y for board ID
Switch to wafer X/Y for board ID
C
mit
borgel/sympetrum-v2,borgel/sympetrum-v2
a68fe89852145287bff6727effe9a7e7b680c017
framework/include/base/MeshChangedInterface.h
framework/include/base/MeshChangedInterface.h
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef MESHCHANGEDINTERFACE_H #define MESHCHANGEDINTERFACE_H #include "InputParameters.h" #include "ExecStore.h" #include "MooseEnum.h" // Forward declarations class MeshChangedInterface; template <> InputParameters validParams<MeshChangedInterface>(); /** * Interface for notifications that the mesh has changed. */ class MeshChangedInterface { public: MeshChangedInterface(const InputParameters & params); virtual ~MeshChangedInterface() = default; /** * Called on this object when the mesh changes */ virtual void meshChanged() {} protected: /// Reference to FEProblemBase instance FEProblemBase & _mci_feproblem; }; #endif /* MESHCHANGEDINTERFACE_H */
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef MESHCHANGEDINTERFACE_H #define MESHCHANGEDINTERFACE_H #include "MooseEnum.h" // Forward declarations class FEProblemBase; class InputParameters; class MeshChangedInterface; template <typename T> InputParameters validParams(); template <> InputParameters validParams<MeshChangedInterface>(); /** * Interface for notifications that the mesh has changed. */ class MeshChangedInterface { public: MeshChangedInterface(const InputParameters & params); virtual ~MeshChangedInterface() = default; /** * Called on this object when the mesh changes */ virtual void meshChanged() {} protected: /// Reference to FEProblemBase instance FEProblemBase & _mci_feproblem; }; #endif /* MESHCHANGEDINTERFACE_H */
Remove unused header, switch header to fwd decl
Remove unused header, switch header to fwd decl
C
lgpl-2.1
bwspenc/moose,SudiptaBiswas/moose,dschwen/moose,laagesen/moose,dschwen/moose,yipenggao/moose,idaholab/moose,idaholab/moose,andrsd/moose,harterj/moose,bwspenc/moose,andrsd/moose,jessecarterMOOSE/moose,idaholab/moose,dschwen/moose,idaholab/moose,laagesen/moose,Chuban/moose,lindsayad/moose,lindsayad/moose,bwspenc/moose,YaqiWang/moose,permcody/moose,liuwenf/moose,dschwen/moose,nuclear-wizard/moose,sapitts/moose,YaqiWang/moose,milljm/moose,yipenggao/moose,sapitts/moose,jessecarterMOOSE/moose,milljm/moose,friedmud/moose,Chuban/moose,nuclear-wizard/moose,nuclear-wizard/moose,lindsayad/moose,friedmud/moose,idaholab/moose,sapitts/moose,dschwen/moose,yipenggao/moose,sapitts/moose,YaqiWang/moose,jessecarterMOOSE/moose,sapitts/moose,milljm/moose,harterj/moose,jessecarterMOOSE/moose,friedmud/moose,jessecarterMOOSE/moose,permcody/moose,SudiptaBiswas/moose,harterj/moose,andrsd/moose,laagesen/moose,permcody/moose,SudiptaBiswas/moose,SudiptaBiswas/moose,permcody/moose,lindsayad/moose,milljm/moose,SudiptaBiswas/moose,liuwenf/moose,andrsd/moose,bwspenc/moose,liuwenf/moose,Chuban/moose,liuwenf/moose,liuwenf/moose,yipenggao/moose,YaqiWang/moose,friedmud/moose,lindsayad/moose,laagesen/moose,Chuban/moose,harterj/moose,bwspenc/moose,milljm/moose,nuclear-wizard/moose,harterj/moose,andrsd/moose,liuwenf/moose,laagesen/moose
a3c982089a1443e909ebf8d6cf9be88f23c1f452
libutils/include/utils/assume.h
libutils/include/utils/assume.h
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_ASSUME_H #define _UTILS_ASSUME_H #include <utils/builtin.h> /* This idiom is a way of passing extra information or hints to GCC. It is only * occasionally successful, so don't think of it as a silver optimisation * bullet. */ #define ASSUME(x) \ do { \ if (!(x)) { \ __builtin_unreachable(); \ } \ } while (0) #endif
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_ASSUME_H #define _UTILS_ASSUME_H #include <utils/attribute.h> #include <utils/builtin.h> #include <utils/stringify.h> /* This idiom is a way of passing extra information or hints to GCC. It is only * occasionally successful, so don't think of it as a silver optimisation * bullet. */ #define ASSUME(x) \ do { \ if (!(x)) { \ __builtin_unreachable(); \ } \ } while (0) /* Indicate to the compiler that wherever this macro appears is a cold * execution path. That is, it is not performance critical and likely rarely * used. A perfect example is error handling code. This gives the compiler a * light hint to deprioritise optimisation of this path. */ #define COLD_PATH() \ do { \ JOIN(cold_path_, __COUNTER__): COLD UNUSED; \ } while (0) /* The opposite of `COLD_PATH`. That is, aggressively optimise this path, * potentially at the expense of others. */ #define HOT_PATH() \ do { \ JOIN(hot_path_, __COUNTER__): HOT UNUSED; \ } while (0) #endif
Add dedicated macros to indicate hot and cold execution paths.
libutils: Add dedicated macros to indicate hot and cold execution paths.
C
bsd-2-clause
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
a69d4d917316e4123ec6510845d21ae53b3ecf45
src/config.h
src/config.h
//===----------------------------- config.h -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // // // Defines macros used within the libc++abi project. // //===----------------------------------------------------------------------===// #ifndef LIBCXXABI_CONFIG_H #define LIBCXXABI_CONFIG_H #include <unistd.h> #if defined(_POSIX_THREADS) && _POSIX_THREADS > 0 # define LIBCXXABI_SINGLE_THREADED 0 #else # define LIBCXXABI_SINGLE_THREADED 1 #endif // Set this in the CXXFLAGS when you need it, because otherwise we'd have to // #if !defined(__linux__) && !defined(__APPLE__) && ... // and so-on for *every* platform. #ifndef LIBCXXABI_BAREMETAL # define LIBCXXABI_BAREMETAL 0 #endif #endif // LIBCXXABI_CONFIG_H
//===----------------------------- config.h -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // // // Defines macros used within the libc++abi project. // //===----------------------------------------------------------------------===// #ifndef LIBCXXABI_CONFIG_H #define LIBCXXABI_CONFIG_H #include <unistd.h> #if !defined(LIBCXXABI_SINGLE_THREADED) && \ defined(_POSIX_THREADS) && _POSIX_THREADS > 0 # define LIBCXXABI_SINGLE_THREADED 0 #else # define LIBCXXABI_SINGLE_THREADED 1 #endif // Set this in the CXXFLAGS when you need it, because otherwise we'd have to // #if !defined(__linux__) && !defined(__APPLE__) && ... // and so-on for *every* platform. #ifndef LIBCXXABI_BAREMETAL # define LIBCXXABI_BAREMETAL 0 #endif #endif // LIBCXXABI_CONFIG_H
Allow LIBCXXABI_SINGLE_THREADED to be defined by build scripts
Allow LIBCXXABI_SINGLE_THREADED to be defined by build scripts git-svn-id: 6a9f6578bdee8d959f0ed58970538b4ab6004734@216952 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi
2de28b4ab779c0d530f4381ebc5dd48ed2ebc29b
android/jni/InteriorsExplorer/View/InteriorStreamingDialogView.h
android/jni/InteriorsExplorer/View/InteriorStreamingDialogView.h
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include "IInteriorStreamingDialogView.h" #include "InteriorsExplorerViewIncludes.h" #include "AndroidNativeState.h" namespace ExampleApp { namespace InteriorsExplorer { namespace View { class InteriorStreamingDialogView : public IInteriorStreamingDialogView { public: AndroidNativeState& m_nativeState; jclass m_uiViewClass; jobject m_uiView; InteriorStreamingDialogView(AndroidNativeState& nativeState); ~InteriorStreamingDialogView(); void Show(); void Hide(bool interiorLoaded); }; } } }
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include "IInteriorStreamingDialogView.h" #include "InteriorsExplorerViewIncludes.h" #include "AndroidNativeState.h" namespace ExampleApp { namespace InteriorsExplorer { namespace View { class InteriorStreamingDialogView : public IInteriorStreamingDialogView { public: InteriorStreamingDialogView(AndroidNativeState& nativeState); ~InteriorStreamingDialogView(); void Show(); void Hide(bool interiorLoaded); private: AndroidNativeState& m_nativeState; jclass m_uiViewClass; jobject m_uiView; }; } } }
Fix naming concern from previous commit. Buddy: Sam
Fix naming concern from previous commit. Buddy: Sam
C
bsd-2-clause
wrld3d/wrld-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app
166d113686fd20cd8e0bf6e5b4f2ac92e24765a4
interface/cecp_features.h
interface/cecp_features.h
#ifndef _CECP_FEATURES_H #define _CECP_FEATURES_H #include <stdio.h> /* Features of the Chess Engine Communication Protocol supported by this program */ const char *cecp_features[] = { "done=0", "usermove=1", "time=0", "draw=0", "sigint=0", "analyze=0", "variants=\"\"", "name=0", "nps=0", "debug=1", "smp=1", "done=1", 0 }; #endif
#ifndef _CECP_FEATURES_H #define _CECP_FEATURES_H #include <stdio.h> /* Features of the Chess Engine Communication Protocol supported by this program */ const char *cecp_features[] = { "done=0", "usermove=1", "time=0", "draw=0", "sigint=0", "analyze=0", "variants=\"normal\"", "colors=0", "name=0", "nps=0", "debug=1", "smp=1", "done=1", 0 }; #endif
Support variant 'normal' and don't expect xboard to send colors
Support variant 'normal' and don't expect xboard to send colors
C
mit
gustafullberg/drosophila,gustafullberg/drosophila,gustafullberg/drosophila
d4df4c06fc37543ddb37d47e70fa7a3fd7544212
include/tesseract/platform.h
include/tesseract/platform.h
/////////////////////////////////////////////////////////////////////// // File: platform.h // Description: Place holder // // (C) Copyright 2006, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /////////////////////////////////////////////////////////////////////// #ifndef TESSERACT_PLATFORM_H_ #define TESSERACT_PLATFORM_H_ #ifndef TESS_API # if defined(_WIN32) || defined(__CYGWIN__) # if defined(TESS_EXPORTS) # define TESS_API __declspec(dllexport) # elif defined(TESS_IMPORTS) # define TESS_API __declspec(dllimport) # else # define TESS_API # endif # else # if defined(TESS_EXPORTS) || defined(TESS_IMPORTS) # define TESS_API __attribute__((visibility("default"))) # endif # endif #endif #endif // TESSERACT_PLATFORM_H_
/////////////////////////////////////////////////////////////////////// // File: platform.h // Description: Place holder // // (C) Copyright 2006, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /////////////////////////////////////////////////////////////////////// #ifndef TESSERACT_PLATFORM_H_ #define TESSERACT_PLATFORM_H_ #ifndef TESS_API # if defined(_WIN32) || defined(__CYGWIN__) # if defined(TESS_EXPORTS) # define TESS_API __declspec(dllexport) # elif defined(TESS_IMPORTS) # define TESS_API __declspec(dllimport) # else # define TESS_API # endif # else # if defined(TESS_EXPORTS) || defined(TESS_IMPORTS) # define TESS_API __attribute__((visibility("default"))) # else # define TESS_API # endif # endif #endif #endif // TESSERACT_PLATFORM_H_
Add missing definition for TESS_API
Add missing definition for TESS_API Signed-off-by: Stefan Weil <[email protected]>
C
apache-2.0
stweil/tesseract,amitdo/tesseract,UB-Mannheim/tesseract,stweil/tesseract,tesseract-ocr/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,amitdo/tesseract,tesseract-ocr/tesseract,amitdo/tesseract,amitdo/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,stweil/tesseract,amitdo/tesseract,stweil/tesseract,UB-Mannheim/tesseract,UB-Mannheim/tesseract,stweil/tesseract,tesseract-ocr/tesseract
fecda7a99c7dc2d44e2652a9158dfa86b997afab
test/ASTMerge/codegen-body.c
test/ASTMerge/codegen-body.c
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/body1.c // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/body2.c // RUN: %clang_cc1 -emit-obj -o /dev/null -ast-merge %t.1.ast -ast-merge %t.2.ast %s // expected-no-diagnostics
// XFAIL: hexagon // RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/body1.c // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/body2.c // RUN: %clang_cc1 -emit-obj -o /dev/null -ast-merge %t.1.ast -ast-merge %t.2.ast %s // expected-no-diagnostics
Revert "[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations."
Revert "[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations." This reverts commit r238754. It depends on r238748, which was reverted. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@238773 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
915afec8f2eb56ad3fb89cedf8b6b6dda363164a
ui/app_list/app_list_export.h
ui/app_list/app_list_export.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_APP_LIST_APP_LIST_EXPORT_H_ #define UI_APP_LIST_APP_LIST_EXPORT_H_ #pragma once // Defines APP_LIST_EXPORT so that functionality implemented by the app_list // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __declspec(dllexport) #else #define APP_LIST_EXPORT __declspec(dllimport) #endif // defined(APP_LIST_IMPLEMENTATION) #else // defined(WIN32) #define APP_LIST_EXPORT __attribute__((visibility("default"))) #endif #else // defined(COMPONENT_BUILD) #define APP_LIST_EXPORT #endif #endif // UI_APP_LIST_APP_LIST_EXPORT_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_APP_LIST_APP_LIST_EXPORT_H_ #define UI_APP_LIST_APP_LIST_EXPORT_H_ #pragma once // Defines APP_LIST_EXPORT so that functionality implemented by the app_list // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __declspec(dllexport) #else #define APP_LIST_EXPORT __declspec(dllimport) #endif // defined(APP_LIST_IMPLEMENTATION) #else // defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __attribute__((visibility("default"))) #else #define APP_LIST_EXPORT #endif #endif #else // defined(COMPONENT_BUILD) #define APP_LIST_EXPORT #endif #endif // UI_APP_LIST_APP_LIST_EXPORT_H_
Change the way _EXPORT macros look, app_list edition
Change the way _EXPORT macros look, app_list edition I missed this in https://chromiumcodereview.appspot.com/10386108/ . Thanks to tfarina for noticing. BUG=90078 TEST=none TBR=ben Review URL: https://chromiumcodereview.appspot.com/10377151 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@137221 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
mogoweb/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,anirudhSK/chromium,Chilledheart/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,keishi/chromium,axinging/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,M4sse/chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,keishi/chromium,Just-D/chromium-1,zcbenz/cefode-chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,ChromiumWebApps/chromium,dednal/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,ChromiumWebApps/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,ltilve/chromium,zcbenz/cefode-chromium,dednal/chromium.src,Fireblend/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,keishi/chromium,ltilve/chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,dushu1203/chromium.src,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,patrickm/chromium.src,keishi/chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,anirudhSK/chromium,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,keishi/chromium,littlstar/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,Jonekee/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,littlstar/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,M4sse/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,keishi/chromium,dednal/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,littlstar/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,M4sse/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,jaruba/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,dednal/chromium.src,hujiajie/pa-chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,keishi/chromium,krieger-od/nwjs_chromium.src,jaruba/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,littlstar/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,hgl888/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,ltilve/chromium,dushu1203/chromium.src,littlstar/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,keishi/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,dednal/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,dednal/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,ltilve/chromium,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,patrickm/chromium.src,M4sse/chromium.src,Just-D/chromium-1,hujiajie/pa-chromium,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,patrickm/chromium.src,zcbenz/cefode-chromium,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,ChromiumWebApps/chromium,Chilledheart/chromium,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,anirudhSK/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,keishi/chromium,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,patrickm/chromium.src,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,Just-D/chromium-1,littlstar/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,hgl888/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,ondra-novak/chromium.src,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,Just-D/chromium-1,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk
015f3526ea6d0b24900b72ad01c1abd730555136
tests/mypaint-test-surface.h
tests/mypaint-test-surface.h
#ifndef MYPAINTTESTSURFACE_H #define MYPAINTTESTSURFACE_H #include <mypaint-surface.h> typedef MyPaintSurface * (*MyPaintTestsSurfaceFactory)(gpointer user_data); int mypaint_test_surface_run(int argc, char **argv, MyPaintTestsSurfaceFactory surface_factory, gchar *title, gpointer user_data); #endif // MYPAINTTESTSURFACE_H
#ifndef MYPAINTTESTSURFACE_H #define MYPAINTTESTSURFACE_H #include <mypaint-surface.h> #include <mypaint-glib-compat.h> G_BEGIN_DECLS typedef MyPaintSurface * (*MyPaintTestsSurfaceFactory)(gpointer user_data); int mypaint_test_surface_run(int argc, char **argv, MyPaintTestsSurfaceFactory surface_factory, gchar *title, gpointer user_data); G_END_DECLS #endif // MYPAINTTESTSURFACE_H
Add missing extern "C" declaration to header
brushlib/test: Add missing extern "C" declaration to header
C
isc
b3sigma/libmypaint,achadwick/libmypaint,b3sigma/libmypaint,achadwick/libmypaint,b3sigma/libmypaint,achadwick/libmypaint,achadwick/libmypaint
25355d2169bb43eb07b9a60a2f9e4c0436cf906a
vm/external_libs/libtommath/bn_mp_exch.c
vm/external_libs/libtommath/bn_mp_exch.c
#include <tommath.h> #ifdef BN_MP_EXCH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, [email protected], http://libtom.org */ /* swap the elements of two integers, for cases where you can't simply swap the * mp_int pointers around */ void mp_exch MPA(mp_int * a, mp_int * b) { mp_int t; if(MANAGED(a) || MANAGED(b)) { mp_init_copy(MPST, &t, a); mp_copy(MPST, a, b); mp_copy(MPST, b, &t); mp_clear(&t); return; } t = *a; *a = *b; *b = t; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
#include <tommath.h> #ifdef BN_MP_EXCH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, [email protected], http://libtom.org */ /* swap the elements of two integers, for cases where you can't simply swap the * mp_int pointers around */ void mp_exch MPA(mp_int * a, mp_int * b) { mp_int t; if(MANAGED(a) || MANAGED(b)) { mp_init(&t); // copy a to t mp_copy(MPST, a, &t); // copy b to a mp_copy(MPST, b, a); // copy t to b mp_copy(MPST, &t, b); mp_clear(&t); return; } t = *a; *a = *b; *b = t; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
Fix argument order in mp_exch
Fix argument order in mp_exch
C
bsd-3-clause
heftig/rubinius,Wirachmat/rubinius,dblock/rubinius,Azizou/rubinius,heftig/rubinius,Azizou/rubinius,ruipserra/rubinius,travis-repos/rubinius,jemc/rubinius,slawosz/rubinius,Wirachmat/rubinius,slawosz/rubinius,dblock/rubinius,pH14/rubinius,ngpestelos/rubinius,travis-repos/rubinius,benlovell/rubinius,lgierth/rubinius,pH14/rubinius,ngpestelos/rubinius,dblock/rubinius,Wirachmat/rubinius,travis-repos/rubinius,kachick/rubinius,jsyeo/rubinius,digitalextremist/rubinius,heftig/rubinius,sferik/rubinius,heftig/rubinius,slawosz/rubinius,sferik/rubinius,jemc/rubinius,ruipserra/rubinius,sferik/rubinius,jsyeo/rubinius,jemc/rubinius,lgierth/rubinius,digitalextremist/rubinius,jemc/rubinius,slawosz/rubinius,kachick/rubinius,lgierth/rubinius,jsyeo/rubinius,ngpestelos/rubinius,ngpestelos/rubinius,ruipserra/rubinius,ruipserra/rubinius,digitalextremist/rubinius,kachick/rubinius,ngpestelos/rubinius,pH14/rubinius,ruipserra/rubinius,kachick/rubinius,benlovell/rubinius,digitalextremist/rubinius,sferik/rubinius,lgierth/rubinius,lgierth/rubinius,travis-repos/rubinius,jsyeo/rubinius,Azizou/rubinius,jemc/rubinius,Azizou/rubinius,pH14/rubinius,benlovell/rubinius,kachick/rubinius,benlovell/rubinius,Wirachmat/rubinius,travis-repos/rubinius,mlarraz/rubinius,Wirachmat/rubinius,pH14/rubinius,Azizou/rubinius,slawosz/rubinius,mlarraz/rubinius,dblock/rubinius,ruipserra/rubinius,jemc/rubinius,digitalextremist/rubinius,kachick/rubinius,pH14/rubinius,Wirachmat/rubinius,benlovell/rubinius,mlarraz/rubinius,slawosz/rubinius,heftig/rubinius,sferik/rubinius,heftig/rubinius,benlovell/rubinius,lgierth/rubinius,jsyeo/rubinius,dblock/rubinius,jsyeo/rubinius,kachick/rubinius,travis-repos/rubinius,ngpestelos/rubinius,sferik/rubinius,mlarraz/rubinius,lgierth/rubinius,ruipserra/rubinius,benlovell/rubinius,Azizou/rubinius,digitalextremist/rubinius,ngpestelos/rubinius,slawosz/rubinius,digitalextremist/rubinius,dblock/rubinius,mlarraz/rubinius,jsyeo/rubinius,kachick/rubinius,heftig/rubinius,jemc/rubinius,pH14/rubinius,travis-repos/rubinius,mlarraz/rubinius,dblock/rubinius,sferik/rubinius,Azizou/rubinius,mlarraz/rubinius,Wirachmat/rubinius
ddfc46de06300cd223ccd6503ff97a29af474303
src/driver_control/dc_dump.c
src/driver_control/dc_dump.c
void dc_dump() { if (vexRT[Btn7U]) dump_set(-127); else if (vexRT[Btn7D]) dump_set(127); else dump_set(0); }
void dc_dump() { if (vexRT[Btn6U]) dump_set(-127); else if (vexRT[Btn6D]) dump_set(127); else if (vexRT[Btn5U]) dump_set(-15); else dump_set(0); }
Change dump buttons and add hold button
Change dump buttons and add hold button
C
mit
qsctr/vex-4194b-2016
d45a05e3563085b8131f3a84c4f3b16c3fab7908
kernel/port/heap.c
kernel/port/heap.c
#include <stddef.h> #include <kernel/port/heap.h> #include <kernel/port/units.h> #include <kernel/port/stdio.h> #include <kernel/port/panic.h> /* round_up returns `n` rounded to the next value that is zero * modulo `align`. */ static uintptr_t round_up(uintptr_t n, uintptr_t align) { if (n % align) { return n + (align - (n % align)); } return n; } uintptr_t heap_next, heap_end; void heap_init(uintptr_t start, uintptr_t end) { heap_next = start; heap_end = end; } void *kalloc_align(uintptr_t size, uintptr_t alignment) { heap_next = round_up(heap_next, alignment); uintptr_t ret = heap_next; heap_next += size; if(heap_next > heap_end) { panic("Out of space!"); } return (void*)ret; } void *kalloc(uintptr_t size) { return kalloc_align(size, sizeof(uintptr_t)); } void kfree(void *ptr, uintptr_t size) { }
#include <stddef.h> #include <kernel/port/heap.h> #include <kernel/port/units.h> #include <kernel/port/stdio.h> #include <kernel/port/panic.h> #include <kernel/arch/lock.h> static mutex_t heap_lock; /* round_up returns `n` rounded to the next value that is zero * modulo `align`. */ static uintptr_t round_up(uintptr_t n, uintptr_t align) { if (n % align) { return n + (align - (n % align)); } return n; } uintptr_t heap_next, heap_end; void heap_init(uintptr_t start, uintptr_t end) { heap_next = start; heap_end = end; } void *kalloc_align(uintptr_t size, uintptr_t alignment) { wait_acquire(&heap_lock); heap_next = round_up(heap_next, alignment); uintptr_t ret = heap_next; heap_next += size; if(heap_next > heap_end) { panic("Out of space!"); } release(&heap_lock); return (void*)ret; } void *kalloc(uintptr_t size) { return kalloc_align(size, sizeof(uintptr_t)); } void kfree(void *ptr, uintptr_t size) { }
Put a lock around kalloc*
Put a lock around kalloc*
C
isc
zenhack/zero,zenhack/zero,zenhack/zero
295b1a050560f0384463c79a09cec83970e9c2d1
peertalk/PTPrivate.h
peertalk/PTPrivate.h
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8)) #define PT_DISPATCH_RETAIN_RELEASE 1 #endif #if !defined(PT_DISPATCH_RETAIN_RELEASE) #define PT_PRECISE_LIFETIME #define PT_PRECISE_LIFETIME_UNUSED #else #define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) #define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused)) #endif
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8)) #define PT_DISPATCH_RETAIN_RELEASE 1 #endif #if (!defined(PT_DISPATCH_RETAIN_RELEASE)) #define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) #define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused)) #else #define PT_PRECISE_LIFETIME #define PT_PRECISE_LIFETIME_UNUSED #endif
Fix header defines based on ARC version
Fix header defines based on ARC version
C
mit
rsms/peertalk,rsms/peertalk,rsms/peertalk
3c065012a278ce325f7f2f64abdb6fa2b78eae41
src/tests/util/bitmap_test.c
src/tests/util/bitmap_test.c
/** * @file * * @date Oct 21, 2013 * @author Eldar Abusalimov */ #include <embox/test.h> #include <util/bitmap.h> EMBOX_TEST_SUITE("util/bitmap test"); #define TEST_BITMAP_SZ 100 TEST_CASE() { BITMAP_DECL(bitmap, TEST_BITMAP_SZ); bitmap_clear_all(bitmap, TEST_BITMAP_SZ); test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), TEST_BITMAP_SZ /* not found */ ); for (int i = TEST_BITMAP_SZ-1; i >= 0; --i) { bitmap_set_bit(bitmap, i); test_assert_not_zero(bitmap_test_bit(bitmap, i)); test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), i); } }
/** * @file * * @date Oct 21, 2013 * @author Eldar Abusalimov */ #include <embox/test.h> #include <string.h> #include <util/bitmap.h> EMBOX_TEST_SUITE("util/bitmap test"); #define TEST_ALINGED_SZ 64 #define TEST_UNALINGED_SZ 100 TEST_CASE("aligned size with red zone after an array") { BITMAP_DECL(bitmap, TEST_ALINGED_SZ + 1); memset(bitmap, 0xAA, sizeof(bitmap)); bitmap_clear_all(bitmap, TEST_ALINGED_SZ); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_ALINGED_SZ), TEST_ALINGED_SZ /* not found */ ); } TEST_CASE("unaligned size") { BITMAP_DECL(bitmap, TEST_UNALINGED_SZ); bitmap_clear_all(bitmap, TEST_UNALINGED_SZ); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), TEST_UNALINGED_SZ /* not found */ ); for (int i = TEST_UNALINGED_SZ-1; i >= 0; --i) { bitmap_set_bit(bitmap, i); test_assert_not_zero(bitmap_test_bit(bitmap, i)); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), i); } }
Add bitmap test case which reveals a bug
Add bitmap test case which reveals a bug
C
bsd-2-clause
mike2390/embox,abusalimov/embox,vrxfile/embox-trik,mike2390/embox,Kefir0192/embox,Kefir0192/embox,embox/embox,gzoom13/embox,gzoom13/embox,abusalimov/embox,gzoom13/embox,embox/embox,gzoom13/embox,vrxfile/embox-trik,Kefir0192/embox,abusalimov/embox,Kefir0192/embox,mike2390/embox,gzoom13/embox,vrxfile/embox-trik,Kakadu/embox,vrxfile/embox-trik,vrxfile/embox-trik,Kakadu/embox,gzoom13/embox,Kefir0192/embox,mike2390/embox,embox/embox,Kakadu/embox,mike2390/embox,Kakadu/embox,embox/embox,vrxfile/embox-trik,Kakadu/embox,embox/embox,abusalimov/embox,vrxfile/embox-trik,Kakadu/embox,Kefir0192/embox,mike2390/embox,abusalimov/embox,mike2390/embox,gzoom13/embox,Kakadu/embox,Kefir0192/embox,abusalimov/embox,embox/embox
35793f330181dae066b999c56ef117763c1df13c
test/Headers/altivec-header.c
test/Headers/altivec-header.c
// REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -S -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s #include <altivec.h> // Verify that simply including <altivec.h> does not generate any code // (i.e. all inline routines in the header are marked "static") // CHECK: .text // CHECK-NEXT: .file // CHECK-NEXT: {{^$}} // CHECK-NEXT: .ident{{.*$}} // CHECK-NEXT: .section ".note.GNU-stack","",@progbits // CHECK-NOT: .
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -fno-lax-vector-conversions -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -x c++ -o - %s | FileCheck %s #include <altivec.h> // Verify that simply including <altivec.h> does not generate any code // (i.e. all inline routines in the header are marked "static") // CHECK: target triple = "powerpc64- // CHECK-NEXT: {{^$}} // CHECK-NEXT: llvm.ident
Make this test not rely on a backend being registered.
Make this test not rely on a backend being registered. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@233993 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
06658dd37b8a6ffcb05603e57720831422785e8b
Library/BigFix/Error.h
Library/BigFix/Error.h
#ifndef BigFix_Error_h #define BigFix_Error_h #include <exception> #include <stddef.h> namespace BigFix { class Error : public std::exception { public: template <size_t n> explicit Error( const char ( &literal )[n] ) : m_what( literal ) { } virtual const char* what() const throw(); private: const char* m_what; }; } #endif
#ifndef BigFix_Error_h #define BigFix_Error_h #include <exception> #include <stddef.h> namespace BigFix { class Error : public std::exception { public: template <size_t n> explicit Error( const char ( &literal )[n] ) throw() : m_what( literal ) { } virtual const char* what() const throw(); private: const char* m_what; }; } #endif
Add throw() declaration to avoid dead code coverage
Add throw() declaration to avoid dead code coverage
C
apache-2.0
bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive
307d2ff539a432eb2fb022aee0bcced73eb34773
src/rh_nrf24.c
src/rh_nrf24.c
/* * This file is part of the KNOT Project * * Copyright (c) 2015, CESAR. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the CESAR nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL CESAR 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 <errno.h> #include <stdio.h> #include "node.h" static int nrf24_probe(void) { return -ENOSYS; } static void nrf24_remove(void) { } static int nrf24_listen(void) { return -ENOSYS; } static int nrf24_accept(int srv_sockfd) { return -ENOSYS; } static ssize_t nrf24_recv(int sockfd, void *buffer, size_t len) { return -ENOSYS; } static ssize_t nrf24_send(int sockfd, const void *buffer, size_t len) { return -ENOSYS; } static struct node_ops nrf24_ops = { .name = "Radio Head: nRF24", .probe = nrf24_probe, .remove = nrf24_remove, .listen = nrf24_listen, .accept = nrf24_accept, .recv = nrf24_recv, .send = nrf24_send }; /* * The following functions MAY be implemented as plugins * initialization functions, avoiding function calls such * as manager@manager_start()->node@node_init()-> * manager@node_ops_register()->node@node_probe() */ int node_init(void) { return node_ops_register(&nrf24_ops); } void node_exit(void) { }
Add RadioHead nRF24 node 'driver' skeleton
gw: Add RadioHead nRF24 node 'driver' skeleton This patch adds a 'driver' to manage nRF24 radio supported by Radio Head library.
C
lgpl-2.1
CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source
72e1682bbdfd497ce838d648bb2cb6047c015f6f
test/Analysis/array-struct.c
test/Analysis/array-struct.c
// RUN: clang -checker-simple -verify %s struct s {}; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; }
// RUN: clang -checker-simple -verify %s struct s { int data; int data_array[10]; }; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; d.data_array[9] = 17; }
Add random array and struct test code for SCA.
Add random array and struct test code for SCA. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58085 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang
9440f74bb456fb8a82a92bb662a00e1ecdb1b14f
3RVX/OSD/BrightnessOSD.h
3RVX/OSD/BrightnessOSD.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include "OSD.h" class BrightnessOSD : public OSD { public: BrightnessOSD(); virtual void Hide(); virtual void ProcessHotkeys(HotkeyInfo &hki); private: MeterWnd _mWnd; virtual void OnDisplayChange(); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include "OSD.h" class BrightnessOSD : public OSD { public: BrightnessOSD(); virtual void Hide(); virtual void ProcessHotkeys(HotkeyInfo &hki); private: MeterWnd _mWnd; BrightnessController *_brightnessCtrl; virtual void OnDisplayChange(); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); };
Add member variable for brightness controller
Add member variable for brightness controller
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
6fbd382a761029a0d9549dd0e68485afd294f732
test/CodeGen/vector-scalar.c
test/CodeGen/vector-scalar.c
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s // PR27085 typedef unsigned char uchar4 __attribute__ ((vector_size (4))); // CHECK: @add2 // CHECK: add <4 x i8> {{.*}}, <i8 2, i8 2, i8 2, i8 2> uchar4 add2(uchar4 v) { return v + 2; } // CHECK: @sub2 // CHECK: sub <4 x i8> {{.*}}, <i8 2, i8 2, i8 2, i8 2> uchar4 sub2(uchar4 v) { return v - 2; } // CHECK: @mul2 // CHECK: mul <4 x i8> {{.*}}, <i8 2, i8 2, i8 2, i8 2> uchar4 mul2(uchar4 v) { return v * 2; } // CHECK: @div2 // CHECK: udiv <4 x i8> {{.*}}, <i8 2, i8 2, i8 2, i8 2> uchar4 div2(uchar4 v) { return v / 2; } typedef __attribute__(( ext_vector_type(4) )) unsigned char uchar4_ext; // CHECK: @div3_ext // CHECK: udiv <4 x i8> %{{.*}}, <i8 3, i8 3, i8 3, i8 3> uchar4_ext div3_ext(uchar4_ext v) { return v / 3; }
Add vector add/sub/mul/div by scalar tests (PR27085)
Add vector add/sub/mul/div by scalar tests (PR27085) Ensure the scalar is correctly splatted to all lanes git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@324818 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
f52cef415e8125d92615a90b2b93497fda5de9c6
GITRepo+Protected.h
GITRepo+Protected.h
// // GITRepo+Protected.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // @interface GITRepo () - (NSString*)objectPathFromHash:(NSString*)hash; - (NSData*)dataWithContentsOfHash:(NSString*)hash; - (void)extractFromData:(NSData*)data type:(NSString**)theType size:(NSUInteger*)theSize andData:(NSData**)theData; #pragma mark - #pragma mark Object instanciation methods - (id <GITObject>)objectWithHash:(NSString*)hash; - (GITCommit*)commitWithHash:(NSString*)hash; - (GITTag*)tagWithHash:(NSString*)hash; - (GITTree*)treeWithHash:(NSString*)hash; - (GITBlob*)blobWithHash:(NSString*)hash; @end
// // GITRepo+Protected.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // @protocol GITObject; @interface GITRepo () - (NSString*)objectPathFromHash:(NSString*)hash; - (NSData*)dataWithContentsOfHash:(NSString*)hash; - (void)extractFromData:(NSData*)data type:(NSString**)theType size:(NSUInteger*)theSize andData:(NSData**)theData; #pragma mark - #pragma mark Object instanciation methods - (id <GITObject>)objectWithHash:(NSString*)hash; - (GITCommit*)commitWithHash:(NSString*)hash; - (GITTag*)tagWithHash:(NSString*)hash; - (GITTree*)treeWithHash:(NSString*)hash; - (GITBlob*)blobWithHash:(NSString*)hash; @end
Add missing @protocol forward declaration
Add missing @protocol forward declaration
C
mit
schacon/cocoagit,geoffgarside/cocoagit,schacon/cocoagit,geoffgarside/cocoagit
d4cd3990499d349f671b5dcd6b2b8dd2e6a47f39
meta-extractor/include/CSVWriter.h
meta-extractor/include/CSVWriter.h
#ifndef _CSVWRITER_H_ #define _CSVWRITER_H_ #include <string> #include <istream> #include <stdexcept> namespace CSV { class Writer { public: static const char CSV_SEP = '|'; Writer(std::ostream& output); Writer operator<< (const std::string& data); Writer next(); private: std::ostream& output; bool isFirstValue; std::string clean(const std::string&); }; } #endif
#ifndef _CSVWRITER_H_ #define _CSVWRITER_H_ #include <string> #include <istream> #include <stdexcept> namespace CSV { class Writer { public: static const char CSV_SEP = ','; /** * Construct a CSV::Writer that uses ',' as value separator. */ Writer(std::ostream& output); /** * Write the given value to the csv file */ Writer operator<< (const std::string& data); /** * Advance to the next line */ Writer next(); protected: /** * Clean up (escape) the given value to be used in this object. * Note: This is called internally in operator<<(const std::string&) */ std::string clean(const std::string& data); private: std::ostream& output; bool isFirstValue; }; } #endif
Improve and document CSV::Writer interface
Improve and document CSV::Writer interface ',' is now the default value separator as in "comma-separated values".
C
mit
klemens/ALI-CC,klemens/ALI-CC,klemens/ALI-CC
87b1da17fccaee017c8920dc6da9892ff91e50f3
planb/PBManifest.h
planb/PBManifest.h
/* Copyright 2018 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ @import Foundation; /// PBManifest handles downloading and parsing a list of packages to fetch and install. @interface PBManifest : NSObject - (instancetype)init NS_UNAVAILABLE; /// Designated initializer. - (instancetype)initWithURL:(NSURL *)manifestURL NS_DESIGNATED_INITIALIZER; /// Download and parse the manifest. - (void)downloadManifest; /// Return list of packages in the manifest for the given track. - (NSArray *)packagesForTrack:(NSString *)track; /// The NSURLSession to use for downloading packages. If not set, a default one will be used. @property NSURLSession *session; /// The number of seconds to allow downloading before timing out. Defaults to 300 (5 minutes). @property NSUInteger downloadTimeoutSeconds; /// The number of download attempts before giving up. Defaults to 5. @property NSUInteger downloadAttemptsMax; @end
/* Copyright 2018 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ @import Foundation; /// PBManifest handles downloading and parsing a list of packages to fetch and install. @interface PBManifest : NSObject - (instancetype)init NS_UNAVAILABLE; /// Designated initializer. - (instancetype)initWithURL:(NSURL *)manifestURL NS_DESIGNATED_INITIALIZER; /// Download and parse the manifest. - (void)downloadManifest; /// Return list of packages in the manifest for the given track. - (NSArray *)packagesForTrack:(NSString *)track; /// The NSURLSession to use for downloading packages. If not set, a default one will be used. @property NSURLSession *session; /// The number of seconds to allow downloading before timing out. Defaults to 300 (5 minutes). /// TODO(nguyenphillip): use session config's timeoutIntervalForResource to handle timeouts, and /// make session a required argument of initializer for both PBManifest and PBPackageInstaller. @property NSUInteger downloadTimeoutSeconds; /// The number of download attempts before giving up. Defaults to 5. @property NSUInteger downloadAttemptsMax; @end
Add TODO to replace downloadTimeoutSeconds property with session config timeout.
Add TODO to replace downloadTimeoutSeconds property with session config timeout.
C
apache-2.0
google/macops-planb,google/macops-planb
0a46d15de59c4921dff03dc06c348cb4f1526708
starlight.h
starlight.h
#pragma once #ifdef _MSC_VER #define SL_CALL __vectorcall #else #define SL_CALL #endif
#pragma once #include <string> #if 0 int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; } #endif #ifdef _MSC_VER #define SL_CALL __vectorcall #else #define SL_CALL #endif #define COUNT_OF(X) (sizeof(X) / sizeof((X)[0])) #define ZERO_MEM(X, Y) (memset(X, 0, Y));
Add own versions of _countof and ZeroMemory
Add own versions of _countof and ZeroMemory
C
mit
darkedge/starlight,darkedge/starlight,darkedge/starlight
d3fbf13c265f21b644cccd55ba91a831a2c2ffbb
test2/inline/static_var_inlined.c
test2/inline/static_var_inlined.c
// RUN: %ocheck 0 %s // RUN: %check %s __attribute((always_inline)) inline void *f(unsigned size) { static char malloc_buf[16]; // CHECK: warning: mutable static variable in pure-inline function - may differ per file static void *ptr = malloc_buf; // CHECK: warning: mutable static variable in pure-inline function - may differ per file void *ret = ptr; ptr += size; return ret; } main() { char *a = f(2); char *b = f(1); if(a + 2 != b) abort(); return 0; }
Check static locals aren't duplicated when inlined
Check static locals aren't duplicated when inlined
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
3a90bf0bcec4c198eb56c676d562c609a4486c46
SSPSolution/SSPSolution/GameStateHandler.h
SSPSolution/SSPSolution/GameStateHandler.h
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> //#define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef, std::string levelPath = NULL); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> #define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef, std::string levelPath = NULL); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
ADD definition again to start without menu
ADD definition again to start without menu
C
apache-2.0
Chringo/SSP,Chringo/SSP
8b5e2775eb7bda289726419e84546147c57f743e
libavcodec/ppc/types_altivec.h
libavcodec/ppc/types_altivec.h
/* * Copyright (c) 2006 Guillaume Poirier <[email protected]> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*********************************************************************** * Vector types **********************************************************************/ #define vec_u8_t vector unsigned char #define vec_s8_t vector signed char #define vec_u16_t vector unsigned short #define vec_s16_t vector signed short #define vec_u32_t vector unsigned int #define vec_s32_t vector signed int /*********************************************************************** * Null vector **********************************************************************/ #define LOAD_ZERO const vec_u8_t zerov = vec_splat_u8( 0 ) #define zero_u8v (vec_u8_t) zerov #define zero_s8v (vec_s8_t) zerov #define zero_u16v (vec_u16_t) zerov #define zero_s16v (vec_s16_t) zerov #define zero_u32v (vec_u32_t) zerov #define zero_s32v (vec_s32_t) zerov
Add useful Altivec types, taken from with permission from x264 authors
Add useful Altivec types, taken from with permission from x264 authors git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@7125 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
C
lgpl-2.1
prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg
3ecaae4ae125440770b67f73bb12e6cf9b0f49b5
mudlib/mud/home/Algorithm/sys/mathd.c
mudlib/mud/home/Algorithm/sys/mathd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ float rnd() { /* use 30 bits of randomness */ return ldexp((float)random(1 << 30), -30); } float pi() { return atan(1.0) * 4.0; } int dice(int faces, int count) { int sum; while (count) { sum += random(faces) + 1; count--; } return sum; }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ float rnd() { /* use 30 bits of randomness */ return ldexp((float)random(1 << 30), -30); } float bell_rnd(int degree) { float sum; int i; for (i = 0; i < degree; i++) { sum += rnd(); } return sum / (float)degree; } float pi() { return atan(1.0) * 4.0; } int dice(int faces, int count) { int sum; while (count) { sum += random(faces) + 1; count--; } return sum; }
Add bell curve random number generator
Add bell curve random number generator
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
97f8ff3579a49100610873ec6f35c8b6e5d6f527
src/include/pool.h
src/include/pool.h
/* ******************************************************************************************************* * Static pool maintained to avoid runtime mallocs. * It comprises of following pools: * 1. Pool for Arraylist * 2. Pool for Hashmap * 3. Pool for Strings * 4. Pool for Integers * 5. Pool for Bytes ******************************************************************************************************* */ #define AS_MAX_STORE_SIZE 4096 typedef struct bytes_static_pool { as_bytes bytes_pool[AS_MAX_STORE_SIZE]; u_int32_t current_bytes_id; } as_static_pool; #define BYTES_CNT(static_pool) \ (((as_static_pool *)static_pool)->current_bytes_id) #define BYTES_POOL(static_pool) \ ((as_static_pool *)static_pool)->bytes_pool #define GET_BYTES_POOL(map_bytes, static_pool, err) \ if (AS_MAX_STORE_SIZE > BYTES_CNT(static_pool)) { \ map_bytes = &(BYTES_POOL(static_pool)[BYTES_CNT(static_pool)++]); \ } else { \ as_error_update(err, AEROSPIKE_ERR, "Cannot allocate as_bytes"); \ } #define POOL_DESTROY(static_pool) \ for (u_int32_t iter = 0; iter < BYTES_CNT(static_pool); iter++) { \ as_bytes_destroy(&BYTES_POOL(static_pool)[iter]); \ }
/* ******************************************************************************************************* * Static pool maintained to avoid runtime mallocs. * It comprises of following pools: * 1. Pool for Arraylist * 2. Pool for Hashmap * 3. Pool for Strings * 4. Pool for Integers * 5. Pool for Bytes ******************************************************************************************************* */ #define AS_MAX_STORE_SIZE 4096 typedef struct bytes_static_pool { as_bytes bytes_pool[AS_MAX_STORE_SIZE]; uint32_t current_bytes_id; } as_static_pool; #define BYTES_CNT(static_pool) \ (((as_static_pool *)static_pool)->current_bytes_id) #define BYTES_POOL(static_pool) \ ((as_static_pool *)static_pool)->bytes_pool #define GET_BYTES_POOL(map_bytes, static_pool, err) \ if (AS_MAX_STORE_SIZE > BYTES_CNT(static_pool)) { \ map_bytes = &(BYTES_POOL(static_pool)[BYTES_CNT(static_pool)++]); \ } else { \ as_error_update(err, AEROSPIKE_ERR, "Cannot allocate as_bytes"); \ } #define POOL_DESTROY(static_pool) \ for (u_int32_t iter = 0; iter < BYTES_CNT(static_pool); iter++) { \ as_bytes_destroy(&BYTES_POOL(static_pool)[iter]); \ }
Fix build on alpine linux. u_int32_t => uint32_t
Fix build on alpine linux. u_int32_t => uint32_t
C
apache-2.0
aerospike/aerospike-client-python,aerospike/aerospike-client-python,aerospike/aerospike-client-python
36d543a3b56dc7cddb63f5734e13db16066933a4
arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h
arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h
/* linux/arch/arm/plat-s3c64xx/include/mach/regs-gpio-memport.h * * Copyright 2008 Openmoko, Inc. * Copyright 2008 Simtec Electronics * Ben Dooks <[email protected]> * http://armlinux.simtec.co.uk/ * * S3C64XX - GPIO memory port register definitions */ #ifndef __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H #define __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H __FILE__ #define S3C64XX_MEM0CONSTOP S3C64XX_GPIOREG(0x1B0) #define S3C64XX_MEM1CONSTOP S3C64XX_GPIOREG(0x1B4) #define S3C64XX_MEM0CONSLP0 S3C64XX_GPIOREG(0x1C0) #define S3C64XX_MEM0CONSLP1 S3C64XX_GPIOREG(0x1C4) #define S3C64XX_MEM1CONSLP S3C64XX_GPIOREG(0x1C8) #define S3C64XX_MEM0DRVCON S3C64XX_GPIOREG(0x1D0) #define S3C64XX_MEM1DRVCON S3C64XX_GPIOREG(0x1D4) #endif /* __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H */
Add definitions for the GPIO memory port configurations
[ARM] S3C64XX: Add definitions for the GPIO memory port configurations Add defines for the registers that control the GPIO pins that are run the memory interface. Signed-off-by: Ben Dooks <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
2fa1c13c35e1ef5093ca734dae62d89572f06eaf
alura/c/forca.c
alura/c/forca.c
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; do { // comecar o nosso jogo!! } while(!acertou && !enforcou); }
#include <stdio.h> #include <string.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; do { char chute; scanf("%c", &chute); for(int i = 0; i < strlen(palavrasecreta); i++) { if(palavrasecreta[i] == chute) { printf("A posição %d tem essa letra!\n", i); } } } while(!acertou && !enforcou); }
Update files, Alura, Introdução a C - Parte 2, Aula 2.4
Update files, Alura, Introdução a C - Parte 2, Aula 2.4
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
86d5c7ee15199c2dc3300978a5393ca1492f8569
template_3/daemon3.c
template_3/daemon3.c
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <signal.h> #include "daemon.h" void daemon_exit_handler(int sig) { //Here we release resources #ifdef DAEMON_PID_FILE_NAME unlink(DAEMON_PID_FILE_NAME); #endif _exit(EXIT_FAILURE); } void init_signals(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = daemon_exit_handler; if( sigaction(SIGTERM, &sa, NULL) != 0) daemon_error_exit("Can't set daemon_exit_handler: %m\n"); signal(SIGCHLD, SIG_IGN); // ignore child signal(SIGTSTP, SIG_IGN); // ignore tty signals signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGHUP, SIG_IGN); } int main(void) { daemonize(); init_signals(); while(1) { // Here а routine of daemon printf("%s: daemon is run\n", DAEMON_NAME); sleep(10); } return EXIT_SUCCESS; // good job (we interrupted (finished) main loop) }
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <signal.h> #include "daemon.h" void daemon_exit_handler(int sig) { //Here we release resources #ifdef DAEMON_PID_FILE_NAME unlink(DAEMON_PID_FILE_NAME); #endif _exit(EXIT_FAILURE); } void init_signals(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = daemon_exit_handler; if( sigaction(SIGTERM, &sa, NULL) != 0) daemon_error_exit("Can't set daemon_exit_handler: %m\n"); signal(SIGCHLD, SIG_IGN); // ignore child signal(SIGTSTP, SIG_IGN); // ignore tty signals signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGHUP, SIG_IGN); } int main(void) { daemonize(); init_signals(); while(1) { // Here а routine of daemon printf("%s: daemon is run\n", DAEMON_NAME); sleep(10); } return EXIT_SUCCESS; // good job (we interrupted (finished) main loop) }
Fix warning: implicit declaration of function memset
template_3: Fix warning: implicit declaration of function memset
C
bsd-3-clause
KoynovStas/daemon_templates,KoynovStas/daemon_templates
8aa59774ab4655ca1562a86641eed78979dd8359
gfx_utils/matrix_test.c
gfx_utils/matrix_test.c
#include <stdio.h> #include <stdlib.h> #include "matrix.h" int main() { matrix *a = new_matrix(3, 4); int i; for (i = 0; i < a->rows; i++) { int j; for (j = 0; j < a->cols; j++) { a->contents[i][j] = i * a->cols + j; } } print_matrix(a); printf("\n\n"); matrix *b = new_matrix(4, 5); for (i = 0; i < b->rows; i++) { int j; for (j = 0; j < b->cols; j++) { b->contents[i][j] = i * b->cols + j; } } print_matrix(b); printf("\n\n"); matrix *c = cross_product(a, b); print_matrix(c); printf("\n\n"); scalar_multiply(a, 3); print_matrix(a); free_matrix(a); free_matrix(b); free_matrix(c); return 0; }
Add a test file for matrix functions
Add a test file for matrix functions
C
mit
elc1798/stuy-gfx-utils
1330c19065127dc9ed2ceb032568beee047c36fe
include/cpr/multipart.h
include/cpr/multipart.h
#ifndef CPR_MULTIPART_H #define CPR_MULTIPART_H #include <initializer_list> #include <string> #include <vector> #include "defines.h" namespace cpr { struct File { template <typename StringType> File(StringType&& filepath) : filepath{CPR_FWD(filepath)} {} std::string filepath; }; struct Part { Part(const std::string& name, const std::string& value, const std::string& content_type = {}) : name{name}, value{value}, content_type{content_type}, is_file{false} {} Part(const std::string& name, const int& value, const std::string& content_type = {}) : name{name}, value{std::to_string(value)}, content_type{content_type}, is_file{false} { } Part(const std::string& name, const File& file, const std::string& content_type = {}) : name{name}, value{file.filepath}, content_type{content_type}, is_file{true} {} std::string name; std::string value; std::string content_type; bool is_file; }; class Multipart { public: Multipart(const std::initializer_list<Part>& parts); std::vector<Part> parts; }; } // namespace cpr #endif
#ifndef CPR_MULTIPART_H #define CPR_MULTIPART_H #include <initializer_list> #include <string> #include <vector> #include "defines.h" namespace cpr { struct File { template <typename StringType> explicit File(StringType&& filepath) : filepath{CPR_FWD(filepath)} {} std::string filepath; }; struct Part { Part(const std::string& name, const std::string& value, const std::string& content_type = {}) : name{name}, value{value}, content_type{content_type}, is_file{false} {} Part(const std::string& name, const int& value, const std::string& content_type = {}) : name{name}, value{std::to_string(value)}, content_type{content_type}, is_file{false} { } Part(const std::string& name, const File& file, const std::string& content_type = {}) : name{name}, value{file.filepath}, content_type{content_type}, is_file{true} {} std::string name; std::string value; std::string content_type; bool is_file; }; class Multipart { public: Multipart(const std::initializer_list<Part>& parts); std::vector<Part> parts; }; } // namespace cpr #endif
Use explicit constructor for File to resolve template deductions
Use explicit constructor for File to resolve template deductions
C
mit
msuvajac/cpr,msuvajac/cpr,msuvajac/cpr,whoshuu/cpr,whoshuu/cpr,whoshuu/cpr
ceaae28b67ee521c6b0d8c04a7d8f989ff2598bb
src/server_tasks.h
src/server_tasks.h
#include "telit_HE910.h" namespace openxc { namespace server_task { void openxc::server_task::firmwareCheck(TelitDevice* device); void openxc::server_task::flushDataBuffer(TelitDevice* device); void openxc::server_task::commandCheck(TelitDevice* device); } }
#include "telit_he910.h" namespace openxc { namespace server_task { void openxc::server_task::firmwareCheck(TelitDevice* device); void openxc::server_task::flushDataBuffer(TelitDevice* device); void openxc::server_task::commandCheck(TelitDevice* device); } }
Fix case of an include to support crossplatform compilation.
Fix case of an include to support crossplatform compilation.
C
bsd-3-clause
ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware
aa960ff4ec71089b69be81ec1f6d3f86f10c61ee
NHL95DBEditor/src/player_key.c
NHL95DBEditor/src/player_key.c
#include <stdio.h> #include "player_key.h" bool_t key_is_goalie(player_key_t *key) { return key->position == 'G'; } void show_key_player(player_key_t *key, size_t ofs_key) { size_t i; printf("T: %2u NO: %2u POS: %c NAME: %-15s %-15s", key->team, key->jersey, key->position, key->first, key->last); printf(" OFS_KEY: %4x OFS_ATT: %4x OFS_CAR: %4x OFS_SEA: %4x", ofs_key, key->ofs_attributes, key->ofs_career_stats, key->ofs_season_stats); printf(" UNKNOWN: "); for (i = 0; i < sizeof(key->unknown); i++) { printf("%3u ", key->unknown[i]); } }
#include <stdio.h> #include "player_key.h" bool_t key_is_goalie(player_key_t *key) { return key->position == 'G'; } void show_key_player(player_key_t *key, size_t ofs_key) { size_t i; printf("T: %3u NO: %2u POS: %c NAME: %-15s %-15s", key->team, key->jersey, key->position, key->first, key->last); printf(" OFS_KEY: %4x OFS_ATT: %4x OFS_CAR: %4x OFS_SEA: %4x", ofs_key, key->ofs_attributes, key->ofs_career_stats, key->ofs_season_stats); printf(" UNKNOWN: "); for (i = 0; i < sizeof(key->unknown); i++) { printf("%3u ", key->unknown[i]); } }
Align free agents (team index 255) with the rest
Align free agents (team index 255) with the rest
C
mit
peruukki/NHL95DBEditor,peruukki/NHL95DBEditor
cf20ae24a70260c732b62f048bbcadfdee07be99
src/TimingHelpers.h
src/TimingHelpers.h
/* Copyright (C) 2015 George White <[email protected]>, All rights reserved. See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details. */ // ******************* Timing helpers ******************* void startTimer(long &timer) { timer = millis(); } boolean isTimerExpired(long &timer, int expiration) { long current = millis() - timer; return current > expiration; } void clearTimer(long &timer) { timer = 0; }
/* Copyright (C) 2015 George White <[email protected]>, All rights reserved. See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details. */ // ******************* Timing helpers ******************* void startTimer(long &timer) { timer = millis(); } boolean isTimerExpired(long &timer, long expiration) { long current = millis() - timer; return current > expiration; } void clearTimer(long &timer) { timer = 0; }
Fix bug in timer comparison
Fix bug in timer comparison The expiration time was being cast to an int, truncating longer timeouts.
C
mit
stonehippo/sploder,stonehippo/sploder
4545c54ecd4b9cbc13033008c78c403da996f990
CCKit/CCLoadingController.h
CCKit/CCLoadingController.h
// // CCLoadingController.h // CCKit // // Created by Leonardo Lobato on 3/15/13. // Copyright (c) 2013 Cliq Consulting. All rights reserved. // #import <UIKit/UIKit.h> @protocol CCLoadingControllerDelegate; @interface CCLoadingController : NSObject @property (nonatomic, readonly) UIView *loadingView; @property (nonatomic, weak) id<CCLoadingControllerDelegate> delegate; - (void)showLoadingView:(BOOL)show animated:(BOOL)animated; @end @protocol CCLoadingControllerDelegate <NSObject> - (UIView *)parentViewForLoadingController:(CCLoadingController *)controller; @optional; - (UIView *)loadingControllerShouldBeDisplayedBelowView:(CCLoadingController *)controller; - (NSString *)titleForLoadingViewOnLoadingController:(CCLoadingController *)controller; @end
// // CCLoadingController.h // CCKit // // Created by Leonardo Lobato on 3/15/13. // Copyright (c) 2013 Cliq Consulting. All rights reserved. // #import <UIKit/UIKit.h> @protocol CCLoadingControllerDelegate; @interface CCLoadingController : NSObject @property (nonatomic, readonly) UIView *loadingView; #if __has_feature(objc_arc) @property (nonatomic, weak) id<CCLoadingControllerDelegate> delegate; #else @property (nonatomic, assign) id<CCLoadingControllerDelegate> delegate; #endif - (void)showLoadingView:(BOOL)show animated:(BOOL)animated; @end @protocol CCLoadingControllerDelegate <NSObject> - (UIView *)parentViewForLoadingController:(CCLoadingController *)controller; @optional; - (UIView *)loadingControllerShouldBeDisplayedBelowView:(CCLoadingController *)controller; - (NSString *)titleForLoadingViewOnLoadingController:(CCLoadingController *)controller; @end
Fix build for non-arc projects
Fix build for non-arc projects Does **not** add no-arc support. Project will leak.
C
mit
cliq/CCKit
1c7cbfa6649a16fdeb37b489be5f3e63114ecab3
src/clientversion.h
src/clientversion.h
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 8 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 8 #define CLIENT_VERSION_REVISION 1 #define CLIENT_VERSION_BUILD 99 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE false // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
Switch version numbers to 0.8.1.99
Switch version numbers to 0.8.1.99
C
mit
domob1812/crowncoin,Infernoman/crowncoin,Crowndev/crowncoin,dobbscoin/dobbscoin-source,syscoin/syscoin,syscoin/syscoin,Earlz/dobbscoin-source,Infernoman/crowncoin,Earlz/dobbscoin-source,domob1812/crowncoin,Crowndev/crowncoin,Earlz/dobbscoin-source,Infernoman/crowncoin,dobbscoin/dobbscoin-source,syscoin/syscoin,dobbscoin/dobbscoin-source,Earlz/dobbscoin-source,dobbscoin/dobbscoin-source,syscoin/syscoin,Infernoman/crowncoin,syscoin/syscoin,domob1812/crowncoin,Infernoman/crowncoin,domob1812/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,Infernoman/crowncoin,domob1812/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,syscoin/syscoin,syscoin/syscoin,domob1812/crowncoin,syscoin/syscoin,dobbscoin/dobbscoin-source,Earlz/dobbscoin-source,dobbscoin/dobbscoin-source,Earlz/dobbscoin-source
0e1cacf1a4ced899e63d339591c9ed18556e840d
include/ccspec.h
include/ccspec.h
#ifndef CCSPEC_H_ #include "ccspec/expectation_target.h" #include "ccspec/matcher.h" #include "ccspec/matchers.h" #endif // CCSPEC_H_
#ifndef CCSPEC_H_ #define CCSPEC_H_ #include "ccspec/expectation_target.h" #include "ccspec/matcher.h" #include "ccspec/matchers.h" #endif // CCSPEC_H_
Add missing definition for include guard
Add missing definition for include guard
C
mit
michaelachrisco/ccspec,michaelachrisco/ccspec,tempbottle/ccspec,tempbottle/ccspec,tempbottle/ccspec,zhangsu/ccspec,michaelachrisco/ccspec,zhangsu/ccspec,zhangsu/ccspec
06c3836a83cf2a0e4bdedde721f29489f9523e56
src/main.c
src/main.c
// main.c // Main Program for HWP Media Center // // Author : Weipeng He <[email protected]> // Copyright (c) 2014, All rights reserved. #include "utils.h" #include <stdio.h> #include <curl/curl.h> size_t write_data(void *buffer, size_t size, size_t nmemb, void *dstr) { d_string* str = (d_string*) dstr; dstr_ncat(str, buffer, size * nmemb); return nmemb; } int main(int argc, char** argv) { CURL* curl; CURLcode res; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, argv[1]); d_string* content = dstr_alloc(); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, content); res = curl_easy_perform(curl); if (res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } printf("size=%d, cap=%d\n%s", content->size, content->cap, content->str); dstr_free(content); curl_easy_cleanup(curl); } return 0; }
// main.c // Main Program for HWP Media Center // // Author : Weipeng He <[email protected]> // Copyright (c) 2014, All rights reserved. #include "utils.h" #include <stdio.h> #include <curl/curl.h> size_t write_data(void *buffer, size_t size, size_t nmemb, void *dstr) { d_string* str = (d_string*) dstr; dstr_ncat(str, buffer, size * nmemb); return nmemb; } int main(int argc, char** argv) { CURL* curl; CURLcode res; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, argv[1]); curl_easy_setopt(curl, CURLOPT_USERAGENT, "hwp"); d_string* content = dstr_alloc(); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, content); res = curl_easy_perform(curl); if (res != CURLE_OK) { fprintf(stderr, "Failed to connect: %s\n", curl_easy_strerror(res)); } printf("size=%d, cap=%d\n%s", content->size, content->cap, content->str); dstr_free(content); curl_easy_cleanup(curl); } return 0; }
Add User-Agent to prevent from blocked by Douban.fm
Add User-Agent to prevent from blocked by Douban.fm
C
mit
hwp/hmc,hwp/hmc
9573b91c322511fdcd727057dc058ee8c0fdc19c
include/llvm/ModuleProvider.h
include/llvm/ModuleProvider.h
//===-- llvm/ModuleProvider.h - Interface for module providers --*- C++ -*-===// // // This file provides an abstract interface for loading a module from some // place. This interface allows incremental or random access loading of // functions from the file. This is useful for applications like JIT compilers // or interprocedural optimizers that do not need the entire program in memory // at the same time. // //===----------------------------------------------------------------------===// #ifndef MODULEPROVIDER_H #define MODULEPROVIDER_H class Function; class Module; class ModuleProvider { protected: Module *TheModule; ModuleProvider(); public: virtual ~ModuleProvider(); /// getModule - returns the module this provider is encapsulating. /// Module* getModule() { return TheModule; } /// materializeFunction - make sure the given function is fully read. /// virtual void materializeFunction(Function *F) = 0; /// materializeModule - make sure the entire Module has been completely read. /// void materializeModule(); /// releaseModule - no longer delete the Module* when provider is destroyed. /// virtual Module* releaseModule() { // Since we're losing control of this Module, we must hand it back complete materializeModule(); Module *tempM = TheModule; TheModule = 0; return tempM; } }; #endif
//===-- llvm/ModuleProvider.h - Interface for module providers --*- C++ -*-===// // // This file provides an abstract interface for loading a module from some // place. This interface allows incremental or random access loading of // functions from the file. This is useful for applications like JIT compilers // or interprocedural optimizers that do not need the entire program in memory // at the same time. // //===----------------------------------------------------------------------===// #ifndef MODULEPROVIDER_H #define MODULEPROVIDER_H class Function; class Module; class ModuleProvider { protected: Module *TheModule; ModuleProvider(); public: virtual ~ModuleProvider(); /// getModule - returns the module this provider is encapsulating. /// Module* getModule() { return TheModule; } /// materializeFunction - make sure the given function is fully read. /// virtual void materializeFunction(Function *F) = 0; /// materializeModule - make sure the entire Module has been completely read. /// Module* materializeModule(); /// releaseModule - no longer delete the Module* when provider is destroyed. /// virtual Module* releaseModule() { // Since we're losing control of this Module, we must hand it back complete materializeModule(); Module *tempM = TheModule; TheModule = 0; return tempM; } }; #endif
Return the Module being materialized to avoid always calling getModule().
Return the Module being materialized to avoid always calling getModule(). git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@9198 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap
b3180559b6960327f0fd843b6afc6c6cbaa1bf85
source/platform/min/window.h
source/platform/min/window.h
/* Copyright [2013-2018] [Aaron Springstroh, Minimal Graphics Library] 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 __WINDOW__ #define __WINDOW__ #if defined(_WIN32) #include <min/win32_window.h> namespace min { using window = min::win32_window; } #elif __linux__ #include <min/x_window.h> namespace min { using window = min::x_window; } #endif #endif
/* Copyright [2013-2018] [Aaron Springstroh, Minimal Graphics Library] 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 __WINDOW__ #define __WINDOW__ #if defined(_WIN32) #include <min/win32_window.h> namespace min { using window = min::win32_window; } #else #include <min/x_window.h> namespace min { using window = min::x_window; } #endif #endif
Allow other operating systems that use X11 to use it
MGL: Allow other operating systems that use X11 to use it
C
apache-2.0
Aaron-SP/mgl,Aaron-SP/mgl,Aaron-SP/mgl
12405f10d56dd4e0adb3c8e3d464abf1e8e74f00
android/cutils/properties.h
android/cutils/properties.h
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __CUTILS_PROPERTIES_H #define __CUTILS_PROPERTIES_H #include <stdlib.h> #include <string.h> #ifdef __cplusplus extern "C" { #endif #define PROPERTY_KEY_MAX 32 #define PROPERTY_VALUE_MAX 92 /* property_get: returns the length of the value which will never be ** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. ** (the length does not include the terminating zero). ** ** If the property read fails or returns an empty value, the default ** value is used (if nonnull). */ static inline int property_get(const char *key, char *value, const char *default_value) { const char *env; env = getenv(key); if (!env) env = default_value; if (!value || !env) return 0; strncpy(value, env, PROPERTY_VALUE_MAX); return strlen(value); } /* property_set: returns 0 on success, < 0 on failure */ static inline int property_set(const char *key, const char *value) { return setenv(key, value, 0); } #ifdef __cplusplus } #endif #endif
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __CUTILS_PROPERTIES_H #define __CUTILS_PROPERTIES_H #include <stdlib.h> #include <string.h> #ifdef __cplusplus extern "C" { #endif /* property_set: returns 0 on success, < 0 on failure */ static inline int property_set(const char *key, const char *value) { return setenv(key, value, 0); } #ifdef __cplusplus } #endif #endif
Remove not needed property_get function form cutils stubs
android: Remove not needed property_get function form cutils stubs This is no longer used as daemon indicates its presence by connecting socket.
C
lgpl-2.1
pstglia/external-bluetooth-bluez,mapfau/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,mapfau/bluez,silent-snowman/bluez,silent-snowman/bluez,ComputeCycles/bluez,mapfau/bluez,ComputeCycles/bluez,silent-snowman/bluez,pkarasev3/bluez,pkarasev3/bluez,pkarasev3/bluez,ComputeCycles/bluez,mapfau/bluez,pkarasev3/bluez
446d4341bb10ab6ba8da45498c8b7619d39249ca
examples/rot13_service/main.c
examples/rot13_service/main.c
#include "../../libtock/tock.h" #include <stdio.h> #define IPC_DRIVER 0x4c static void rot13_callback(int pid, int len, int arg2, void* ud) { char* buf = (char*)arg2; int length = buf[0]; if (length > len - 1) { length = len - 1; } buf++; for (int i = 0; i < len; ++i) { if (buf[i] >= 'a' && buf[i] <= 'z') { buf[i] = (((buf[i] - 'a') + 13) % 26) + 'a'; } else if (buf[i] >= 'A' && buf[i] <= 'Z') { buf[i] = (((buf[i] - 'A') + 13) % 26) + 'A'; } } command(IPC_DRIVER, pid, 0); } int main() { subscribe(IPC_DRIVER, 0, rot13_callback, 0); while (1) { yield(); } return 0; }
#include <tock.h> #define IPC_DRIVER 0x4c struct rot13_buf { int8_t length; char buf[31]; }; static void rot13_callback(int pid, int len, int buf, void* ud) { struct rot13_buf *rb = (struct rot13_buf*)buf; int length = rb->length; if (length > len - 1) { length = len - 1; } for (int i = 0; i < length; ++i) { if (rb->buf[i] >= 'a' && rb->buf[i] <= 'z') { rb->buf[i] = (((rb->buf[i] - 'a') + 13) % 26) + 'a'; } else if (rb->buf[i] >= 'A' && rb->buf[i] <= 'Z') { rb->buf[i] = (((rb->buf[i] - 'A') + 13) % 26) + 'A'; } } command(IPC_DRIVER, pid, 0); } int main() { subscribe(IPC_DRIVER, 0, rot13_callback, NULL); return 0; }
Enforce IPC data sharing with MPU
Enforce IPC data sharing with MPU Still pretty coarsely written but exposes only the shared buffer from a client when enqueuing the callback to a service.
C
apache-2.0
tock/libtock-c,tock/libtock-c,tock/libtock-c
295b4e944964658c86c810275dadf2c75cbbcf9f
src/all.h
src/all.h
#include <libsccmn.h> #include <openssl/rand.h> #include <sys/mman.h> #define FRAME_SIZE (3*4096) #define MEMPAGE_SIZE (4096) void _logging_init(void); void _frame_init(struct frame * this, uint8_t * data, size_t capacity, struct frame_pool_zone * zone);
#include <libsccmn.h> #include <openssl/rand.h> #include <sys/mman.h> // Frame size should be above 16kb, which is a maximum record size of 16kB for SSLv3/TLSv1 // See https://www.openssl.org/docs/manmaster/ssl/SSL_read.html #define FRAME_SIZE (5*4096) #define MEMPAGE_SIZE (4096) void _logging_init(void); void _frame_init(struct frame * this, uint8_t * data, size_t capacity, struct frame_pool_zone * zone);
Increase the size of the memory pool frame
Increase the size of the memory pool frame
C
bsd-3-clause
TeskaLabs/Frame_Transporter,TeskaLabs/SeaCat-Common-Library,TeskaLabs/Frame-Transporter,TeskaLabs/Frame-Transporter,TeskaLabs/Frame_Transporter
42d8167c3ac24b41e625063140bac8ac4ab31da0
include/scrappie.h
include/scrappie.h
#ifndef SCRAPPIE_H #define SCRAPPIE_H #ifdef __cplusplus extern "C" { #endif #include <immintrin.h> #include <stdbool.h> /* Structure definitions from fast5_interface.h */ typedef struct { double start; float length; float mean, stdv; int pos, state; } event_t; typedef struct { unsigned int n, start, end; event_t * event; } event_table; typedef struct { unsigned int n, start, end; float * raw; } raw_table; /* Matrix definitions from util.h */ typedef struct { unsigned int nr, nrq, nc; union { __m128 * v; float * f; } data; } _Mat; typedef _Mat * scrappie_matrix; scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log); scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log); scrappie_matrix free_scrappie_matrix(scrappie_matrix mat); #ifdef __cplusplus } #endif #endif /* SCRAPPIE_H */
#ifndef SCRAPPIE_H #define SCRAPPIE_H #ifdef __cplusplus extern "C" { #endif #include <immintrin.h> #include <stdbool.h> /* Structure definitions from scrappie_structures.h */ typedef struct { double start; float length; float mean, stdv; int pos, state; } event_t; typedef struct { unsigned int n, start, end; event_t * event; } event_table; typedef struct { unsigned int n, start, end; float * raw; } raw_table; /* Matrix definitions from scrappie_matrix.h */ typedef struct { unsigned int nr, nrq, nc; union { __m128 * v; float * f; } data; } _Mat; typedef _Mat * scrappie_matrix; scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log); scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log); scrappie_matrix free_scrappie_matrix(scrappie_matrix mat); #ifdef __cplusplus } #endif #endif /* SCRAPPIE_H */
Update where various definitions have come from
Update where various definitions have come from
C
mpl-2.0
nanoporetech/scrappie,nanoporetech/scrappie,nanoporetech/scrappie
f470ac421f6695e415da643e03b903a679ea828e
src/config.c
src/config.c
// vim: sw=4 ts=4 et : #include "config.h" // Parser for win_ section conf_t win_conf(char *key) { conf_t rc; rc.ival = 0; (void)key; return rc; } // Prefixes for config sections/subsections with parser pointers struct conf_prefix { char *prefix; conf_t (*parser)(char *); } pr_global[] = { { "win_", win_conf } }; // Entry point to get all config values conf_t conf(char *key) { conf_t rc; for (size_t i = 0; i < sizeof(pr_global); i++) { if (strstr(key, pr_global[i].prefix) == 0) { rc = win_conf(key + strlen(pr_global[i].prefix)); break; } } return rc; }
// vim: sw=4 ts=4 et : #include "config.h" #include "itmmorgue.h" // Parser for win_ section conf_t win_conf(char *key) { conf_t rc; // TODO implement real parser if (key == strstr(key, "area_y")) rc.ival = 3; if (key == strstr(key, "area_x")) rc.ival = 2; if (key == strstr(key, "area_max_y")) rc.ival = 10; if (key == strstr(key, "area_max_x")) rc.ival = 45; if (key == strstr(key, "area_state")) rc.ival = 2; return rc; } // Prefixes for config sections/subsections with parser pointers struct conf_prefix { char *prefix; conf_t (*parser)(char *); } pr_global[] = { { "win_", win_conf } }; // Entry point to get all config values conf_t conf(char *key) { conf_t rc; for (size_t i = 0; i < sizeof(pr_global) / sizeof(struct conf_prefix); i++) { if (key == strstr(key, pr_global[i].prefix)) { rc = win_conf(key + strlen(pr_global[i].prefix)); break; } } return rc; }
Fix the first (sic!) Segmentation fault
Fix the first (sic!) Segmentation fault
C
mit
zhmylove/itmmorgue,zhmylove/itmmorgue,zhmylove/itmmorgue,zhmylove/itmmorgue
9e724bbce19eee4f38256de15397c259000469f9
src/config.h
src/config.h
#ifndef _CONFIG_H #define _CONFIG_H #define ENABLE_FUTILITY_DEPTH 1 // TODO: switch to at least 2 #define ENABLE_HISTORY 1 #define ENABLE_KILLERS 1 #define ENABLE_LMR 1 #define ENABLE_NNUE 0 #define ENABLE_NULL_MOVE_PRUNING 1 #define ENABLE_REVERSE_FUTILITY_DEPTH 0 // TODO: switch to at least 2 #define ENABLE_TT_CUTOFFS 1 #define ENABLE_TT_MOVES 1 #endif
#ifndef _CONFIG_H #define _CONFIG_H #define ENABLE_FUTILITY_DEPTH 1 // TODO: switch to at least 2 #define ENABLE_HISTORY 1 #define ENABLE_KILLERS 1 #define ENABLE_LMR 1 #define ENABLE_NNUE 0 #define ENABLE_NULL_MOVE_PRUNING 1 #define ENABLE_REVERSE_FUTILITY_DEPTH 1 // TODO: switch to at least 2 #define ENABLE_TT_CUTOFFS 1 #define ENABLE_TT_MOVES 1 #endif
Enable reverse futility at depth 1
Enable reverse futility at depth 1
C
bsd-3-clause
jwatzman/nameless-chessbot,jwatzman/nameless-chessbot
855f14a819774f5417417e7a14938036c4115833
src/server.h
src/server.h
#ifndef XAPIAND_INCLUDED_SERVER_H #define XAPIAND_INCLUDED_SERVER_H #include <ev++.h> #include "threadpool.h" #include "database.h" const int XAPIAND_HTTP_PORT_DEFAULT = 8880; const int XAPIAND_BINARY_PORT_DEFAULT = 8890; class XapiandServer : public Task { private: ev::dynamic_loop loop; ev::sig sig; ev::async quit; ev::io http_io; int http_sock; ev::io binary_io; int binary_sock; DatabasePool database_pool; void bind_http(); void bind_binary(); void io_accept_http(ev::io &watcher, int revents); void io_accept_binary(ev::io &watcher, int revents); void signal_cb(ev::sig &signal, int revents); void quit_cb(ev::async &watcher, int revents); public: XapiandServer(int http_sock_, int binary_sock_); ~XapiandServer(); void run(); }; #endif /* XAPIAND_INCLUDED_SERVER_H */
#ifndef XAPIAND_INCLUDED_SERVER_H #define XAPIAND_INCLUDED_SERVER_H #include <ev++.h> #include "threadpool.h" #include "database.h" const int XAPIAND_HTTP_PORT_DEFAULT = 8880; const int XAPIAND_BINARY_PORT_DEFAULT = 8890; class XapiandServer : public Task { private: ev::dynamic_loop dynamic_loop; ev::loop_ref *loop; ev::sig sig; ev::async quit; ev::io http_io; int http_sock; ev::io binary_io; int binary_sock; DatabasePool database_pool; void bind_http(); void bind_binary(); void io_accept_http(ev::io &watcher, int revents); void io_accept_binary(ev::io &watcher, int revents); void signal_cb(ev::sig &signal, int revents); void quit_cb(ev::async &watcher, int revents); public: XapiandServer(int http_sock_, int binary_sock_, ev::loop_ref *loop_=NULL); ~XapiandServer(); void run(); }; #endif /* XAPIAND_INCLUDED_SERVER_H */
Allow passing an event loop to XapianServer
Allow passing an event loop to XapianServer
C
mit
Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand
eb8b1344df4fcf214879fcc5657c880aefd18228
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 90 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 91 #endif
Update Skia milestone to 91
Update Skia milestone to 91 TBR reed Change-Id: Ibfb76e9b08f5b427ff693f023419130107f857ec Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376138 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]>
C
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia
d0c3b3122833dae723639bdf1be8a0e97997c5f3
src/merge_vcf/Paramer.h
src/merge_vcf/Paramer.h
/* * Paramer.h * * Created on: Aug 20, 2015 * Author: fsedlaze */ #ifndef PARAMER_H_ #define PARAMER_H_ #include <string.h> #include <string> #include <vector> #include <stdlib.h> #include <iostream> #include <ctime> class Parameter { private: Parameter() { min_freq=-1; version ="1.0.4"; } ~Parameter() { } static Parameter* m_pInstance; public: std::string version; int max_dist; int max_caller; bool use_type; bool use_strand; bool dynamic_size; int min_length; float min_freq; int min_support; static Parameter* Instance() { if (!m_pInstance) { m_pInstance = new Parameter; } return m_pInstance; } double meassure_time(clock_t begin ,std::string msg){ return 0; clock_t end = clock(); double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; std::cout << msg<<" " << elapsed_secs<<std::endl; return elapsed_secs; } }; #endif /* PARAMER_H_ */
/* * Paramer.h * * Created on: Aug 20, 2015 * Author: fsedlaze */ #ifndef PARAMER_H_ #define PARAMER_H_ #include <string.h> #include <string> #include <vector> #include <stdlib.h> #include <iostream> #include <ctime> class Parameter { private: Parameter() { min_freq=-1; version ="1.0.5"; } ~Parameter() { } static Parameter* m_pInstance; public: std::string version; int max_dist; int max_caller; bool use_type; bool use_strand; bool dynamic_size; int min_length; float min_freq; int min_support; static Parameter* Instance() { if (!m_pInstance) { m_pInstance = new Parameter; } return m_pInstance; } double meassure_time(clock_t begin ,std::string msg){ return 0; clock_t end = clock(); double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; std::cout << msg<<" " << elapsed_secs<<std::endl; return elapsed_secs; } }; #endif /* PARAMER_H_ */
Increment version to clean things up
Increment version to clean things up
C
mit
fritzsedlazeck/SURVIVOR,fritzsedlazeck/SURVIVOR
bc9445a9173ec23196a3fdbfb3cfb5ea4bc1d084
src/library.c
src/library.c
/** * This file is part of the librailcan library. * * Copyright (C) 2015 Reinder Feenstra <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA */ #include "librailcan.h" #include <string.h> int debug_level = LIBRAILCAN_DEBUGLEVEL_DEBUG;//LIBRAILCAN_DEBUGLEVEL_NONE; int librailcan_set_debug_level( int level ) { if( level < LIBRAILCAN_DEBUGLEVEL_NONE || level > LIBRAILCAN_DEBUGLEVEL_DEBUG ) return LIBRAILCAN_STATUS_INVALID_PARAM; debug_level = level; return LIBRAILCAN_STATUS_SUCCESS; }
/** * This file is part of the librailcan library. * * Copyright (C) 2015 Reinder Feenstra <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA */ #include "librailcan.h" #include <string.h> int debug_level = LIBRAILCAN_DEBUGLEVEL_NONE; int librailcan_set_debug_level( int level ) { if( level < LIBRAILCAN_DEBUGLEVEL_NONE || level > LIBRAILCAN_DEBUGLEVEL_DEBUG ) return LIBRAILCAN_STATUS_INVALID_PARAM; debug_level = level; return LIBRAILCAN_STATUS_SUCCESS; }
Set default debug level to none.
Set default debug level to none.
C
lgpl-2.1
reinder/librailcan,reinder/librailcan,reinder/librailcan
328f45d5dcadced32eaeee1ea0a6f05f7cb2a969
wrapper.c
wrapper.c
#include <stdlib.h> #include <string.h> #include <stdint.h> #include "cc.h" static void out_of_memory(void) { /* TODO: deal with out of memory errors */ error("out of memory"); } void * xmalloc(size_t size) { register void *p = malloc(size); if (!p) out_of_memory(); return p; } void * xcalloc(size_t nmemb, size_t size) { register size_t nbytes = nmemb * size; register void *p = xmalloc(nbytes); return memset(p, nbytes, 0); } char * xstrdup(const char *s) { register size_t len = strlen(s); register char *p = xmalloc(len); return memcpy(p, s, len); } void * xrealloc(void *buff, register size_t size) { register void *p = realloc(buff, size); if (!p) out_of_memory(); return p; }
#include <stdlib.h> #include <string.h> #include <stdint.h> #include "cc.h" static void out_of_memory(void) { /* TODO: deal with out of memory errors */ error("out of memory"); } void * xmalloc(size_t size) { register void *p = malloc(size); if (!p) out_of_memory(); return p; } void * xcalloc(size_t nmemb, size_t size) { register size_t nbytes = nmemb * size; register void *p = xmalloc(nbytes); return memset(p, nbytes, 0); } char * xstrdup(const char *s) { register size_t len = strlen(s) + 1; register char *p = xmalloc(len); return memcpy(p, s, len); } void * xrealloc(void *buff, register size_t size) { register void *p = realloc(buff, size); if (!p) out_of_memory(); return p; }
Copy end of string in xstrdup
Copy end of string in xstrdup the size of a string is length of the string + 1 due to the end of string.
C
mit
8l/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc,k0gaMSX/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc
ef8d82cda10d56ecc64ec8342a6430e50a757d24
tests/break.c
tests/break.c
int main(void) { int i = 0; while (1) { if (i == 42) break; i += 1; } return i; }
int main(void) { int i = 0;;; while (1) { if (i == 42) break; i += 1; } return i; }
Test null statements. Just because.
Test null statements. Just because.
C
bsd-3-clause
gasman/bonsai-c,gasman/bonsai-c,gasman/bonsai-c,beni55/bonsai-c,beni55/bonsai-c,beni55/bonsai-c
168c70a9bbe302caf2c5921df959810c8dcea678
core/ClassClosure-inlines.h
core/ClassClosure-inlines.h
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is [Open Source Virtual Machine.]. * * The Initial Developer of the Original Code is * Adobe System Incorporated. * Portions created by the Initial Developer are Copyright (C) 2004-2006 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Adobe AS3 Team * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef __avmplus_ClassClosure_inlines__ #define __avmplus_ClassClosure_inlines__ namespace avmplus { REALLY_INLINE ScriptObject* ClassClosure::prototypePtr() { return prototype; } REALLY_INLINE VTable* ClassClosure::ivtable() const { return vtable->ivtable; } // Called from C++ to alloc a new instance. Generated code calls createInstance directly. REALLY_INLINE ScriptObject* ClassClosure::newInstance() { VTable* ivtable = this->ivtable(); return ivtable->createInstance(this, ivtable); } } #endif /* __avmplus_ClassClosure_inlines__ */
Add a file that should have been added with changeset: 3564:36fb63a6d3b7
Add a file that should have been added with changeset: 3564:36fb63a6d3b7
C
mpl-2.0
pfgenyun/tamarin-redux,pnkfelix/tamarin-redux,pnkfelix/tamarin-redux,pnkfelix/tamarin-redux,pnkfelix/tamarin-redux,pnkfelix/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pnkfelix/tamarin-redux,pfgenyun/tamarin-redux,pnkfelix/tamarin-redux
2c37c9e86e3741421226a464eba36e56ba66823d
Source/GsCachedArea.h
Source/GsCachedArea.h
#pragma once #include <algorithm> #include "Types.h" class CGsCachedArea { public: typedef uint64 DirtyPageHolder; enum { MAX_DIRTYPAGES_SECTIONS = 8, MAX_DIRTYPAGES = sizeof(DirtyPageHolder) * 8 * MAX_DIRTYPAGES_SECTIONS }; CGsCachedArea(); void SetArea(uint32 psm, uint32 bufPtr, uint32 bufWidth, uint32 height); std::pair<uint32, uint32> GetPageRect() const; uint32 GetPageCount() const; uint32 GetSize() const; void Invalidate(uint32, uint32); bool IsPageDirty(uint32) const; void SetPageDirty(uint32); bool HasDirtyPages() const; void ClearDirtyPages(); private: uint32 m_psm = 0; uint32 m_bufPtr = 0; uint32 m_bufWidth = 0; uint32 m_height = 0; DirtyPageHolder m_dirtyPages[MAX_DIRTYPAGES_SECTIONS]; };
#pragma once #include <utility> #include "Types.h" class CGsCachedArea { public: typedef uint64 DirtyPageHolder; enum { MAX_DIRTYPAGES_SECTIONS = 8, MAX_DIRTYPAGES = sizeof(DirtyPageHolder) * 8 * MAX_DIRTYPAGES_SECTIONS }; CGsCachedArea(); void SetArea(uint32 psm, uint32 bufPtr, uint32 bufWidth, uint32 height); std::pair<uint32, uint32> GetPageRect() const; uint32 GetPageCount() const; uint32 GetSize() const; void Invalidate(uint32, uint32); bool IsPageDirty(uint32) const; void SetPageDirty(uint32); bool HasDirtyPages() const; void ClearDirtyPages(); private: uint32 m_psm = 0; uint32 m_bufPtr = 0; uint32 m_bufWidth = 0; uint32 m_height = 0; DirtyPageHolder m_dirtyPages[MAX_DIRTYPAGES_SECTIONS]; };
Use better header for std::pair.
Use better header for std::pair.
C
bsd-2-clause
dragon788/Play-,Alloyed/Play-,LinkofHyrule89/Play-,Flav900/Play-,LinkofHyrule89/Play-,Alloyed/Play-,AbandonedCart/Play-,LinkofHyrule89/Play-,Alloyed/Play-,Flav900/Play-,Alloyed/Play-,AbandonedCart/Play-,Flav900/Play-,Alloyed/Play-,dragon788/Play-,LinkofHyrule89/Play-,Flav900/Play-,AbandonedCart/Play-,AbandonedCart/Play-,dragon788/Play-,dragon788/Play-,dragon788/Play-,AbandonedCart/Play-,LinkofHyrule89/Play-,Flav900/Play-
c30f78e6593470906a3773d21ab2f265f1f95ddc
stingraykit/metaprogramming/TypeCompleteness.h
stingraykit/metaprogramming/TypeCompleteness.h
#ifndef STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H #define STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H // Copyright (c) 2011 - 2017, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <stingraykit/metaprogramming/CompileTimeAssert.h> namespace stingray { template < typename T > struct StaticAssertCompleteType : CompileTimeAssert<sizeof(T)> { typedef T ValueT; }; } #endif
#ifndef STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H #define STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H // Copyright (c) 2011 - 2017, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <stingraykit/metaprogramming/CompileTimeAssert.h> namespace stingray { template < typename T > struct StaticAssertCompleteType : CompileTimeAssert<sizeof(T) == sizeof(T)> { typedef T ValueT; }; } #endif
Fix compile ui.shell, fckng non-standard behaviour
Fix compile ui.shell, fckng non-standard behaviour Revert "metaprogramming: Get rid of excess check in IsComplete" This reverts commit dc328c6712e9d23b3a58f7dd14dbdfa8e5a196db.
C
isc
GSGroup/stingraykit,GSGroup/stingraykit
c521409d4cf6c8edf4900dda36f6ef9b953f8951
include/llvm/Support/Visibility.h
include/llvm/Support/Visibility.h
//===-- llvm/Support/Visibility.h - visibility(hidden) support --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Chris Lattner and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the VISIBILITY_HIDDEN macro, used for marking classes with // the GCC-specific visibility("hidden") attribute. // //===----------------------------------------------------------------------===// #ifndef VISIBILITY_HIDDEN #if __GNUC__ >= 4 #define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden"))) #else #define VISIBILITY_HIDDEN #endif #endif
Add support for hidden visibility
Add support for hidden visibility git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@28968 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap
f3f3e2f854b8be30789538381d47e25f4a8590cc
board/dewatt/board_fw_config.c
board/dewatt/board_fw_config.c
/* Copyright 2021 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. */ #include "base_fw_config.h" #include "board_fw_config.h" bool board_is_convertible(void) { return 1; } bool board_has_kblight(void) { return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET, FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES); } enum board_usb_c1_mux board_get_usb_c1_mux(void) { return USB_C1_MUX_PS8818; }; enum board_usb_a1_retimer board_get_usb_a1_retimer(void) { return USB_A1_RETIMER_PS8811; };
/* Copyright 2021 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. */ #include "base_fw_config.h" #include "board_fw_config.h" bool board_is_convertible(void) { return 1; } bool board_has_kblight(void) { return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET, FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES); } enum board_usb_c1_mux board_get_usb_c1_mux(void) { return USB_C1_MUX_PS8818; }; enum board_usb_a1_retimer board_get_usb_a1_retimer(void) { return USB_A1_RETIMER_UNKNOWN; };
Set Type A1 retimer to unknown
Dewatt: Set Type A1 retimer to unknown Let board_get_usb_a1_retimer always return USB_A1_RETIMER_UNKNOWN for Dewatt doesn't have type A port 1. BUG=none BRANCH=none TEST=EC console won't show "A1: PS8811 retimer not detected!" Signed-off-by: Sue Chen <7d23cdcf270f71747b77aeecc793a9342f6d5c9e@quanta.corp-partner.google.com> Change-Id: I9a7c292ffc739e81fd1e553617f17abd25a67564 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3346760 Reviewed-by: Rob Barnes <[email protected]>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
9ea53efcedf6eac81f8e57f7a5b4304a8dfd62cd
bpf/include/bpf/helpers_sock.h
bpf/include/bpf/helpers_sock.h
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ /* Copyright Authors of Cilium */ #ifndef __BPF_HELPERS_SOCK__ #define __BPF_HELPERS_SOCK__ #include <linux/bpf.h> #include "helpers.h" /* Only used helpers in Cilium go below. */ /* Events for user space */ static int BPF_FUNC_REMAP(sock_event_output, struct bpf_sock_addr *sock, void *map, __u64 index, const void *data, __u32 size) = (void *)BPF_FUNC_perf_event_output; #endif /* __BPF_HELPERS_SOCK__ */
Define helper to send perf events for socket context
bpf: Define helper to send perf events for socket context This is a preparatory commit that defines a helper to send traces via perf event ring buffer with socket context. Signed-off-by: Aditi Ghag <[email protected]>
C
apache-2.0
cilium/cilium,cilium/cilium,cilium/cilium,cilium/cilium,cilium/cilium
1e07dd84bb28426117039625a6c30b8ab638d455
tests/regression/27-inv_invariants/03-out-of-range-not-bot.c
tests/regression/27-inv_invariants/03-out-of-range-not-bot.c
// PARAM: --enable ana.int.def_exc --disable ana.int.interval #include<assert.h> // Some unsigned long constant that is larger than 2^63-1 #define SIZE_MAX 18446744073709551615UL int foo(){ int top; int a = 3; if (top < SIZE_MAX / (8 * sizeof(int))){ // parts of the expression errorneously evaluate to bottom assert(1); } return 0; }
Add test for large unsigned long constants in expressions
Add test for large unsigned long constants in expressions
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
f0898d02f76cbd77206b6ef278b1da9721b7cd3d
unix/sigtables.h
unix/sigtables.h
#ifndef __POSIX_SIGNAL_SIGTABLES_H typedef struct { int signal; char *name; } Signal; typedef struct { int len; int items[]; } SignalVector; extern const Signal signals[]; extern const int nsigs; extern int max_signum; #define SIGOFFSET(SIG) ((SIG) - 1) void InitSignalTables (void); SignalVector* CreateSignalVector (void); void FreeSignalVector( SignalVector *svPtr ); int GetSignalIdFromObj ( Tcl_Interp *interp, Tcl_Obj *nameObj ); #define __POSIX_SIGNAL_SIGTABLES_H #endif /* __POSIX_SIGNAL_SIGTABLES_H */ /* vim: set ts=8 sts=4 sw=4 sts=4 noet: */
#ifndef __POSIX_SIGNAL_SIGTABLES_H typedef struct { int signal; char *name; } Signal; typedef struct { int len; int items[]; } SignalVector; MODULE_SCOPE const Signal signals[]; MODULE_SCOPE const int nsigs; MODULE_SCOPE int max_signum; #define SIGOFFSET(SIG) ((SIG) - 1) void InitSignalTables (void); SignalVector* CreateSignalVector (void); void FreeSignalVector( SignalVector *svPtr ); int GetSignalIdFromObj ( Tcl_Interp *interp, Tcl_Obj *nameObj ); #define __POSIX_SIGNAL_SIGTABLES_H #endif /* __POSIX_SIGNAL_SIGTABLES_H */ /* vim: set ts=8 sts=4 sw=4 sts=4 noet: */
Hide global data symbols related to signal tables
Hide global data symbols related to signal tables 'extern' decls for "signals", "nsigs" and "max_signum" changed to 'MODULE_SCOPE' in unix/sigtables.h to remove it from the symbol table of the generated shared object file.
C
mit
kostix/posix-signal
fde7e007a24aef7bbac5c2522e5eb7adf87f6e62
origin_solution/2.2.1750.c
origin_solution/2.2.1750.c
// Submission #3365787 #include <stdio.h> #define MAXN 8 #define TRUE 1 #define FALSE 0 int len; unsigned char used[MAXN] = { FALSE }; char s[MAXN], generated[MAXN]; void dfs(int depth) { if (depth == len) puts(generated); else { int i; for (i = 0; i < len; ++i) if (!used[i]) { used[i] = TRUE; generated[depth] = s[i]; dfs(depth + 1); used[i] = FALSE; } } } int main() { gets(s); len = strlen(s); dfs(0); return 0; }
// Submission #3365787 #include <stdio.h> #include <string.h> #define MAXN 8 #define TRUE 1 #define FALSE 0 int len; unsigned char used[MAXN] = { FALSE }; char s[MAXN], generated[MAXN]; void dfs(int depth) { if (depth == len) puts(generated); else { int i; for (i = 0; i < len; ++i) if (!used[i]) { used[i] = TRUE; generated[depth] = s[i]; dfs(depth + 1); used[i] = FALSE; } } } int main() { gets(s); len = strlen(s); dfs(0); return 0; }
Fix a warning that causes compile error in G++
Fix a warning that causes compile error in G++
C
mit
magetron/NOIP-openjudge,magetron/NOIP-openjudge,magetron/NOIP-openjudge
f8f155e4a0234874f6828a3e5df7b80bfabd352c
OpenAL32/Include/alThunk.h
OpenAL32/Include/alThunk.h
#ifndef _AL_THUNK_H_ #define _AL_THUNK_H_ #include "config.h" #include "AL/al.h" #include "AL/alc.h" #ifdef __cplusplus extern "C" { #endif #if (SIZEOF_VOIDP > SIZEOF_UINT) void alThunkInit(void); void alThunkExit(void); ALuint alThunkAddEntry(ALvoid * ptr); void alThunkRemoveEntry(ALuint index); ALvoid *alThunkLookupEntry(ALuint index); #define ALTHUNK_INIT() alThunkInit() #define ALTHUNK_EXIT() alThunkExit() #define ALTHUNK_ADDENTRY(p) alThunkAddEntry(p) #define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i) #define ALTHUNK_LOOKUPENTRY(i) alThunkLookupEntry(i) #else #define ALTHUNK_INIT() #define ALTHUNK_EXIT() #define ALTHUNK_ADDENTRY(p) ((ALuint)p) #define ALTHUNK_REMOVEENTRY(i) #define ALTHUNK_LOOKUPENTRY(i) ((ALvoid*)(i)) #endif // (SIZEOF_VOIDP > SIZEOF_INT) #ifdef __cplusplus } #endif #endif //_AL_THUNK_H_
#ifndef _AL_THUNK_H_ #define _AL_THUNK_H_ #include "config.h" #include "AL/al.h" #include "AL/alc.h" #ifdef __cplusplus extern "C" { #endif void alThunkInit(void); void alThunkExit(void); ALuint alThunkAddEntry(ALvoid * ptr); void alThunkRemoveEntry(ALuint index); ALvoid *alThunkLookupEntry(ALuint index); #if (SIZEOF_VOIDP > SIZEOF_UINT) #define ALTHUNK_INIT() alThunkInit() #define ALTHUNK_EXIT() alThunkExit() #define ALTHUNK_ADDENTRY(p) alThunkAddEntry(p) #define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i) #define ALTHUNK_LOOKUPENTRY(i) alThunkLookupEntry(i) #else #define ALTHUNK_INIT() #define ALTHUNK_EXIT() #define ALTHUNK_ADDENTRY(p) ((ALuint)p) #define ALTHUNK_REMOVEENTRY(i) #define ALTHUNK_LOOKUPENTRY(i) ((ALvoid*)(i)) #endif // (SIZEOF_VOIDP > SIZEOF_INT) #ifdef __cplusplus } #endif #endif //_AL_THUNK_H_
Move function declarations outside of the if-block
Move function declarations outside of the if-block
C
lgpl-2.1
irungentoo/openal-soft-tox,mmozeiko/OpenAL-Soft,jims/openal-soft,BeamNG/openal-soft,franklixuefei/openal-soft,franklixuefei/openal-soft,irungentoo/openal-soft-tox,arkana-fts/openal-soft,mmozeiko/OpenAL-Soft,EddieRingle/openal-soft,arkana-fts/openal-soft,jims/openal-soft,soundsrc/openal-soft,Wemersive/openal-soft,BeamNG/openal-soft,rryan/openal-soft,soundsrc/openal-soft,dapetcu21/openal-soft,cambridgehackers/klaatu-openal-soft,cambridgehackers/klaatu-openal-soft,cambridgehackers/klaatu-openal-soft,Wemersive/openal-soft,alexxvk/openal-soft,rryan/openal-soft,EddieRingle/openal-soft,aaronmjacobs/openal-soft,alexxvk/openal-soft,AerialX/openal-soft-android,aaronmjacobs/openal-soft,zorbathut/opengal32
20b4571885e837eb121a5e51529f0159fb41dd84
include/abort.h
include/abort.h
// abort.h // hdpirun // // Utility header to abort the program on an unrecoverable error. Prints the message (printf format) and closes any open resources // // Author: Robbie Duncan // Copyright: Copyright (c) 2016 Robbie Duncan // License: See LICENSE // #import "log.h" #import <stdio.h> #ifndef ABORT_H #define ABORT_H #define __ABORT(message,...) __LOG(__LOG_CRITICAL,message,##__VA_ARGS__);if (__logFile!=stdout){fclose(__logFile);};exit(1); #endif
// abort.h // hdpirun // // Utility header to abort the program on an unrecoverable error. Prints the message (printf format) and closes any open resources // // Author: Robbie Duncan // Copyright: Copyright (c) 2016 Robbie Duncan // License: See LICENSE // #import "log.h" #import <stdio.h> #ifndef ABORT_H #define ABORT_H #define ABORT(message,...) __LOG(__LOG_CRITICAL,message,##__VA_ARGS__);if (__logFile!=stdout){fclose(__logFile);};exit(1); #endif
Remove leading underscores as part of style clean up
Remove leading underscores as part of style clean up
C
mit
robbieduncan/hdpirun,robbieduncan/hdpirun
328541c6344f9c50002dd06fb54a49b942406c70
dotfiles/.vim/template/c/base-main-bench.c
dotfiles/.vim/template/c/base-main-bench.c
#include <stdio.h> #include <time.h> static long n = 10000; int main(int argc, char* argv[]) { long i; clock_t t; t = clock(); for (i = 0; i < n; ++i) { {{_cursor_}} } printf("%ld\n", clock() - t); return 0; }
Add new template for bench on c
Add new template for bench on c
C
mit
kaneshin/dotfiles,kaneshin/dotfiles,kaneshin/dotfiles,kaneshin/dotfiles,kaneshin/dotfiles
19b628dfc60eda4459b65e4b6b7a748932d28929
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k11"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k12"
Update driver version to 5.02.00-k12
[SCSI] qla4xxx: Update driver version to 5.02.00-k12 Signed-off-by: Vikas Chaudhary <[email protected]> Signed-off-by: James Bottomley <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
9c1035bc14a399b6bf5d45a8cce233d0fc340c53
src/file/keydb.h
src/file/keydb.h
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { }, }; static const uint8_t internal_pk_list[][16] = { { }, }; static const uint8_t internal_hc_list[][112] = { { }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { 0 }, }; static const uint8_t internal_pk_list[][16] = { { 0 }, }; static const uint8_t internal_hc_list[][112] = { { 0 }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
C
lgpl-2.1
mwgoldsmith/aacs,mwgoldsmith/aacs
f8f89faeb05c179ebe69871d7e08d3d8ce9f238b
src/mctx-helper.h
src/mctx-helper.h
/* * Copyright 2016 Couchbase, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LCB_MCTX_HELPER_H #define LCB_MCTX_HELPER_H #include <libcouchbase/couchbase.h> namespace lcb { class MultiCmdContext : public lcb_MULTICMD_CTX { protected: virtual lcb_error_t MCTX_addcmd(const lcb_CMDBASE* cmd) = 0; virtual lcb_error_t MCTX_done(const void *cookie) = 0; virtual void MCTX_fail() = 0; MultiCmdContext() { lcb_MULTICMD_CTX::addcmd = dispatch_mctx_addcmd; lcb_MULTICMD_CTX::done = dispatch_mctx_done; lcb_MULTICMD_CTX::fail = dispatch_mctx_fail; } virtual ~MultiCmdContext() {} private: static lcb_error_t dispatch_mctx_addcmd(lcb_MULTICMD_CTX* ctx, const lcb_CMDBASE * cmd) { return static_cast<MultiCmdContext*>(ctx)->MCTX_addcmd(cmd); } static lcb_error_t dispatch_mctx_done(lcb_MULTICMD_CTX* ctx, const void *cookie) { return static_cast<MultiCmdContext*>(ctx)->MCTX_done(cookie); } static void dispatch_mctx_fail(lcb_MULTICMD_CTX* ctx) { static_cast<MultiCmdContext*>(ctx)->MCTX_fail(); } }; } #endif
Add C++ helper for MULTICMD_CTX
Add C++ helper for MULTICMD_CTX This allows us to use virtual functions rather than C-style callbacks Change-Id: Id8d40c5f36b5700f941400118acb30a2284a4027 Reviewed-on: http://review.couchbase.org/71370 Tested-by: buildbot <[email protected]> Reviewed-by: Brett Lawson <[email protected]>
C
apache-2.0
avsej/libcouchbase,avsej/libcouchbase,couchbase/libcouchbase,kojiromike/libcouchbase,kojiromike/libcouchbase,avsej/libcouchbase,couchbase/libcouchbase,couchbase/libcouchbase,mody/libcouchbase,avsej/libcouchbase,kojiromike/libcouchbase,mody/libcouchbase,mody/libcouchbase,mody/libcouchbase,avsej/libcouchbase,couchbase/libcouchbase,avsej/libcouchbase,couchbase/libcouchbase,couchbase/libcouchbase,avsej/libcouchbase,couchbase/libcouchbase,kojiromike/libcouchbase
a39391dbdd26b3c6aaa4ffa2a4a7f50e4982d175
src/command/command_version.c
src/command/command_version.c
#include "server/bedrock.h" #include "server/command.h" void command_version(struct bedrock_client *client, int bedrock_attribute_unused argc, const char bedrock_attribute_unused **argv) { command_reply(client, "Bedrock version %d.%d%s Compiled on %s %s.", BEDROCK_VERSION_MAJOR, BEDROCK_VERSION_MINOR, BEDROCK_VERSION_EXTRA, __DATE__, __TIME__); }
#include "server/bedrock.h" #include "server/command.h" void command_version(struct bedrock_client *client, int bedrock_attribute_unused argc, const char bedrock_attribute_unused **argv) { command_reply(client, "Bedrock version %d.%d%s, built on %s %s.", BEDROCK_VERSION_MAJOR, BEDROCK_VERSION_MINOR, BEDROCK_VERSION_EXTRA, __DATE__, __TIME__); }
Change /version output to be more like -version
Change /version output to be more like -version
C
bsd-2-clause
Adam-/bedrock,Adam-/bedrock
9767f98ff5b6486b06e7bc5af8a761f6e5d3f82a
static_ar_param.c
static_ar_param.c
int f(int x[static volatile /*const*/ 10]) { return *++x; } main() { int x[5]; x[1] = 2; f(x); //int y[1]; //int *y; //#define y (void *)0 //pipe(y); }
int f(int x[static /*const*/ 10]) { return *++x; } main() { int x[5]; x[1] = 2; f(x); //int y[1]; //int *y; //#define y (void *)0 //pipe(y); }
Remove volatile from test (decl_equal doesn't check properly for now)
Remove volatile from test (decl_equal doesn't check properly for now)
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
a2259e17b7c657ddeb0c3a03a5ca291ca4e0dc7e
include/llvm/Support/SystemUtils.h
include/llvm/Support/SystemUtils.h
//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains functions used to do a variety of low-level, often // system-specific, tasks. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_SYSTEMUTILS_H #define LLVM_SUPPORT_SYSTEMUTILS_H #include <string> namespace llvm { class raw_ostream; namespace sys { class Path; } /// Determine if the raw_ostream provided is connected to the outs() and /// displayed or not (to a console window). If so, generate a warning message /// advising against display of bitcode and return true. Otherwise just return /// false /// @brief Check for output written to a console bool CheckBitcodeOutputToConsole( raw_ostream &stream_to_check, ///< The stream to be checked bool print_warning = true ///< Control whether warnings are printed ); /// FindExecutable - Find a named executable, giving the argv[0] of program /// being executed. This allows us to find another LLVM tool if it is built in /// the same directory. If the executable cannot be found, return an /// empty string. /// @brief Find a named executable. sys::Path FindExecutable(const std::string &ExeName, const char *Argv0, void *MainAddr); } // End llvm namespace #endif
//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains functions used to do a variety of low-level, often // system-specific, tasks. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_SYSTEMUTILS_H #define LLVM_SUPPORT_SYSTEMUTILS_H #include <string> namespace llvm { class raw_ostream; namespace sys { class Path; } /// Determine if the raw_ostream provided is connected to a terminal. If so, /// generate a warning message to errs() advising against display of bitcode /// and return true. Otherwise just return false. /// @brief Check for output written to a console bool CheckBitcodeOutputToConsole( raw_ostream &stream_to_check, ///< The stream to be checked bool print_warning = true ///< Control whether warnings are printed ); /// FindExecutable - Find a named executable, giving the argv[0] of program /// being executed. This allows us to find another LLVM tool if it is built in /// the same directory. If the executable cannot be found, return an /// empty string. /// @brief Find a named executable. sys::Path FindExecutable(const std::string &ExeName, const char *Argv0, void *MainAddr); } // End llvm namespace #endif
Reword this comment. Don't mention outs(), as that's not what this code is actually testing for.
Reword this comment. Don't mention outs(), as that's not what this code is actually testing for. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@112767 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap
9dbc3499ffe79aad16cb5d583a895ab045771814
src/qmapboxgl_p.h
src/qmapboxgl_p.h
#ifndef QMAPBOXGL_P_H #define QMAPBOXGL_P_H #include <mbgl/map/map.hpp> #include <mbgl/map/view.hpp> #include <mbgl/storage/default_file_source.hpp> namespace mbgl { class Map; class FileSource; } // namespace mbgl class QOpenGLContext; class QMapboxGLPrivate : public mbgl::View { public: explicit QMapboxGLPrivate(QMapboxGL *q); virtual ~QMapboxGLPrivate(); // mbgl::View implementation. void activate() override {} void deactivate() override; void notify() override {} void invalidate(std::function<void()> renderCallback) override; mbgl::DefaultFileSource fileSource; mbgl::Map map; int lastX = 0; int lastY = 0; QOpenGLContext *context = nullptr; QMapboxGL *q_ptr; }; #endif // QMAPBOXGL_P_H
#ifndef QMAPBOXGL_P_H #define QMAPBOXGL_P_H #include <mbgl/map/map.hpp> #include <mbgl/map/view.hpp> #include <mbgl/storage/default_file_source.hpp> namespace mbgl { class Map; class FileSource; } // namespace mbgl class QOpenGLContext; class QMapboxGLPrivate : public mbgl::View { public: explicit QMapboxGLPrivate(QMapboxGL *q); virtual ~QMapboxGLPrivate(); // mbgl::View implementation. void activate() final {} void deactivate() final; void notify() final {} void invalidate(std::function<void()> renderCallback) final; mbgl::DefaultFileSource fileSource; mbgl::Map map; int lastX = 0; int lastY = 0; QOpenGLContext *context = nullptr; QMapboxGL *q_ptr; }; #endif // QMAPBOXGL_P_H
Use final for virtual methods on private impl of mbgl::View
Use final for virtual methods on private impl of mbgl::View This is a private implementation, so we know that no one else will inherit from that.
C
bsd-2-clause
tmpsantos/qmapboxgl
32ff92d924c1d0f0dfbc1d246484d8e7341f1eb1
test/CodeGen/CBackend/2007-01-06-Signless.c
test/CodeGen/CBackend/2007-01-06-Signless.c
// RUN: %llvmgcc -S %s -o - | llvm-as | llc -march=c | \ // RUN: grep '(unsigned short' int Z = -1; int test(unsigned short X, short Y) { return X+Y+Z; }
Add a test case for PR1086
Add a test case for PR1086 git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@32977 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap
bb8caf35f64b4df0762ab74d0380d61d307e7296
parameter_type.h
parameter_type.h
///\file /****************************************************************************** The MIT License(MIT) Embedded Template Library. Copyright(c) 2014 jwellbelove 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 __ETL_PARAMETER__ #define __ETL_PARAMETER__ namespace etl { //************************************************************************* /// Determine how to pass parameters. //************************************************************************* template <typename U, const bool should_pass_by_value> struct parameter_type; //************************************************************************* /// Pass by value. //************************************************************************* template <typename U> struct parameter_type<U, true> { typedef U type; }; //************************************************************************* /// Pass by const reference. //************************************************************************* template <typename U> struct parameter_type<U, false> { typedef const U& type; }; } #endif
Choose between value and const reference type
Choose between value and const reference type Choose between value and const reference based on boolean template parameter
C
mit
ETLCPP/etl,17twenty/etl,ETLCPP/etl,ETLCPP/etl,GatorQue/etl,venkatarajasekhar/etl,17twenty/etl,GatorQue/etl,17twenty/etl,ETLCPP/etl,venkatarajasekhar/etl,venkatarajasekhar/etl,GatorQue/etl
207e799a003fc63548402e00f382046b1dbf9a17
src/tokenizers/strspn.h
src/tokenizers/strspn.h
#ifndef SIMHASH_TOKENIZERS__UTIL_H #define SIMHASH_TOKENIZERS__UTIL_H #include <string.h> namespace Simhash { struct Strspn { /* Return the length of the token starting at last */ const char* operator()(const char* last) { size_t s = strspn(last, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); return (*last != '\0') ? last + s : NULL; } }; } #endif
#ifndef SIMHASH_TOKENIZERS_STRSPN_H #define SIMHASH_TOKENIZERS_STRSPN_H #include <string.h> namespace Simhash { struct Strspn { /* Return the length of the token starting at last */ const char* operator()(const char* last) { size_t s = strspn(last, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); return (*last != '\0') ? last + s : NULL; } }; } #endif
Fix illegal (double underscore) include guard.
Fix illegal (double underscore) include guard.
C
mit
pombredanne/simhash-cpp,pombredanne/simhash-cpp,seomoz/simhash-cpp,seomoz/simhash-cpp
99140205fe727eda9ca88ecb93f954651d2d9fd3
src/unix_core.c
src/unix_core.c
/* * This file is covered by the Internet Software Consortium (ISC) License * Reference: ../License.txt * * __nohang_waitpid is linked directly into Synth but it's related to synthexec * so let's keep the C files together. * return: * 0 when process is still running * 1 when process exited normally * 2 when process exited with error * * __launch_process takes a pointer to an array of null-terminated string * pointers are returns the pid of the child process, or -1 upon failure */ #include <sys/types.h> #include <sys/wait.h> u_int8_t __nohang_waitpid (pid_t process_pid) { int status = 0; int pid = waitpid (process_pid, &status, WNOHANG); if (pid == 0) { return 0; } if (WIFEXITED (status) && (WEXITSTATUS (status) == 0)) { return 1; } else { return 2; } }
/* * This file is covered by the Internet Software Consortium (ISC) License * Reference: ../License.txt * * __nohang_waitpid is linked directly into Synth but it's related to synthexec * so let's keep the C files together. * return: * 0 when process is still running * 1 when process exited normally * 2 when process exited with error */ #include <sys/types.h> #include <sys/wait.h> u_int8_t __nohang_waitpid (pid_t process_pid) { int status = 0; int pid = waitpid (process_pid, &status, WNOHANG); if (pid == 0) { return 0; } if (WIFEXITED (status) && (WEXITSTATUS (status) == 0)) { return 1; } else { return 2; } }
Remove comment that is no longer applicable
Remove comment that is no longer applicable
C
isc
jrmarino/synth,jrmarino/synth,jrmarino/synth,jrmarino/synth
193366492715a171a398c68b874b5a4d9264718a
UIforETW/Version.h
UIforETW/Version.h
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.40f;
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.41f;
Increment version number to 1.41
Increment version number to 1.41
C
apache-2.0
ariccio/UIforETW,ariccio/UIforETW,ariccio/UIforETW,mwinterb/UIforETW,mwinterb/UIforETW,google/UIforETW,google/UIforETW,MikeMarcin/UIforETW,mwinterb/UIforETW,google/UIforETW,MikeMarcin/UIforETW,MikeMarcin/UIforETW,ariccio/UIforETW,google/UIforETW
49b8e80371bfa380dd34168a92d98b639ca1202a
src/test.c
src/test.c
#include "redislite.h" #include <string.h> static void test_add_key(redislite *db) { int rnd = arc4random(); char key[14]; sprintf(key, "%d", rnd); int size = strlen(key); redislite_insert_key(db, key, size, 0); } int main() { redislite *db = redislite_open_database("test.db"); int i; for (i=0; i < 100; i++) test_add_key(db); redislite_close_database(db); return 0; }
#include "redislite.h" #include <string.h> static void test_add_key(redislite *db) { int rnd = rand(); char key[14]; sprintf(key, "%d", rnd); int size = strlen(key); redislite_insert_key(db, key, size, 0); } int main() { redislite *db = redislite_open_database("test.db"); int i; for (i=0; i < 100; i++) test_add_key(db); redislite_close_database(db); return 0; }
Use rand instead of arc4random (linux doesn't support it)
Use rand instead of arc4random (linux doesn't support it)
C
bsd-2-clause
seppo0010/redislite,seppo0010/redislite,pombredanne/redislite,pombredanne/redislite
d5c5dedbd8284dc6e20d1c86f370a025ad5c3d25
fq/indexed_array_queue.h
fq/indexed_array_queue.h
/* * Copyright 2017 Brandon Yannoni * * 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 INDEXED_ARRAY_QUEUE_H #define INDEXED_ARRAY_QUEUE_H #include <pthread.h> #include "../function_queue_element.h" #include "../function_queue.h" #include "../qterror.h" /* * This structure is used to store the function queue elements and any * persistant data necessary for the manipulation procedures. */ struct fqindexedarray { /* a pointer to an element array */ struct function_queue_element* elements; pthread_mutex_t lock; /* unused */ pthread_cond_t wait; /* unused */ unsigned int front; /* the index of the "first" element */ unsigned int back; /* the index of the "last" element */ }; extern const struct fqdispatchtable fqdispatchtableia; #endif
/* * Copyright 2017 Brandon Yannoni * * 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 INDEXED_ARRAY_QUEUE_H #define INDEXED_ARRAY_QUEUE_H #include <pthread.h> #include "../function_queue_element.h" #include "../function_queue.h" #include "../qterror.h" /* * This structure is used to store the function queue elements and any * persistant data necessary for the manipulation procedures. */ struct fqindexedarray { /* a pointer to an element array */ struct function_queue_element* elements; unsigned int front; /* the index of the "first" element */ unsigned int back; /* the index of the "last" element */ }; extern const struct fqdispatchtable fqdispatchtableia; #endif
Remove unused members in fqindexedarray structure
Remove unused members in fqindexedarray structure
C
apache-2.0
byannoni/qthreads
df538417a40cde965fa2d16ceab38322b17a8097
iOS/PlayPlan/Profile/ProfileViewController.h
iOS/PlayPlan/Profile/ProfileViewController.h
// // ProfileViewController.h // PlayPlan // // Created by Zeacone on 15/11/8. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @class ProfileViewController; @protocol MainDelegate <NSObject> - (void)dismissViewController:(MainViewController *)mainViewController; @end @interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @end
// // ProfileViewController.h // PlayPlan // // Created by Zeacone on 15/11/8. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @class ProfileViewController; @protocol MainDelegate <NSObject> - (void)dismissViewController:(ProfileViewController *)mainViewController; @end @interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @end
Add delegate for profile view controller.
Add delegate for profile view controller.
C
mit
Zeacone/PlayPlan,Zeacone/PlayPlan
ee2ec81c8667f117fdbd4e3c02dce9170eefd221
VYNFCKit/VYNFCNDEFPayloadParser.h
VYNFCKit/VYNFCNDEFPayloadParser.h
// // VYNFCNDEFPayloadParser.h // VYNFCKit // // Created by Vince Yuan on 7/8/17. // Copyright © 2017 Vince Yuan. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foundation/Foundation.h> @class NFCNDEFPayload, VYNFCNDEFMessageHeader; @interface VYNFCNDEFPayloadParser : NSObject + (nullable id)parse:(nullable NFCNDEFPayload *)payload; + (nullable VYNFCNDEFMessageHeader *)parseMessageHeader:(nullable unsigned char*)payloadBytes length:(NSUInteger)length; @end
// // VYNFCNDEFPayloadParser.h // VYNFCKit // // Created by Vince Yuan on 7/8/17. // Copyright © 2017 Vince Yuan. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foundation/Foundation.h> @class NFCNDEFPayload, VYNFCNDEFMessageHeader; API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, macos, tvos) @interface VYNFCNDEFPayloadParser : NSObject + (nullable id)parse:(nullable NFCNDEFPayload *)payload; + (nullable VYNFCNDEFMessageHeader *)parseMessageHeader:(nullable unsigned char*)payloadBytes length:(NSUInteger)length; @end
Remove partial availability warning by adding API_AVAILABLE.
Remove partial availability warning by adding API_AVAILABLE.
C
mit
vinceyuan/VYNFCKit,vinceyuan/VYNFCKit
9075cf1aa531252ffd4b97bddcbc4ca702da5436
utils.c
utils.c
char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; }
char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; } void* mmalloc(size_t sz, char *filename) { int fd = open(filename, O_RDWR | O_CREAT, 0666); assert(fd != -1); char v = 0; for (size_t i = 0; i < sz; i++) { assert(write(fd, &v, sizeof(char))); } void *map = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); madvise(map, sz, MADV_RANDOM); return map; }
Implement dirty unallocatable memory mapped alloc.
Implement dirty unallocatable memory mapped alloc.
C
mit
frostburn/tinytsumego,frostburn/tinytsumego
1585507cfb362f92a5dd711a91dc69b6b0314e18
include/lldb/Host/Config.h
include/lldb/Host/Config.h
//===-- Config.h ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLDB_HOST_CONFIG_H #define LLDB_HOST_CONFIG_H #if defined(__APPLE__) // This block of code only exists to keep the Xcode project working in the // absence of a configuration step. #define LLDB_CONFIG_TERMIOS_SUPPORTED 1 #define HAVE_SYS_EVENT_H 1 #define HAVE_PPOLL 0 #else #error This file is only used by the Xcode build. #endif #endif // #ifndef LLDB_HOST_CONFIG_H
//===-- Config.h ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLDB_HOST_CONFIG_H #define LLDB_HOST_CONFIG_H #if defined(__APPLE__) // This block of code only exists to keep the Xcode project working in the // absence of a configuration step. #define LLDB_CONFIG_TERMIOS_SUPPORTED 1 #define HAVE_SYS_EVENT_H 1 #define HAVE_PPOLL 0 #define HAVE_SIGACTION 1 #else #error This file is only used by the Xcode build. #endif #endif // #ifndef LLDB_HOST_CONFIG_H
Define HAVE_SIGACTION to 1 in Xcode build
Define HAVE_SIGACTION to 1 in Xcode build This is needed to make the Xcode project build since it doesn't have auto-generated Config header. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@300618 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
749d1b8b2b92a439056026d3a2490f14db6ce688
Ray/Ray/Material.h
Ray/Ray/Material.h
#pragma once #include "Vector3.h" typedef Vector3 Color; class Material { public: Material(); virtual ~Material(); void setColor(Color& color); Color getColor(void) const; void setDiffuse(double diffuse); double getDiffuse(void) const; void setReflection(double refl); double GetReflection(void) const; double getSpecular(void) const; protected: Color color; float refl; float diff; };
#pragma once #include "Vector3.h" typedef Vector3 Color; class Material { public: Material(); virtual ~Material(); void setColor(Color& color); Color getColor(void) const; void setDiffuse(double diffuse); double getDiffuse(void) const; void setReflection(double refl); double GetReflection(void) const; double getSpecular(void) const; protected: Color color; double refl; double diff; };
Fix double / float mismatch
Fix double / float mismatch
C
mit
vsiles/RayEngine,vsiles/RayEngine
bcc37130a7535a1ebea95afcf67a323b17683f4d
IAAI.c
IAAI.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\r"); for ( size_t j = 0 ; j <= i ; j++ ) { printf("%c", str[j]); } } system(COOKED); printf("\n"); system(RAW); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\x1b[2K\r"); for ( size_t j = 0 ; j <= i ; j++ ) { printf("%c", str[j]); } } system(COOKED); printf("\n"); system(RAW); } return 0; }
Use ANSI sequences to ensure line clearing
Use ANSI sequences to ensure line clearing
C
mit
vinamarora8/IAAI
3227e32b40e6c3749cb869f925e2b194a409dfa3
sql/backends/monet5/sql_readline.h
sql/backends/monet5/sql_readline.h
/* * The contents of this file are subject to the MonetDB Public License * Version 1.1 (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.monetdb.org/Legal/MonetDBLicense * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Original Code is the MonetDB Database System. * * The Initial Developer of the Original Code is CWI. * Portions created by CWI are Copyright (C) 1997-July 2008 CWI. * Copyright August 2008-2012 MonetDB B.V. * All Rights Reserved. */ #ifndef SQL_READLINETOOLS_H_INCLUDED #define SQL_READLINETOOLS_H_INCLUDED #include "mal_client.h" sql5_export int SQLreadConsole(Client cntxt); #endif /* SQL_READLINETOOLS_H_INCLUDED */
/* * The contents of this file are subject to the MonetDB Public License * Version 1.1 (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.monetdb.org/Legal/MonetDBLicense * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Original Code is the MonetDB Database System. * * The Initial Developer of the Original Code is CWI. * Portions created by CWI are Copyright (C) 1997-July 2008 CWI. * Copyright August 2008-2012 MonetDB B.V. * All Rights Reserved. */ #ifndef SQL_READLINETOOLS_H_INCLUDED #define SQL_READLINETOOLS_H_INCLUDED #ifdef WIN32 #ifndef LIBSQL #define sql5_export extern __declspec(dllimport) #else #define sql5_export extern __declspec(dllexport) #endif #else #define sql5_export extern #endif #include "mal_client.h" sql5_export int SQLreadConsole(Client cntxt); #endif /* SQL_READLINETOOLS_H_INCLUDED */
Define sql5_export so that things compile.
Define sql5_export so that things compile.
C
mpl-2.0
zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb
a0770fe0570e07eadb02a84fa8f14ea4399805b7
You-DataStore/internal/operation.h
You-DataStore/internal/operation.h
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor /// \param stask the serialized task the operation need to work with explicit IOperation(SerializedTask& stask); virtual ~IOperation(); /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
Remove ctor and dtor of IOperation to make it a pure virtual class
Remove ctor and dtor of IOperation to make it a pure virtual class
C
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
85d3e8a4eb0d0e9670ae66c699f39c4d5380d246
OpenROV/AConfig.h
OpenROV/AConfig.h
#ifndef __ACONFIG_H_ #define __ACONFIG_H_ /* This must be before alphabetically before all other files that reference these settings for the compiler to work * or you may get vtable errors. */ /* This section is for devices and their configuration. IF you have not setup you pins with the * standard configuration of the OpenROV kits, you should probably clone the cape or controlboard * and change the pin definitions there. Things not wired to specific pins but on the I2C bus will * have the address defined in this file. */ //Kit: #define HAS_STD_CAPE (0) #define HAS_STD_PILOT (1) #define HAS_OROV_CONTROLLERBOARD_25 (0) #define HAS_STD_LIGHTS (1) #define HAS_STD_CALIBRATIONLASERS (0) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_CAMERAMOUNT (1) //After Market: #define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define HAS_MPU9150 (0) #define MPU9150_EEPROM_START 2 #endif
#ifndef __ACONFIG_H_ #define __ACONFIG_H_ /* This must be before alphabetically before all other files that reference these settings for the compiler to work * or you may get vtable errors. */ /* This section is for devices and their configuration. IF you have not setup you pins with the * standard configuration of the OpenROV kits, you should probably clone the cape or controlboard * and change the pin definitions there. Things not wired to specific pins but on the I2C bus will * have the address defined in this file. */ //Kit: #define HAS_STD_PILOT (1) /* The definitions are done in th #define HAS_STD_CAPE (0) #define HAS_OROV_CONTROLLERBOARD_25 (0) */ #include "BoardConfig.h" #define HAS_STD_LIGHTS (1) #define HAS_STD_CALIBRATIONLASERS (1) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_CAMERAMOUNT (1) //After Market: #define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define HAS_MPU9150 (0) #define MPU9150_EEPROM_START 2 #endif
Add automation for arduino board selection for compilation
Add automation for arduino board selection for compilation
C
mit
LeeCheongAh/openrov-software-arduino,OpenROV/openrov-software-arduino,LeeCheongAh/openrov-software-arduino,spiderkeys/openrov-software-arduino,dieface/openrov-software-arduino,dieface/openrov-software-arduino,spiderkeys/openrov-software-arduino,OpenROV/openrov-software-arduino,johan--/openrov-software-arduino,BrianAdams/openrov-software-arduino,BrianAdams/openrov-software-arduino,johan--/openrov-software-arduino,binary42/openrov-software-arduino,OpenROV/openrov-software-arduino,binary42/openrov-software-arduino
9e5f5831093c8a1896755915a7349bfd5caa3870
cpp/Timer/timer.h
cpp/Timer/timer.h
#ifndef TIMER_H #define TIMER_H #include <stdio.h> #include <stdlib.h> #include <sys/time.h> using namespace std; class Timer { private: timeval startTime; public: void start(){ gettimeofday(&startTime, NULL); } double stop(){ timeval endTime; long seconds, useconds; double duration; gettimeofday(&endTime, NULL); seconds = endTime.tv_sec - startTime.tv_sec; useconds = endTime.tv_usec - startTime.tv_usec; duration = seconds + useconds/1000000.0; return duration; } static void printTime(double duration){ printf("%5.6f seconds\n", duration); } }; #endif // TIMER_H
Add Timer implementation for C++.
[code] Add Timer implementation for C++.
C
apache-2.0
wangzk/my-util-codebase,wangzk/my-util-codebase,wangzk/my-util-codebase
e90c7729467108ffd6f813ade011c7ec5ced9680
crypto/opensslv.h
crypto/opensslv.h
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H #define OPENSSL_VERSION_NUMBER 0x0923 /* Version 0.9.1c is 0913 */ #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.2c 01 Apr 1999" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H /* Numeric release version identifier: * MMNNFFRBB: major minor fix final beta/patch * For example: * 0.9.3-dev 0x00903000 * 0.9.3beta1 0x00903001 * 0.9.3 0x00903100 * 0.9.3a 0x00903101 * 1.2.3z 0x1020311a */ #define OPENSSL_VERSION_NUMBER 0x00903000L #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.3-dev 19 May 1999" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
Switch to new version numbering scheme.
Switch to new version numbering scheme.
C
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl