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
47cb8d841569225b3e8e33945313709f964bd932
src/drivers/tty/serial/ttys_oldfs.h
src/drivers/tty/serial/ttys_oldfs.h
/** * @file * * @date 21.04.2016 * @author Anton Bondarev */ #ifndef TTYS_H_ #define TTYS_H_ #include <fs/idesc.h> #include <drivers/tty.h> struct uart; struct tty_uart { struct idesc idesc; struct tty tty; struct uart *uart; }; #endif /* TTYS_H_ */
/** * @file * * @date 21.04.2016 * @author Anton Bondarev */ #ifndef TTYS_H_ #define TTYS_H_ #include <fs/idesc.h> #include <drivers/tty.h> #include <drivers/char_dev.h> struct uart; struct tty_uart { struct idesc idesc; struct tty tty; struct uart *uart; }; extern struct idesc *uart_cdev_open(struct dev_module *cdev, void *priv); #define TTYS_DEF(name, uart) \ CHAR_DEV_DEF(name, uart_cdev_open, NULL, NULL, uart) #endif /* TTYS_H_ */
Add TTYS_DEF macro to oldfs
drivers: Add TTYS_DEF macro to oldfs
C
bsd-2-clause
embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox
da633160262800462ebda14807cffbb23fc68b29
src/condor_syscall_lib/syscall_param_sizes.h
src/condor_syscall_lib/syscall_param_sizes.h
#define STAT_SIZE sizeof(struct stat) #define STATFS_SIZE sizeof(struct statfs) #define GID_T_SIZE sizeof(gid_t) #define INT_SIZE sizeof(int) #define LONG_SIZE sizeof(long) #define FD_SET_SIZE sizeof(fd_set) #define TIMEVAL_SIZE sizeof(struct timeval) #define TIMEVAL_ARRAY_SIZE (sizeof(struct timeval) * 2) #define TIMEZONE_SIZE sizeof(struct timezone) #define FILEDES_SIZE sizeof(struct filedes) #define RLIMIT_SIZE sizeof(struct rlimit) #define UTSNAME_SIZE sizeof(struct utsname) #define POLLFD_SIZE sizeof(struct pollfd) #define RUSAGE_SIZE sizeof(struct rusage) #define MAX_STRING 1024 #define EIGHT 8 #define STATFS_ARRAY_SIZE (rval * sizeof(struct statfs)) #define PROC_SIZE sizeof(PROC)
#define STAT_SIZE sizeof(struct stat) #define STATFS_SIZE sizeof(struct statfs) #define GID_T_SIZE sizeof(gid_t) #define INT_SIZE sizeof(int) #define LONG_SIZE sizeof(long) #define FD_SET_SIZE sizeof(fd_set) #define TIMEVAL_SIZE sizeof(struct timeval) #define TIMEVAL_ARRAY_SIZE (sizeof(struct timeval) * 2) #define TIMEZONE_SIZE sizeof(struct timezone) #define FILEDES_SIZE sizeof(struct filedes) #define RLIMIT_SIZE sizeof(struct rlimit) #define UTSNAME_SIZE sizeof(struct utsname) #define POLLFD_SIZE sizeof(struct pollfd) #define RUSAGE_SIZE sizeof(struct rusage) #define MAX_STRING 1024 #define EIGHT 8 #define STATFS_ARRAY_SIZE (rval * sizeof(struct statfs)) #define PROC_SIZE sizeof(PROC) #define SIZE_T_SIZE sizeof(size_t) #define U_SHORT_SIZE sizeof(u_short)
Add macros for sized of "size_t" and "u_short".
Add macros for sized of "size_t" and "u_short".
C
apache-2.0
bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,htcondor/htcondor,htcondor/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/condor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/condor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/condor,djw8605/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,htcondor/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/condor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/htcondor,clalancette/condor-dcloud,djw8605/htcondor
c47c472d169e5dd2eeadfddb48ac71c114e29559
src/tuple.h
src/tuple.h
/* * tuple.h - define data structure for tuples */ #ifndef _TUPLE_H_ #define _TUPLE_H_ #define MAX_TUPLE_SIZE 4096 union Tuple { unsigned char bytes[MAX_TUPLE_SIZE]; char *ptrs[MAX_TUPLE_SIZE/sizeof(char *)]; }; #endif /* _TUPLE_H_ */
/* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * tuple.h - define data structure for tuples */ #ifndef _TUPLE_H_ #define _TUPLE_H_ #define MAX_TUPLE_SIZE 4096 union Tuple { unsigned char bytes[MAX_TUPLE_SIZE]; char *ptrs[MAX_TUPLE_SIZE/sizeof(char *)]; }; #endif /* _TUPLE_H_ */
Add BSD 3-clause open source header
Add BSD 3-clause open source header
C
bsd-3-clause
fergul/Cache,jsventek/Cache,fergul/Cache,fergul/Cache,jsventek/Cache,jsventek/Cache
9c77cb0b8980196d0207e7139788cbc99f73d663
solutions/uri/1040/1040.c
solutions/uri/1040/1040.c
#include <stdio.h> int main() { float a, b, c, d, e, m; scanf("%f %f %f %f", &a, &b, &c, &d); m = (a * 2 + b * 3 + c * 4 + d) / 10; printf("Media: %.1f\n", m); if (m >= 7.0) { printf("Aluno aprovado.\n"); } else if (m >= 5.0) { printf("Aluno em exame.\n"); scanf("%f", &e); printf("Nota do exame: %.1f\n", e); if (e + m / 2.0 > 5.0) { printf("Aluno aprovado.\n"); } else { printf("Aluno reprovado.\n"); } printf("Media final: %.1f\n", (e + m) / 2.0); } else { printf("Aluno reprovado.\n"); } return 0; }
Solve Average 3 in c
Solve Average 3 in c
C
mit
deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground
849dcc2fd36ec01352a3544c501cbbe5afa78d95
src/empathy-accounts-module.c
src/empathy-accounts-module.c
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2010 Red Hat, Inc. * Copyright (C) 2010 Collabora Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <config.h> #include <glib.h> #include <glib/gi18n-lib.h> #include <gmodule.h> #include <gio/gio.h> #include "cc-empathy-accounts-panel.h" void g_io_module_load (GIOModule *module) { textdomain (GETTEXT_PACKAGE); cc_empathy_accounts_panel_register (module); } void g_io_module_unload (GIOModule *module) { }
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2010 Red Hat, Inc. * Copyright (C) 2010 Collabora Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <config.h> #include <glib.h> #include <glib/gi18n-lib.h> #include <gmodule.h> #include <gio/gio.h> #include "cc-empathy-accounts-panel.h" void g_io_module_load (GIOModule *module) { cc_empathy_accounts_panel_register (module); } void g_io_module_unload (GIOModule *module) { }
Remove call to textdomain ()
accounts-module: Remove call to textdomain () This shouldn't be called in shared module. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=617262
C
lgpl-2.1
GNOME/telepathy-account-widgets,Distrotech/telepathy-account-widgets,Distrotech/telepathy-account-widgets,GNOME/telepathy-account-widgets,GNOME/telepathy-account-widgets
5f4e7951645078f97d8d1acade32f911d51fbd14
gvn-plugin/single-block-test.c
gvn-plugin/single-block-test.c
int main() { int b = 2, c = 3, d = 4; int a = b + c; b = a - d; int e = b + c; int f = a - d; return 0; }
Add test case for single block
Add test case for single block
C
mit
k4rtik/btp-gvn,k4rtik/btp-gvn
26dd0bf3cf7d2550b292724e302cbda852586ef9
tests/regression/36-apron/58-queuesize-const.c
tests/regression/36-apron/58-queuesize-const.c
// SKIP PARAM: --set ana.activated[+] apron --set ana.apron.domain octagon --enable ana.apron.threshold_widening // TODO: why needs threshold widening to succeed when queuesize doesn't? #include <pthread.h> #include <assert.h> #define CAPACITY 1000 int used; int free; pthread_mutex_t Q = PTHREAD_MUTEX_INITIALIZER; void pop() { pthread_mutex_lock(&Q); assert(free >= 0); assert(free <= CAPACITY); assert(used >= 0); assert(used <= CAPACITY); assert(used + free == CAPACITY); if (used >= 1) { used--; free++; } assert(free >= 0); assert(free <= CAPACITY); assert(used >= 0); assert(used <= CAPACITY); assert(used + free == CAPACITY); pthread_mutex_unlock(&Q); } void push() { pthread_mutex_lock(&Q); assert(free >= 0); assert(free <= CAPACITY); assert(used >= 0); assert(used <= CAPACITY); assert(used + free == CAPACITY); if (free >= 1) { free--; used++; } assert(free >= 0); assert(free <= CAPACITY); assert(used >= 0); assert(used <= CAPACITY); assert(used + free == CAPACITY); pthread_mutex_unlock(&Q); } void *worker(void *arg) { while (1) pop(); return NULL; } int main() { free = CAPACITY; used = 0; assert(free >= 0); assert(free <= CAPACITY); assert(used >= 0); assert(used <= CAPACITY); assert(used + free == CAPACITY); pthread_t worker1; pthread_t worker2; pthread_create(&worker1, NULL, worker, NULL); pthread_create(&worker2, NULL, worker, NULL); while (1) push(); return 0; }
Add queuesize test with constant capacity
Add queuesize test with constant capacity This can be verified using octagon.
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
2f376c9b25a8654b508613ddd57851c015f14858
hipify-clang/src/CUDA2HipMap.h
hipify-clang/src/CUDA2HipMap.h
#pragma once #include "llvm/ADT/StringRef.h" #include <set> #include <map> #include "Types.h" // TODO: This shouldn't really be here. More restructuring needed... struct hipCounter { llvm::StringRef hipName; ConvTypes countType; ApiTypes countApiType; int unsupported; }; #define HIP_UNSUPPORTED -1 /// Macros to ignore. extern const std::set<llvm::StringRef> CUDA_EXCLUDES; /// Maps cuda header names to hip header names. extern const std::map<llvm::StringRef, hipCounter> CUDA_INCLUDE_MAP; /// Maps the names of CUDA types to the corresponding hip types. extern const std::map<llvm::StringRef, hipCounter> CUDA_TYPE_NAME_MAP; /// Map all other CUDA identifiers (function/macro names, enum values) to hip versions. extern const std::map<llvm::StringRef, hipCounter> CUDA_IDENTIFIER_MAP; /** * The union of all the above maps. * * This should be used rarely, but is still needed to convert macro definitions (which can * contain any combination of the above things). AST walkers can usually get away with just * looking in the lookup table for the type of element they are processing, however, saving * a great deal of time. */ const std::map<llvm::StringRef, hipCounter>& CUDA_RENAMES_MAP();
#pragma once #include "llvm/ADT/StringRef.h" #include <set> #include <map> #include "Types.h" // TODO: This shouldn't really be here. More restructuring needed... struct hipCounter { llvm::StringRef hipName; ConvTypes countType; ApiTypes countApiType; bool unsupported; }; #define HIP_UNSUPPORTED true /// Macros to ignore. extern const std::set<llvm::StringRef> CUDA_EXCLUDES; /// Maps cuda header names to hip header names. extern const std::map<llvm::StringRef, hipCounter> CUDA_INCLUDE_MAP; /// Maps the names of CUDA types to the corresponding hip types. extern const std::map<llvm::StringRef, hipCounter> CUDA_TYPE_NAME_MAP; /// Map all other CUDA identifiers (function/macro names, enum values) to hip versions. extern const std::map<llvm::StringRef, hipCounter> CUDA_IDENTIFIER_MAP; /** * The union of all the above maps. * * This should be used rarely, but is still needed to convert macro definitions (which can * contain any combination of the above things). AST walkers can usually get away with just * looking in the lookup table for the type of element they are processing, however, saving * a great deal of time. */ const std::map<llvm::StringRef, hipCounter>& CUDA_RENAMES_MAP();
Make `unsupported` actually be a bool...
Make `unsupported` actually be a bool...
C
mit
ROCm-Developer-Tools/HIP,ROCm-Developer-Tools/HIP,GPUOpen-ProfessionalCompute-Tools/HIP,ROCm-Developer-Tools/HIP,GPUOpen-ProfessionalCompute-Tools/HIP,GPUOpen-ProfessionalCompute-Tools/HIP,ROCm-Developer-Tools/HIP,GPUOpen-ProfessionalCompute-Tools/HIP,GPUOpen-ProfessionalCompute-Tools/HIP,ROCm-Developer-Tools/HIP
1ffa2c93463833e800dbac2a5fed09cabdb0da1c
tools/sleep.c
tools/sleep.c
// Title: sleep // Name: sleep.c // Author: Matayoshi // Date: 2010/06/20 // Ver: 1.0.0 #include <stdio.h> #include <stdlib.h> #include <windows.h> int main(int argc, char* argv[]) { // `FbN if(argc < 2) { fprintf(stdout, "Usage: %s msec\n", argv[0]); exit(1); } else { char buf[16]; int wait = 0; // 񂩂琔lɕϊ sscanf(argv[1], "%15c", buf); if(sscanf(buf, "%d", &wait) != 1) { fprintf(stdout, "Usage: %s msec\n", argv[0]); exit(1); } // Ŏw肳ꂽ msec sleep(wait) Sleep(wait); } return 0; }
// Title: sleep // Name: sleep.c // Author: Matayoshi // Date: 2010/06/20 // Ver: 1.0.0 #include <stdio.h> #include <stdlib.h> #include <windows.h> int main(int argc, char* argv[]) { // 引数チェック if(argc < 2) { fprintf(stdout, "Usage: %s msec\n", argv[0]); exit(1); } else { char buf[16]; int wait = 0; // 文字列から数値に変換 sscanf(argv[1], "%15c", buf); if(sscanf(buf, "%d", &wait) != 1) { fprintf(stdout, "Usage: %s msec\n", argv[0]); exit(1); } // 引数で指定された msec だけ sleep(wait) Sleep(wait); } return 0; }
Change character encoding.(Shift_JIS -> UTF-8)
Change character encoding.(Shift_JIS -> UTF-8)
C
bsd-2-clause
matayoshi/tools
7334efa66bcbcd6bfd95cb9c4d3236a9a469daf1
libutils/include/utils/force.h
libutils/include/utils/force.h
/* * Copyright 2016, 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) */ #pragma once /* macros for forcing the compiler to leave in statments it would * normally optimize away */ #include <utils/attribute.h> #include <utils/stringify.h> /* Macro for doing dummy reads * * Expands to a volatile, unused variable which is set to the value at * a given address. It's volatile to prevent the compiler optimizing * away a variable that is written but never read, and it's unused to * prevent warnings about a variable that's never read. */ #define FORCE_READ(address) \ volatile UNUSED typeof(*address) JOIN(__force__read, __COUNTER__) = *(address)
/* * Copyright 2016, 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) */ #pragma once /* macros for forcing the compiler to leave in statments it would * normally optimize away */ #include <utils/attribute.h> #include <utils/stringify.h> /* Macro for doing dummy reads * * Forces a memory read access to the given address. */ #define FORCE_READ(address) \ do { \ typeof(*(address)) *_ptr = (address); \ asm volatile ("" : "=m"(*_ptr) : "r"(*_ptr)); \ } while (0)
Rephrase FORCE_READ into something safer.
libutils: Rephrase FORCE_READ into something safer. This commit rephrases the `FORCE_READ` macro to avoid an unorthodox use of `volatile`. The change makes the read less malleable from the compiler's point of view. It also has the unintended side effect of slightly optimising this operation. On x86, an optimising compiler now generates a single load, rather than a load followed by a store to the (unused) local variable. On ARM, there is a similar improvement, but we also save two instructions for stack pointer manipulation depending on the context in which the macro is expanded.
C
bsd-2-clause
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
90d4efa6094d0af71afbede10293b30e065e27bf
test/PCH/changed-files.c
test/PCH/changed-files.c
const char *s0 = m0; int s1 = m1; const char *s2 = m0; // FIXME: This test fails inexplicably on Windows in a manner that makes it // look like standard error isn't getting flushed properly. // RUN: true // RUNx: echo '#define m0 ""' > %t.h // RUNx: %clang_cc1 -emit-pch -o %t.h.pch %t.h // RUNx: echo '' > %t.h // RUNx: not %clang_cc1 -include-pch %t.h.pch %s 2> %t.stderr // RUNx: grep "modified" %t.stderr // RUNx: echo '#define m0 000' > %t.h // RUNx: %clang_cc1 -emit-pch -o %t.h.pch %t.h // RUNx: echo '' > %t.h // RUNx: not %clang_cc1 -include-pch %t.h.pch %s 2> %t.stderr // RUNx: grep "modified" %t.stderr // RUNx: echo '#define m0 000' > %t.h // RUNx: echo "#define m1 'abcd'" >> %t.h // RUNx: %clang_cc1 -emit-pch -o %t.h.pch %t.h // RUNx: echo '' > %t.h // RUNx: not %clang_cc1 -include-pch %t.h.pch %s 2> %t.stderr // RUNx: grep "modified" %t.stderr
const char *s0 = m0; int s1 = m1; const char *s2 = m0; // FIXME: This test fails inexplicably on Windows in a manner that makes it // look like standard error isn't getting flushed properly. // RUN: false // XFAIL: * // RUN: echo '#define m0 ""' > %t.h // RUN: %clang_cc1 -emit-pch -o %t.h.pch %t.h // RUN: echo '' > %t.h // RUN: not %clang_cc1 -include-pch %t.h.pch %s 2> %t.stderr // RUN: grep "modified" %t.stderr // RUN: echo '#define m0 000' > %t.h // RUN: %clang_cc1 -emit-pch -o %t.h.pch %t.h // RUN: echo '' > %t.h // RUN: not %clang_cc1 -include-pch %t.h.pch %s 2> %t.stderr // RUN: grep "modified" %t.stderr // RUN: echo '#define m0 000' > %t.h // RUN: echo "#define m1 'abcd'" >> %t.h // RUN: %clang_cc1 -emit-pch -o %t.h.pch %t.h // RUN: echo '' > %t.h // RUN: not %clang_cc1 -include-pch %t.h.pch %s 2> %t.stderr // RUN: grep "modified" %t.stderr
Use Daniel's trick for XFAIL'd tests
Use Daniel's trick for XFAIL'd tests git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@99515 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
9b50cff3beb46f8c14c045f71551e5be5bc4d287
linkedLists/intersectY.c
linkedLists/intersectY.c
#include "listHelper.h" int intersectNode(struct linkList *l1, struct linkList *l2, int m, int n) { /* l1 \ l2 \ / \/ | | l1 is list1 with length m l2 is list2 with length n here, m is 5 and n is 4 so diff = abs(m-n) = 1 we need to hop 1 step on l1 to reach l2's length. from here on, we loop till end of list and verify id l1 == l2 if l1 == l2 somewhere, we have a Y list */ int diff = abs (m -n ); if ( m > n) { while ( diff ) { diff--; l1 = l1->next; } } if ( n > m ) { while ( diff ) { diff--; l2 = l2->next; } } while (l1 != NULL || l2 != NULL ) { if ( l1 == l2) return l1->data; else { l1 = l1->next; l2 = l2->next; } } } void main() { int dat; struct linkList *list1 = NULL, *list2 = NULL; InsertLinkedList(&list1, 21, 1); /*Insert node in Beginning */ InsertLinkedList(&list1, 31, 2); /*Insert at position 2 */ InsertLinkedList(&list1, 41, 3); InsertLinkedList(&list1, 51, 4); InsertLinkedList(&list1, 61, 5); InsertLinkedList(&list1, 72, 6); InsertLinkedList(&list1, 87, 7); InsertLinkedList(&list2, 91, 1); InsertLinkedList(&list2, 92, 2); InsertLinkedList(&list2, 93, 3); InsertLinkedList(&list2, 94, 4); displayList(list1); displayList(list2); /* build a Y list */ list2->next->next->next->next = list1->next->next->next; displayList(list1); displayList(list2); printf ( "Intersecting node is %d\n", intersectNode(list1, list2, 7, 8)); }
Verify if two lists intersect at Y point.
Verify if two lists intersect at Y point.
C
mit
vidya-ranganathan/algorithms
94a4b6a3f8de8f9dcd11e3fecacb3444785e6087
src/Draupnir.h
src/Draupnir.h
#ifndef DRAUPNIR_H__ #define DRAUPNIR_H__ #include <cstdint> #include "Sponge.h" #include "CrcSponge.h" #include "CrcSpongeBuilder.h" #include "Constants.h" namespace Draupnir { // utility typedefs typedef CrcSponge<std::uint64_t> CrcSponge64; typedef CrcSponge<std::uint32_t> CrcSponge32; typedef CrcSponge<std::uint16_t> CrcSponge16; typedef CrcSponge<std::uint8_t> CrcSponge8; typedef CrcSpongeBuilder<std::uint64_t> CrcSponge64Builder; typedef CrcSpongeBuilder<std::uint32_t> CrcSponge32Builder; typedef CrcSpongeBuilder<std::uint16_t> CrcSponge16Builder; typedef CrcSpongeBuilder<std::uint8_t> CrcSponge8Builder; } #endif /* DRAUPNIR_H__ */
#ifndef DRAUPNIR_H__ #define DRAUPNIR_H__ #include <cstdint> #include "Sponge.h" #include "CrcSponge.h" #include "CrcSpongeBuilder.h" #include "Constants.h" namespace Draupnir { // utility typedefs using CrcSponge64 = CrcSponge<std::uint64_t>; using CrcSponge32 = CrcSponge<std::uint32_t>; using CrcSponge16 = CrcSponge<std::uint16_t>; using CrcSponge8 = CrcSponge<std::uint8_t >; using CrcSponge64Builder = CrcSpongeBuilder<std::uint64_t>; using CrcSponge32Builder = CrcSpongeBuilder<std::uint32_t>; using CrcSponge16Builder = CrcSpongeBuilder<std::uint16_t>; using CrcSponge8Builder = CrcSpongeBuilder<std::uint8_t >; } #endif /* DRAUPNIR_H__ */
Use using instead of typedef
Use using instead of typedef
C
agpl-3.0
mariano-perez-rodriguez/draupnir
212e2ca79c73f0997e06a351f63691d3f2976c15
tests/regression/10-synch/24-tid-partitioned-array-global.c
tests/regression/10-synch/24-tid-partitioned-array-global.c
// PARAM: --enable exp.partition-arrays.enabled #include <pthread.h> pthread_t t_ids[10000]; void *t_fun(void *arg) { return NULL; } int main(void) { for (int i = 0; i < 10000; i++) pthread_create(&t_ids[i], NULL, t_fun, NULL); for (int i = 0; i < 10000; i++) pthread_join (t_ids[i], NULL); return 0; }
// PARAM: --set ana.activated[+] thread --enable exp.partition-arrays.enabled #include <pthread.h> pthread_t t_ids[10000]; void *t_fun(void *arg) { return NULL; } int main(void) { for (int i = 0; i < 10000; i++) pthread_create(&t_ids[i], NULL, t_fun, NULL); for (int i = 0; i < 10000; i++) pthread_join (t_ids[i], NULL); return 0; }
Fix missing thread analysis in 10/24
Fix missing thread analysis in 10/24
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
23f2dfdefaab0c052c7c1695e53331a7992df5b9
include-fixer/find-all-symbols/STLPostfixHeaderMap.h
include-fixer/find-all-symbols/STLPostfixHeaderMap.h
//===-- STLPostfixHeaderMap.h - hardcoded header map for STL ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_TOOL_STL_POSTFIX_HEADER_MAP_H #define LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_TOOL_STL_POSTFIX_HEADER_MAP_H #include <HeaderMapCollector.h> namespace clang { namespace find_all_symbols { const HeaderMapCollector::HeaderMap* getSTLPostfixHeaderMap(); } // namespace find_all_symbols } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_TOOL_STL_POSTFIX_HEADER_MAP_H
//===-- STLPostfixHeaderMap.h - hardcoded header map for STL ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_TOOL_STL_POSTFIX_HEADER_MAP_H #define LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_TOOL_STL_POSTFIX_HEADER_MAP_H #include "HeaderMapCollector.h" namespace clang { namespace find_all_symbols { const HeaderMapCollector::HeaderMap* getSTLPostfixHeaderMap(); } // namespace find_all_symbols } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_TOOL_STL_POSTFIX_HEADER_MAP_H
Include local header with quotes instead of angle brackets.
Include local header with quotes instead of angle brackets. This works by accident because we pass '-I.' git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@270701 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra
1ca440467863ff2daa0234b36401706872391e6a
src/clientversion.h
src/clientversion.h
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // 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 9 #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 // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source #define COPYRIGHT_YEAR 2014 // 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 and copyright year // // 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 9 #define CLIENT_VERSION_REVISION 1 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source #define COPYRIGHT_YEAR 2014 // 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
Bump version for openssl security updates
Bump version for openssl security updates
C
mit
CatcoinOfficial/CatcoinRelease,CatcoinOfficial/CatcoinRelease,CatcoinOfficial/CatcoinRelease,CatcoinOfficial/CatcoinRelease,CatcoinOfficial/CatcoinRelease
724948b4d891a91e2912497c1a3e544543b501b1
src/mongoc/mongoc-iovec.h
src/mongoc/mongoc-iovec.h
/* * Copyright 2014 MongoDB, 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 MONGOC_IOVEC_H #define MONGOC_IOVEC_H #include <bson.h> #ifndef _WIN32 # include <sys/uio.h> #endif BSON_BEGIN_DECLS #ifdef _WIN32 typedef struct { u_long iov_len; char *iov_base; } mongoc_iovec_t; #else typedef struct iovec mongoc_iovec_t; #endif BSON_END_DECLS #endif /* MONGOC_IOVEC_H */
/* * Copyright 2014 MongoDB, 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 MONGOC_IOVEC_H #define MONGOC_IOVEC_H #include <bson.h> #ifdef _WIN32 # include <stddef.h> #else # include <sys/uio.h> #endif BSON_BEGIN_DECLS #ifdef _WIN32 typedef struct { u_long iov_len; char *iov_base; } mongoc_iovec_t; BSON_STATIC_ASSERT(sizeof(mongoc_iovec_t) == sizeof(WSABUF)); BSON_STATIC_ASSERT(offsetof(mongoc_iovec_t, iov_base) == offsetof(WSABUF, buf)); BSON_STATIC_ASSERT(offsetof(mongoc_iovec_t, iov_len) == offsetof(WSABUF, len)); #else typedef struct iovec mongoc_iovec_t; #endif BSON_END_DECLS #endif /* MONGOC_IOVEC_H */
Make sure our iovec abstraction is compatible with Windows WSABUF
CDRIVER-756: Make sure our iovec abstraction is compatible with Windows WSABUF We cast mongoc_iovec_t to LPWSABUF in our sendmsg() wrapper
C
apache-2.0
ajdavis/mongo-c-driver,rcsanchez97/mongo-c-driver,acmorrow/mongo-c-driver,ajdavis/mongo-c-driver,rcsanchez97/mongo-c-driver,derickr/mongo-c-driver,christopherjwang/mongo-c-driver,christopherjwang/mongo-c-driver,jmikola/mongo-c-driver,derickr/mongo-c-driver,jmikola/mongo-c-driver,acmorrow/mongo-c-driver,beingmeta/mongo-c-driver,derickr/mongo-c-driver,remicollet/mongo-c-driver,malexzx/mongo-c-driver,mongodb/mongo-c-driver,rcsanchez97/mongo-c-driver,derickr/mongo-c-driver,mschoenlaub/mongo-c-driver,ksuarz/mongo-c-driver,remicollet/mongo-c-driver,remicollet/mongo-c-driver,jmikola/mongo-c-driver,ac000/mongo-c-driver,acmorrow/mongo-c-driver,ksuarz/mongo-c-driver,rcsanchez97/mongo-c-driver,derickr/mongo-c-driver,acmorrow/mongo-c-driver,ajdavis/mongo-c-driver,ac000/mongo-c-driver,bjori/mongo-c-driver,beingmeta/mongo-c-driver,ajdavis/mongo-c-driver,bjori/mongo-c-driver,beingmeta/mongo-c-driver,Convey-Compliance/mongo-c-driver,ajdavis/mongo-c-driver,beingmeta/mongo-c-driver,acmorrow/mongo-c-driver,rcsanchez97/mongo-c-driver,jmikola/mongo-c-driver,Machyne/mongo-c-driver,bjori/mongo-c-driver,remicollet/mongo-c-driver,Machyne/mongo-c-driver,malexzx/mongo-c-driver,beingmeta/mongo-c-driver,Convey-Compliance/mongo-c-driver,rcsanchez97/mongo-c-driver,u2yg/mongo-c-driver,mongodb/mongo-c-driver,bjori/mongo-c-driver,Convey-Compliance/mongo-c-driver,remicollet/mongo-c-driver,mongodb/mongo-c-driver,ajdavis/mongo-c-driver,ksuarz/mongo-c-driver,ksuarz/mongo-c-driver,Convey-Compliance/mongo-c-driver,beingmeta/mongo-c-driver,mschoenlaub/mongo-c-driver,bjori/mongo-c-driver,christopherjwang/mongo-c-driver,u2yg/mongo-c-driver,mschoenlaub/mongo-c-driver,jmikola/mongo-c-driver,Machyne/mongo-c-driver,derickr/mongo-c-driver,remicollet/mongo-c-driver,u2yg/mongo-c-driver,mongodb/mongo-c-driver,mongodb/mongo-c-driver,acmorrow/mongo-c-driver,rcsanchez97/mongo-c-driver,bjori/mongo-c-driver,ac000/mongo-c-driver,derickr/mongo-c-driver,u2yg/mongo-c-driver,mongodb/mongo-c-driver,malexzx/mongo-c-driver,bjori/mongo-c-driver,mschoenlaub/mongo-c-driver,malexzx/mongo-c-driver,Convey-Compliance/mongo-c-driver,remicollet/mongo-c-driver,ajdavis/mongo-c-driver,jmikola/mongo-c-driver,beingmeta/mongo-c-driver,Machyne/mongo-c-driver,acmorrow/mongo-c-driver,mongodb/mongo-c-driver,beingmeta/mongo-c-driver,christopherjwang/mongo-c-driver,jmikola/mongo-c-driver
f639faedd1daf285559fea44fc00190a668cec32
src2/BeaconMapper.h
src2/BeaconMapper.h
// // Created by Scott Stark on 6/12/15. // #ifndef NATIVESCANNER_BEACONMAPPER_H #define NATIVESCANNER_BEACONMAPPER_H #include <map> #include <string> using namespace std; /** * Map a beacon id to the registered user by querying the application registration rest api */ class BeaconMapper { private: map<int, string> beaconToUser; public: /** * Query the current user registrations to update the beacon minorID to name mappings */ void refresh(); string lookupUser(int minorID); }; #endif //NATIVESCANNER_BEACONMAPPER_H
// // Created by Scott Stark on 6/12/15. // #ifndef NATIVESCANNER_BEACONMAPPER_H #define NATIVESCANNER_BEACONMAPPER_H #include <map> #include <string> using namespace std; /** * Map a beacon id to the registered user by querying the application registration rest api * * Relies on: * git clone https://github.com/open-source-parsers/jsoncpp.git * cd jsoncpp/ * mkdir build * cd build/ * cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=ON .. * make * make install * * git clone https://github.com/mrtazz/restclient-cpp.git * apt-get install autoconf * apt-get install libtool * apt-get install libcurl4-openssl-dev * cd restclient-cpp/ * ./autogen.sh * ./configure * make * make install */ class BeaconMapper { private: map<int, string> beaconToUser; public: /** * Query the current user registrations to update the beacon minorID to name mappings */ void refresh(); string lookupUser(int minorID); }; #endif //NATIVESCANNER_BEACONMAPPER_H
Document full requirements for the beacon mapper
Document full requirements for the beacon mapper
C
apache-2.0
starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser
a93d837aae8610045a7883ee60017d71917aa6a4
test/unit/event_fixture.h
test/unit/event_fixture.h
#ifndef VAST_TEST_UNIT_EVENT_FIXTURE_H #define VAST_TEST_UNIT_EVENT_FIXTURE_H #include <vector> #include "vast/event.h" struct event_fixture { event_fixture(); std::vector<vast::event> events; }; #endif
Add missing event fixture file.
Add missing event fixture file.
C
bsd-3-clause
vast-io/vast,pmos69/vast,pmos69/vast,mavam/vast,vast-io/vast,mavam/vast,vast-io/vast,vast-io/vast,mavam/vast,vast-io/vast,pmos69/vast,mavam/vast,pmos69/vast
69ec185fd5de8c133808a5aeec5b0435a3d2025e
RNSketch/RNSketchManager.h
RNSketch/RNSketchManager.h
// // RNSketchManager.m // RNSketch // // Created by Jeremy Grancher on 28/04/2016. // Copyright © 2016 Jeremy Grancher. All rights reserved. // #import "RCTViewManager.h" #import "RNSketch.h" @interface RNSketchManager : RCTViewManager @property (strong) RNSketch *sketchView; @end;
// // RNSketchManager.m // RNSketch // // Created by Jeremy Grancher on 28/04/2016. // Copyright © 2016 Jeremy Grancher. All rights reserved. // #if __has_include(<React/RCTViewManager.h>) // React Native >= 0.40 #import <React/RCTViewManager.h> #else // React Native <= 0.39 #import "RCTViewManager.h" #endif #import "RNSketch.h" @interface RNSketchManager : RCTViewManager @property (strong) RNSketch *sketchView; @end;
Support RN 0.40 headers while retaining backwards compatibility.
Support RN 0.40 headers while retaining backwards compatibility. Use #if to conditionally import React headers.
C
mit
jgrancher/react-native-sketch
37429be0d50a7a8d9b5ea34346613410a89c8c53
Reducers/REDIterable.h
Reducers/REDIterable.h
// Copyright (c) 2014 Rob Rix. All rights reserved. #import <Foundation/Foundation.h> @protocol REDIterable <NSObject> @property (readonly) id(^red_iterator)(void); @end
// Copyright (c) 2014 Rob Rix. All rights reserved. #import <Foundation/Foundation.h> /// A nullary block iterating the elements of a collection over successive calls. /// /// \return The next object in the collection, or nil if it has iterated the entire collection. typedef id (^REDIteratingBlock)(void); /// A collection which can be iterated. @protocol REDIterable <NSObject> /// An iterator for this collection. @property (readonly) REDIteratingBlock red_iterator; @end
Add a typedef for iterators.
Add a typedef for iterators.
C
mit
policp/Reducers,robrix/Reducers
d086430fdd5b4cf3cc168b794ac823629994fc18
test/pragma/both.c
test/pragma/both.c
// RUN: %check %s #pragma STDC FENV_ACCESS on _Pragma("STDC FENV_ACCESS on"); // CHECK: warning: unhandled STDC pragma // CHECK: ^warning: extra ';' at global scope #define LISTING(x) PRAGMA(listing on #x) #define PRAGMA(x) _Pragma(#x) LISTING(../listing) // CHECK: warning: unknown pragma 'listing on "../listing"' _Pragma(L"STDC CX_LIMITED_RANGE off") // CHECK: warning: unhandled STDC pragma // CHECK: ^!/warning: extra ';'/ #pragma STDC FP_CONTRACT off main() { }
// RUN: %check %s #pragma STDC FENV_ACCESS ON _Pragma("STDC FENV_ACCESS ON"); // CHECK: warning: unhandled STDC pragma // CHECK: ^warning: extra ';' at global scope #define LISTING(x) PRAGMA(listing on #x) #define PRAGMA(x) _Pragma(#x) LISTING(../listing) // CHECK: warning: unknown pragma 'listing on "../listing"' _Pragma(L"STDC CX_LIMITED_RANGE OFF") // CHECK: warning: unhandled STDC pragma // CHECK: ^!/warning: extra ';'/ #pragma STDC FP_CONTRACT OFF int main() { }
Correct case of STDC pragmas
Correct case of STDC pragmas
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
e43162ceeb46ef215c9a5215b36b01f695eca60e
ios/KCKeepAwake.h
ios/KCKeepAwake.h
#import "RCTBridgeModule.h" @interface KCKeepAwake : NSObject <RCTBridgeModule> @end
#import <React/RCTBridgeModule.h> @interface KCKeepAwake : NSObject <RCTBridgeModule> @end
Correct import path to match RN 0.40
Correct import path to match RN 0.40
C
mit
corbt/react-native-keep-awake,corbt/react-native-keep-awake,corbt/react-native-keep-awake
2d6cf0686fb211408a6f5ed96ac5341f1c486aaa
kremlib/kremstr.c
kremlib/kremstr.c
#include "kremlib.h" #include "kremstr.h" /******************************************************************************/ /* Implementation of FStar.String and FStar.HyperIO */ /******************************************************************************/ /* FStar.h is generally kept for the program we wish to compile, meaning that * FStar.h contains extern declarations for the functions below. This provides * their implementation, and since the function prototypes are already in * FStar.h, we don't need to put these in the header, they will be resolved at * link-time. */ Prims_nat FStar_String_strlen(Prims_string s) { return strlen(s); } Prims_string FStar_String_strcat(Prims_string s0, Prims_string s1) { char *dest = calloc(strlen(s0) + strlen(s1) + 1, 1); strcat(dest, s0); strcat(dest, s1); return (Prims_string)dest; } Prims_string Prims_strcat(Prims_string s0, Prims_string s1) { return FStar_String_strcat(s0, s1); } void FStar_IO_debug_print_string(Prims_string s) { printf("%s", s); } bool __eq__Prims_string(Prims_string s1, Prims_string s2) { return (strcmp(s1, s2) == 0); }
#include "kremlib.h" #include "kremstr.h" /******************************************************************************/ /* Implementation of FStar.String and FStar.HyperIO */ /******************************************************************************/ /* FStar.h is generally kept for the program we wish to compile, meaning that * FStar.h contains extern declarations for the functions below. This provides * their implementation, and since the function prototypes are already in * FStar.h, we don't need to put these in the header, they will be resolved at * link-time. */ Prims_nat FStar_String_strlen(Prims_string s) { return strlen(s); } Prims_string FStar_String_strcat(Prims_string s0, Prims_string s1) { char *dest = calloc(strlen(s0) + strlen(s1) + 1, 1); strcat(dest, s0); strcat(dest, s1); return (Prims_string)dest; } Prims_string Prims_strcat(Prims_string s0, Prims_string s1) { return FStar_String_strcat(s0, s1); } void FStar_HyperStack_IO_print_string(Prims_string s) { printf("%s", s); } void FStar_IO_debug_print_string(Prims_string s) { printf("%s", s); } bool __eq__Prims_string(Prims_string s1, Prims_string s2) { return (strcmp(s1, s2) == 0); }
Revert "Try to catch up on upstream F* changes"
Revert "Try to catch up on upstream F* changes" This reverts commit 5b09f1f43b155df40caa8d8716075ccd7d08af26.
C
apache-2.0
FStarLang/kremlin,FStarLang/kremlin,FStarLang/kremlin,FStarLang/kremlin
57ca28bb8d019266a16ff18a87d71f12b59224b5
src/exercise112.c
src/exercise112.c
/* * A solution to Exercise 1-12 in The C Programming Language (Second Edition). * * This file was written by Damien Dart <[email protected]>. This is free * and unencumbered software released into the public domain. For more * information, please refer to the accompanying "UNLICENCE" file. */ #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> int main(void) { int16_t character = 0; bool in_whitespace = false; while ((character = getchar()) != EOF) { if ((character == ' ') || (character == '\t')) { if (in_whitespace == false) { putchar('\n'); in_whitespace = true; } } else { putchar(character); in_whitespace = false; } } return EXIT_SUCCESS; }
/* * A solution to Exercise 1-12 in The C Programming Language (Second Edition). * * This file was written by Damien Dart <[email protected]>. This is free * and unencumbered software released into the public domain. For more * information, please refer to the accompanying "UNLICENCE" file. */ #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> int main(void) { int16_t character = 0; bool in_whitespace = false; while ((character = getchar()) != EOF) { if ((character == ' ') || (character == '\t' || character == '\n')) { if (in_whitespace == false) { putchar('\n'); in_whitespace = true; } } else { putchar(character); in_whitespace = false; } } return EXIT_SUCCESS; }
Fix solution to Exercise 1-12.
Fix solution to Exercise 1-12. Fix solution to Exercise 1-12 so that newline characters are processed correctly.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
f4c69c820550a352cb123bfb0b16c33c659a4ca6
src/timezone/pgtz.c
src/timezone/pgtz.c
/*------------------------------------------------------------------------- * * pgtz.c * Timezone Library Integration Functions * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.5 2004/05/01 01:38:53 momjian Exp $ * *------------------------------------------------------------------------- */ #include "pgtz.h" #include "tzfile.h" static char tzdir[MAXPGPATH]; static int done_tzdir = 0; char * pg_TZDIR(void) { char *p; if (done_tzdir) return tzdir; #ifndef WIN32 StrNCpy(tzdir, PGDATADIR, MAXPGPATH); #else if (GetModuleFileName(NULL, tzdir, MAXPGPATH) == 0) return NULL; #endif canonicalize_path(tzdir); #if 0 if ((p = last_path_separator(tzdir)) == NULL) return NULL; else *p = '\0'; #endif strcat(tzdir, "/timezone"); done_tzdir = 1; return tzdir; }
/*------------------------------------------------------------------------- * * pgtz.c * Timezone Library Integration Functions * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.6 2004/05/01 22:07:03 momjian Exp $ * *------------------------------------------------------------------------- */ #include "pgtz.h" #include "tzfile.h" static char tzdir[MAXPGPATH]; static int done_tzdir = 0; char * pg_TZDIR(void) { char *p; if (done_tzdir) return tzdir; #ifndef WIN32 StrNCpy(tzdir, PGDATADIR, MAXPGPATH); #else if (GetModuleFileName(NULL, tzdir, MAXPGPATH) == 0) return NULL; #endif canonicalize_path(tzdir); #ifdef WIN32 /* trim off binary name, then go up a directory */ if ((p = last_path_separator(tzdir)) == NULL) return NULL; else *p = '\0'; strcat(tzdir, "/../share/timezone"); #endif strcat(tzdir, "/timezone"); done_tzdir = 1; return tzdir; }
Fix timezone data path for Unix and win32.
Fix timezone data path for Unix and win32.
C
apache-2.0
yuanzhao/gpdb,atris/gpdb,kmjungersen/PostgresXL,zeroae/postgres-xl,yuanzhao/gpdb,jmcatamney/gpdb,50wu/gpdb,yuanzhao/gpdb,rubikloud/gpdb,rvs/gpdb,lpetrov-pivotal/gpdb,techdragon/Postgres-XL,yuanzhao/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,lintzc/gpdb,rubikloud/gpdb,janebeckman/gpdb,lintzc/gpdb,Chibin/gpdb,janebeckman/gpdb,50wu/gpdb,Quikling/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,foyzur/gpdb,chrishajas/gpdb,cjcjameson/gpdb,janebeckman/gpdb,lintzc/gpdb,foyzur/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,ashwinstar/gpdb,rubikloud/gpdb,atris/gpdb,edespino/gpdb,kaknikhil/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,0x0FFF/gpdb,atris/gpdb,kaknikhil/gpdb,xuegang/gpdb,rvs/gpdb,xinzweb/gpdb,edespino/gpdb,zeroae/postgres-xl,adam8157/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,lpetrov-pivotal/gpdb,foyzur/gpdb,royc1/gpdb,0x0FFF/gpdb,randomtask1155/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,chrishajas/gpdb,jmcatamney/gpdb,arcivanov/postgres-xl,ahachete/gpdb,randomtask1155/gpdb,Quikling/gpdb,royc1/gpdb,xuegang/gpdb,edespino/gpdb,janebeckman/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,xinzweb/gpdb,snaga/postgres-xl,ovr/postgres-xl,ashwinstar/gpdb,chrishajas/gpdb,adam8157/gpdb,xuegang/gpdb,yazun/postgres-xl,tangp3/gpdb,edespino/gpdb,ovr/postgres-xl,edespino/gpdb,atris/gpdb,rvs/gpdb,chrishajas/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,chrishajas/gpdb,cjcjameson/gpdb,arcivanov/postgres-xl,pavanvd/postgres-xl,yuanzhao/gpdb,rubikloud/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,xuegang/gpdb,ahachete/gpdb,jmcatamney/gpdb,tangp3/gpdb,CraigHarris/gpdb,rubikloud/gpdb,edespino/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,kmjungersen/PostgresXL,rvs/gpdb,yuanzhao/gpdb,yazun/postgres-xl,ashwinstar/gpdb,zeroae/postgres-xl,Chibin/gpdb,ahachete/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,pavanvd/postgres-xl,lpetrov-pivotal/gpdb,randomtask1155/gpdb,techdragon/Postgres-XL,ovr/postgres-xl,chrishajas/gpdb,greenplum-db/gpdb,adam8157/gpdb,pavanvd/postgres-xl,tpostgres-projects/tPostgres,lpetrov-pivotal/gpdb,chrishajas/gpdb,Quikling/gpdb,CraigHarris/gpdb,yazun/postgres-xl,snaga/postgres-xl,lpetrov-pivotal/gpdb,yazun/postgres-xl,cjcjameson/gpdb,adam8157/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,lintzc/gpdb,arcivanov/postgres-xl,yuanzhao/gpdb,adam8157/gpdb,lisakowen/gpdb,Chibin/gpdb,Chibin/gpdb,jmcatamney/gpdb,kmjungersen/PostgresXL,snaga/postgres-xl,techdragon/Postgres-XL,jmcatamney/gpdb,adam8157/gpdb,xinzweb/gpdb,cjcjameson/gpdb,xinzweb/gpdb,edespino/gpdb,edespino/gpdb,lintzc/gpdb,tangp3/gpdb,50wu/gpdb,zaksoup/gpdb,yazun/postgres-xl,Chibin/gpdb,royc1/gpdb,xinzweb/gpdb,xuegang/gpdb,lisakowen/gpdb,chrishajas/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,foyzur/gpdb,ashwinstar/gpdb,royc1/gpdb,foyzur/gpdb,CraigHarris/gpdb,tpostgres-projects/tPostgres,0x0FFF/gpdb,foyzur/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,snaga/postgres-xl,snaga/postgres-xl,randomtask1155/gpdb,kmjungersen/PostgresXL,Quikling/gpdb,ahachete/gpdb,Chibin/gpdb,royc1/gpdb,ovr/postgres-xl,greenplum-db/gpdb,0x0FFF/gpdb,lisakowen/gpdb,zeroae/postgres-xl,Quikling/gpdb,Chibin/gpdb,zaksoup/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,techdragon/Postgres-XL,atris/gpdb,lintzc/gpdb,atris/gpdb,randomtask1155/gpdb,rvs/gpdb,tangp3/gpdb,janebeckman/gpdb,xuegang/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,kaknikhil/gpdb,ahachete/gpdb,xinzweb/gpdb,50wu/gpdb,janebeckman/gpdb,0x0FFF/gpdb,tangp3/gpdb,0x0FFF/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,postmind-net/postgres-xl,ahachete/gpdb,lisakowen/gpdb,rvs/gpdb,rubikloud/gpdb,postmind-net/postgres-xl,Quikling/gpdb,arcivanov/postgres-xl,Quikling/gpdb,zaksoup/gpdb,lintzc/gpdb,tangp3/gpdb,jmcatamney/gpdb,tpostgres-projects/tPostgres,50wu/gpdb,zaksoup/gpdb,rvs/gpdb,jmcatamney/gpdb,xuegang/gpdb,greenplum-db/gpdb,tangp3/gpdb,50wu/gpdb,50wu/gpdb,Chibin/gpdb,janebeckman/gpdb,postmind-net/postgres-xl,xuegang/gpdb,janebeckman/gpdb,Quikling/gpdb,oberstet/postgres-xl,tpostgres-projects/tPostgres,ahachete/gpdb,Chibin/gpdb,lpetrov-pivotal/gpdb,Quikling/gpdb,rvs/gpdb,Postgres-XL/Postgres-XL,edespino/gpdb,oberstet/postgres-xl,atris/gpdb,kaknikhil/gpdb,rvs/gpdb,cjcjameson/gpdb,lintzc/gpdb,Quikling/gpdb,rubikloud/gpdb,kaknikhil/gpdb,ovr/postgres-xl,ahachete/gpdb,royc1/gpdb,pavanvd/postgres-xl,kaknikhil/gpdb,kaknikhil/gpdb,zaksoup/gpdb,rubikloud/gpdb,Chibin/gpdb,lisakowen/gpdb,oberstet/postgres-xl,cjcjameson/gpdb,foyzur/gpdb,kaknikhil/gpdb,oberstet/postgres-xl,atris/gpdb,yuanzhao/gpdb,zaksoup/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,CraigHarris/gpdb,tangp3/gpdb,arcivanov/postgres-xl,zaksoup/gpdb,adam8157/gpdb,CraigHarris/gpdb,royc1/gpdb,janebeckman/gpdb,rvs/gpdb,xuegang/gpdb,adam8157/gpdb,50wu/gpdb,lintzc/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,yuanzhao/gpdb,royc1/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,foyzur/gpdb,CraigHarris/gpdb,lpetrov-pivotal/gpdb
49c893bd1e9f6e8bd808f517c37aaf053dcbea8b
test/CodeGen/fp128_complex.c
test/CodeGen/fp128_complex.c
// RUN: %clang -target aarch64-linux-gnuabi %s -O3 -S -emit-llvm -o - | FileCheck %s #include <complex.h> complex long double a, b, c, d; void test_fp128_compound_assign(void) { // CHECK: tail call { fp128, fp128 } @__multc3 a *= b; // CHECK: tail call { fp128, fp128 } @__divtc3 c /= d; }
// RUN: %clang -target aarch64-linux-gnuabi %s -O3 -S -emit-llvm -o - | FileCheck %s _Complex long double a, b, c, d; void test_fp128_compound_assign(void) { // CHECK: tail call { fp128, fp128 } @__multc3 a *= b; // CHECK: tail call { fp128, fp128 } @__divtc3 c /= d; }
Remove including <complex.h> in test case, and change to use _Complex instead.
Remove including <complex.h> in test case, and change to use _Complex instead. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@220258 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-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,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
5ced8e4fdfa8fd781c0a39b29597762cedcedec6
features/mbedtls/platform/inc/platform_mbed.h
features/mbedtls/platform/inc/platform_mbed.h
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is part of mbed TLS (https://tls.mbed.org) */ #if defined(DEVICE_TRNG) #define MBEDTLS_ENTROPY_HARDWARE_ALT #endif #if defined(MBEDTLS_CONFIG_HW_SUPPORT) #include "mbedtls_device.h" #endif
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is part of mbed TLS (https://tls.mbed.org) */ #if defined(DEVICE_TRNG) #define MBEDTLS_ENTROPY_HARDWARE_ALT #endif #if defined(DEVICE_RTC) #define MBEDTLS_HAVE_TIME_DATE #endif #if defined(MBEDTLS_CONFIG_HW_SUPPORT) #include "mbedtls_device.h" #endif
Integrate mbed OS RTC with mbed TLS
Integrate mbed OS RTC with mbed TLS The integration is simply to define the macro MBEDTLS_HAVE_TIME_DATE in the features/mbedtls/platform/inc/platform_mbed.h. The default implementation of the mbedtls_time() function provided by mbed TLS is sufficient to work with mbed OS because both use POSIX functions.
C
apache-2.0
c1728p9/mbed-os,mbedmicro/mbed,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,andcor02/mbed-os,kjbracey-arm/mbed,betzw/mbed-os,kjbracey-arm/mbed,kjbracey-arm/mbed,c1728p9/mbed-os,betzw/mbed-os,c1728p9/mbed-os,andcor02/mbed-os,andcor02/mbed-os,betzw/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,betzw/mbed-os,andcor02/mbed-os,betzw/mbed-os,kjbracey-arm/mbed,betzw/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os
7ab32e65bd6fb6d0cb0c475186fb4e3830f9fa82
cell.h
cell.h
#ifndef CELL_H #define CELL_H #include <map> #include <vector> #include "number.h" class Cell { public: Cell(); explicit Cell(const Cell &rhs); explicit Cell(Cell *value); explicit Cell(bool value); explicit Cell(Number value); explicit Cell(const std::string &value); explicit Cell(const char *value); explicit Cell(const std::vector<Cell> &value); explicit Cell(const std::map<std::string, Cell> &value); Cell &operator=(const Cell &rhs); bool operator==(const Cell &rhs) const; Cell *address_value; bool boolean_value; Number number_value; std::string string_value; std::vector<Cell> array_value; std::map<std::string, Cell> dictionary_value; }; #endif
#ifndef CELL_H #define CELL_H #include <map> #include <vector> #include "number.h" class Cell { public: Cell(); Cell(const Cell &rhs); explicit Cell(Cell *value); explicit Cell(bool value); explicit Cell(Number value); explicit Cell(const std::string &value); explicit Cell(const char *value); explicit Cell(const std::vector<Cell> &value); explicit Cell(const std::map<std::string, Cell> &value); Cell &operator=(const Cell &rhs); bool operator==(const Cell &rhs) const; Cell *address_value; bool boolean_value; Number number_value; std::string string_value; std::vector<Cell> array_value; std::map<std::string, Cell> dictionary_value; }; #endif
Remove 'explicit' on copy constructor
Remove 'explicit' on copy constructor
C
mit
ghewgill/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang
90209fa8998819f0379546da17e0f739424b8d56
test/testquazip.h
test/testquazip.h
#ifndef QUAZIP_TEST_QUAZIP_H #define QUAZIP_TEST_QUAZIP_H #include <QObject> class TestQuaZip: public QObject { Q_OBJECT private slots: void getFileList_data(); void getFileList(); void getZip(); }; #endif // QUAZIP_TEST_QUAZIP_H
#ifndef QUAZIP_TEST_QUAZIP_H #define QUAZIP_TEST_QUAZIP_H #include <QObject> class TestQuaZip: public QObject { Q_OBJECT private slots: void getFileList_data(); void getFileList(); }; #endif // QUAZIP_TEST_QUAZIP_H
Remove getZip() which got there by mistake
Remove getZip() which got there by mistake git-svn-id: 8ee2d06cc183b55da409a55e9abc82a01a576498@113 bf82bb6f-4128-0410-aed8-a7a134390cb4
C
lgpl-2.1
comargo/QuaZIP,slopjong/QuaZIP,slopjong/QuaZIP,comargo/QuaZIP
349c1d995eeede38b604a3284d0761d3c571c280
src/fake-lock-screen-pattern.h
src/fake-lock-screen-pattern.h
#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_ #define _FAKE_LOCK_SCREEN_PATTERN_H_ #include <gtk/gtk.h> #if !GTK_CHECK_VERSION(3, 0, 0) typedef struct { gdouble red; gdouble green; gdouble blue; gdouble alpha; } GdkRGBA; #endif typedef struct _FakeLockOption { void *module; gchar *real; gchar *dummy; } FakeLockOption; typedef struct { gboolean marked; gint value; GdkPoint top_left; GdkPoint bottom_right; } FakeLockPatternPoint; typedef enum { FLSP_ONE_STROKE, FLSP_ON_BOARD, FLSP_N_PATTERN, } FakeLockScreenPattern; void flsp_draw_circle(cairo_t *context, gint x, gint y, gint radius, GdkRGBA circle, GdkRGBA border); gboolean is_marked(gint x, gint y, gint *marked, void *user_data); #endif
#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_ #define _FAKE_LOCK_SCREEN_PATTERN_H_ #include <gtk/gtk.h> #if !GTK_CHECK_VERSION(3, 0, 0) typedef struct { gdouble red; gdouble green; gdouble blue; gdouble alpha; } GdkRGBA; #endif typedef struct _FakeLockOption { void *module; gchar *real; gchar *dummy; } FakeLockOption; typedef struct { gint mark; gint value; GdkPoint top_left; GdkPoint bottom_right; } FakeLockPatternPoint; typedef enum { FLSP_ONE_STROKE, FLSP_ON_BOARD, FLSP_N_PATTERN, } FakeLockScreenPattern; void flsp_draw_circle(cairo_t *context, gint x, gint y, gint radius, GdkRGBA circle, GdkRGBA border); gboolean is_marked(gint x, gint y, gint *marked, void *user_data); #endif
Use gint to store index
Use gint to store index
C
mit
kenhys/fake-lock-screen-pattern,kenhys/fake-lock-screen-pattern
42ce77eef9b32dd518d8f35f98f176950d2ef53a
utils/commander.c
utils/commander.c
#ifndef _WISH_COMMANDER #define _WISH_COMMANDER #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/wait.h> char *exit_color; int execute(char *path, char *arg_arr[]) { int pid; if (!(pid = fork())) { execvp(path, arg_arr); // This is only reached if the execvp function fails exit(-1); } else { int status; wait(&status); return status; } } int get_and_run_userin() { char buff[256]; fgets(buff, sizeof(buff), stdin); // Buff will have space-separated command line arguments, then a newline, // then a terminating null. We can use strsep to get rid of the newline. // Since fgets will terminate on the first newline, we can be certain there // is no next command after it char *ptr_to_buff = buff; char *command = strsep(&ptr_to_buff, "\n"); // Blank lines should just return 0, since a blank command doesn't 'crash' if (!(*command)) { return 0; } int num_args = 1; int i; for (i = 0; command[i]; i++) { if (command[i] == ' ') num_args++; } char *args[num_args + 1]; for (i = 0; i < num_args; i++) { args[i] = strsep(&command, " "); } args[num_args] = NULL; return execute(args[0], args); } #endif
Add file to handle executing commands from stdin
Add file to handle executing commands from stdin
C
mit
elc1798/wish
5b7bc8baba35bc816c7dc94768d9fae05c7b78ec
zephyr/shim/include/zephyr_host_command.h
zephyr/shim/include/zephyr_host_command.h
/* 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. */ #if !defined(__CROS_EC_HOST_COMMAND_H) || \ defined(__CROS_EC_ZEPHYR_HOST_COMMAND_H) #error "This file must only be included from host_command.h. " \ "Include host_command.h directly" #endif #define __CROS_EC_ZEPHYR_HOST_COMMAND_H #include <init.h> #ifdef CONFIG_PLATFORM_EC_HOSTCMD /** * See include/host_command.h for documentation. */ #define DECLARE_HOST_COMMAND(_command, _routine, _version_mask) \ STRUCT_SECTION_ITERABLE(host_command, _cros_hcmd_##_command) = { \ .command = _command, \ .handler = _routine, \ .version_mask = _version_mask, \ } #else /* !CONFIG_PLATFORM_EC_HOSTCMD */ #ifdef __clang__ #define DECLARE_HOST_COMMAND(command, routine, version_mask) #else #define DECLARE_HOST_COMMAND(command, routine, version_mask) \ enum ec_status (routine)(struct host_cmd_handler_args *args) \ __attribute__((unused)) #endif /* __clang__ */ #endif /* CONFIG_PLATFORM_EC_HOSTCMD */
/* 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. */ #if !defined(__CROS_EC_HOST_COMMAND_H) || \ defined(__CROS_EC_ZEPHYR_HOST_COMMAND_H) #error "This file must only be included from host_command.h. " \ "Include host_command.h directly" #endif #define __CROS_EC_ZEPHYR_HOST_COMMAND_H #include <init.h> #ifdef CONFIG_PLATFORM_EC_HOSTCMD /** * See include/host_command.h for documentation. */ #define DECLARE_HOST_COMMAND(_command, _routine, _version_mask) \ STRUCT_SECTION_ITERABLE(host_command, _cros_hcmd_##_command) = { \ .command = _command, \ .handler = _routine, \ .version_mask = _version_mask, \ } #else /* !CONFIG_PLATFORM_EC_HOSTCMD */ /* * Create a fake routine to call the function. The linker should * garbage-collect it since it is behind 'if (0)' */ #define DECLARE_HOST_COMMAND(command, routine, version_mask) \ int __remove_ ## command(void) \ { \ if (0) \ routine(NULL); \ return 0; \ } #endif /* CONFIG_PLATFORM_EC_HOSTCMD */
Use a different way of handling no host commands
zephyr: Use a different way of handling no host commands When CONFIG_PLATFORM_EC_HOSTCMD is not enabled we want to silently drop the handler routines from the build. The current approach works for gcc but not for clang. Use an exported function instead. BUG=b:208648337 BRANCH=none TEST=CQ and gitlab Signed-off-by: Simon Glass <[email protected]> Change-Id: I63f74e8081556c726472782f60bddbbfbc3e9bf0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3313320 Reviewed-by: Jeremy Bettis <[email protected]>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
f6a808e5190055af32abe8060bbe7d4ab2d5d6d4
Nocilla/LSNocilla.h
Nocilla/LSNocilla.h
#import <Foundation/Foundation.h> #import "Nocilla.h" #import "LSHTTPRequest.h" @class LSStubRequest; @class LSStubResponse; extern NSString * const LSUnexpectedRequest; @interface LSNocilla : NSObject + (LSNocilla *)sharedInstance; @property (nonatomic, strong, readonly) NSArray *stubbedRequests; - (void)start; - (void)stop; - (void)addStubbedRequest:(LSStubRequest *)request; - (void)clearStubs; - (LSStubResponse *)responseForRequest:(id<LSHTTPRequest>)request; @end
#import <Foundation/Foundation.h> #import "Nocilla.h" @class LSStubRequest; @class LSStubResponse; @protocol LSHTTPRequest; extern NSString * const LSUnexpectedRequest; @interface LSNocilla : NSObject + (LSNocilla *)sharedInstance; @property (nonatomic, strong, readonly) NSArray *stubbedRequests; - (void)start; - (void)stop; - (void)addStubbedRequest:(LSStubRequest *)request; - (void)clearStubs; - (LSStubResponse *)responseForRequest:(id<LSHTTPRequest>)request; @end
Replace import with forward declaration.
Replace import with forward declaration.
C
mit
pcantrell/Nocilla,ileitch/Nocilla,luisobo/Nocilla,0xmax/Nocilla,patcheng/Nocilla,tomguthrie/Nocilla,Panajev/Nocilla,luxe-eng/valet-ios.Nocilla,SanjoDeundiak/Nocilla,TheAdamBorek/Nocilla,luxe-eng/valet-ios.Nocilla,0xmax/Nocilla,TheAdamBorek/Nocilla
f42bb8f845e08da0982a5b8c1c57374ddffdc0b3
Queue/array_queue.c
Queue/array_queue.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> /* This is Queue Implementation using Array */ #define MAXSIZE 101 #define BOOL_PRINT(bool_expr) "%s\n", (bool_expr) ? "true" : "false" int A[MAXSIZE]; int front_q = -1; int end_q = -1; void enq(int data){ if(isEmpty()){ A[++end_q]=data; front_q ++; return; } if (end_q < MAXSIZE-1){ A[++end_q] = data; } else{ printf("Error: Queue is full \n"); return; } } int deq(){ if(front_q != -1 && front_q <= end_q){ return A[front_q++]; } else{ printf("Error: Queue is empty \n"); return -1; } } int isEmpty(){ if(front_q!= -1) return false; else return true; } void q_print(){ printf("Queue is : "); int i,data; int count =end_q; int start = front_q; for(i =start; i<=count;i++){ data = deq(); printf("%d ", data); } printf("\n"); } int main(){ int i; printf("is queue empty? \n"); printf(BOOL_PRINT(isEmpty())); enq(10); printf("front_q is at %d end_q is at %d \n",front_q,end_q); enq(11); printf("front_q is at %d end_q is at %d \n",front_q,end_q); enq(12); printf("front_q is at %d end_q is at %d \n",front_q,end_q); enq(15); printf("front_q is at %d end_q is at %d \n",front_q,end_q); i = deq(); printf("Popped data is %d\n",i ); printf("front_q is at %d end_q is at %d \n",front_q,end_q); q_print(); // Note: this is just for vizualizing and this actually results in loss of queue data return 0; }
Add array implementation of queue
Add array implementation of queue
C
mit
anaghajoshi/C_DataStructures_Algorithms
14870a46f26f2586a29731508842e04ac48cc5ca
display_device.h
display_device.h
/* Copyright (c) 2013 Adam Dej 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 __DISPLAY_DEVICE_H #define __DISPLAY_DEVICE_H #include <stdint.h> #include <stdbool.h> #ifdef EMBDEGFX_16 typedef uint16_t uintpix; #else typedef uint8_t uintpix; #endif typedef struct { void *data; bool (*set_pixel)(uintpix x, uintpix y, void *data); bool (*unset_pixel)(uintpix x, uintpix y, void *data); bool (*clear_display)(void *data); bool (*commit)(void *data); } DISPLAY_1BIT; typedef struct { //TODO } DISPLAY_8BIT; typedef struct { //TODO } DISPLAY_24BIT; //If none of those modes is suitable feel free to add your own #endif
Add header with structs representing basic display types
Add header with structs representing basic display types
C
mit
adam-dej/embegfx,adam-dej/embegfx,adam-dej/embegfx
ad24240e3d614bf8c10199590571a48ac3debc6e
test/profile/instrprof-basic.c
test/profile/instrprof-basic.c
// RUN: %clang_profgen -o %t -O3 -flto %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1 if (argc) return 0; return 1; } // CHECK: !1 = metadata !{metadata !"branch_weights", i32 2, i32 1}
// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1 if (argc) return 0; return 1; } // CHECK: !1 = metadata !{metadata !"branch_weights", i32 2, i32 1}
Remove LTO dependency from test
InstrProf: Remove LTO dependency from test The -flto flag relies on linker features that are not available on all platforms. <rdar://problem/16458307> git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@205318 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
ee12c53b52716c08c50bf0c64b644c9af5be10de
SAMCategories/SAMCategories.h
SAMCategories/SAMCategories.h
// // SAMCategories.h // SAMCategories // // Created by Sam Soffes on 7/17/13. // Copyright 2013 Sam Soffes. All rights reserved. // // Foundation #import "NSArray+SAMAdditions.h" #import "NSData+SAMAdditions.h" #import "NSDate+SAMAdditions.h" #import "NSDictionary+SAMAdditions.h" #import "NSNumber+SAMAdditions.h" #import "NSObject+SAMAdditions.h" #import "NSString+SAMAdditions.h" #import "NSURL+SAMAdditions.h" // UIKit #if TARGET_OS_IPHONE #import "UIApplication+SAMAdditions.h" #import "UIColor+SAMAdditions.h" #import "UIDevice+SAMAdditions.h" #import "UIScreen+SAMAdditions.h" #import "UIScrollView+SAMAdditions.h" #import "UIView+SAMAdditions.h" #import "UIViewController+SAMAdditions.h" #endif
// // SAMCategories.h // SAMCategories // // Created by Sam Soffes on 7/17/13. // Copyright 2013 Sam Soffes. All rights reserved. // // Foundation #import "NSArray+SAMAdditions.h" #import "NSData+SAMAdditions.h" #import "NSDate+SAMAdditions.h" #import "NSDictionary+SAMAdditions.h" #import "NSNumber+SAMAdditions.h" #import "NSObject+SAMAdditions.h" #import "NSString+SAMAdditions.h" #import "NSURL+SAMAdditions.h" // UIKit #if TARGET_OS_IPHONE #import "UIApplication+SAMAdditions.h" #import "UIColor+SAMAdditions.h" #import "UIControl+SAMAdditions.h" #import "UIDevice+SAMAdditions.h" #import "UIScreen+SAMAdditions.h" #import "UIScrollView+SAMAdditions.h" #import "UIView+SAMAdditions.h" #import "UIViewController+SAMAdditions.h" #endif
Add missing import for UIControl+SAMAdditions.h
Add missing import for UIControl+SAMAdditions.h
C
mit
soffes/SAMCategories,cloudjanak/SAMCategories
91dbe918a3ed65fa8a057d7ced6ffc2016857d50
SwiftDevHints/SwiftDevHints.h
SwiftDevHints/SwiftDevHints.h
// // SwiftDevHints.h // SwiftDevHints // // Created by ZHOU DENGFENG on 15/7/17. // Copyright © 2017 ZHOU DENGFENG DEREK. All rights reserved. // #import <UIKit/UIKit.h> #import <CommonCrypto/CommonCrypto.h> //! Project version number for SwiftDevHints. FOUNDATION_EXPORT double SwiftDevHintsVersionNumber; //! Project version string for SwiftDevHints. FOUNDATION_EXPORT const unsigned char SwiftDevHintsVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <SwiftDevHints/PublicHeader.h>
// // SwiftDevHints.h // SwiftDevHints // // Created by ZHOU DENGFENG on 15/7/17. // Copyright © 2017 ZHOU DENGFENG DEREK. All rights reserved. // @import Foundation; #import <CommonCrypto/CommonCrypto.h> //! Project version number for SwiftDevHints. FOUNDATION_EXPORT double SwiftDevHintsVersionNumber; //! Project version string for SwiftDevHints. FOUNDATION_EXPORT const unsigned char SwiftDevHintsVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <SwiftDevHints/PublicHeader.h>
Remove UIKit import to support macOS
Remove UIKit import to support macOS
C
mit
derekcoder/SwiftDevHints,derekcoder/SwiftDevHints
8ad9143cc688ba501223684d2eb723f5c46237b2
test/wasm/soft/float/addtf3.c
test/wasm/soft/float/addtf3.c
#include "src/math/reinterpret.h" #include <assert.h> long double __addtf3(long double, long double); static _Bool equivalent(long double x, long double y) { if (x != x) return y != y; return reinterpret(unsigned __int128, x) == reinterpret(unsigned __int128, y); } static _Bool run(long double x, long double y) { return equivalent(x + y, __addtf3(x, y)); } #define TEST(x, y) do { \ _Static_assert(__builtin_constant_p((long double)(x) + (long double)(y)), "This test requires compile-time constants"); \ assert(run(x, y)); \ } while (0)
#include "src/math/reinterpret.h" #include <math.h> #include <assert.h> long double __addtf3(long double, long double); static _Bool run(long double x, long double y) { return reinterpret(unsigned __int128, x + y) == reinterpret(unsigned __int128, __addtf3(x, y)); } int main(void) { assert(isnan(__addtf3(NAN, NAN))); assert(isnan(__addtf3(NAN, INFINITY))); assert(isnan(__addtf3(NAN, 0x1.23456789abcdefp+3L))); assert(isnan(__addtf3(INFINITY, -INFINITY))); assert(run(INFINITY, INFINITY)); assert(run(INFINITY, -0x1.23456789abcdefp+3849L)); }
Test non-finite soft float addition
Test non-finite soft float addition
C
mit
jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic
7bed25a23f0967cc5a57bfe913416a85a59fd913
tests-clar/attr/attr_expect.h
tests-clar/attr/attr_expect.h
#ifndef __CLAR_TEST_ATTR_EXPECT__ #define __CLAR_TEST_ATTR_EXPECT__ enum attr_expect_t { EXPECT_FALSE, EXPECT_TRUE, EXPECT_UNDEFINED, EXPECT_STRING }; struct attr_expected { const char *path; const char *attr; enum attr_expect_t expected; const char *expected_str; }; static inline void attr_check_expected( enum attr_expect_t expected, const char *expected_str, const char *value) { switch (expected) { case EXPECT_TRUE: cl_assert(GIT_ATTR_TRUE(value)); break; case EXPECT_FALSE: cl_assert(GIT_ATTR_FALSE(value)); break; case EXPECT_UNDEFINED: cl_assert(GIT_ATTR_UNSPECIFIED(value)); break; case EXPECT_STRING: cl_assert_strequal(expected_str, value); break; } } #endif
#ifndef __CLAR_TEST_ATTR_EXPECT__ #define __CLAR_TEST_ATTR_EXPECT__ enum attr_expect_t { EXPECT_FALSE, EXPECT_TRUE, EXPECT_UNDEFINED, EXPECT_STRING }; struct attr_expected { const char *path; const char *attr; enum attr_expect_t expected; const char *expected_str; }; GIT_INLINE(void) attr_check_expected( enum attr_expect_t expected, const char *expected_str, const char *value) { switch (expected) { case EXPECT_TRUE: cl_assert(GIT_ATTR_TRUE(value)); break; case EXPECT_FALSE: cl_assert(GIT_ATTR_FALSE(value)); break; case EXPECT_UNDEFINED: cl_assert(GIT_ATTR_UNSPECIFIED(value)); break; case EXPECT_STRING: cl_assert_strequal(expected_str, value); break; } } #endif
Fix the build on Windows
Fix the build on Windows
C
lgpl-2.1
saurabhsuniljain/libgit2,joshtriplett/libgit2,stewid/libgit2,magnus98/TEST,mrksrm/Mingijura,swisspol/DEMO-libgit2,oaastest/libgit2,Tousiph/Demo1,maxiaoqian/libgit2,Corillian/libgit2,amyvmiwei/libgit2,kenprice/libgit2,t0xicCode/libgit2,Snazz2001/libgit2,sygool/libgit2,evhan/libgit2,maxiaoqian/libgit2,mrksrm/Mingijura,JIghtuse/libgit2,nacho/libgit2,amyvmiwei/libgit2,falqas/libgit2,rcorre/libgit2,kenprice/libgit2,MrHacky/libgit2,zodiac/libgit2.js,mingyaaaa/libgit2,JIghtuse/libgit2,jflesch/libgit2-mariadb,KTXSoftware/libgit2,linquize/libgit2,nacho/libgit2,maxiaoqian/libgit2,linquize/libgit2,Snazz2001/libgit2,sim0629/libgit2,Corillian/libgit2,dleehr/libgit2,chiayolin/libgit2,since2014/libgit2,Corillian/libgit2,swisspol/DEMO-libgit2,MrHacky/libgit2,ardumont/libgit2,chiayolin/libgit2,spraints/libgit2,swisspol/DEMO-libgit2,JIghtuse/libgit2,iankronquist/libgit2,amyvmiwei/libgit2,jeffhostetler/public_libgit2,yosefhackmon/libgit2,saurabhsuniljain/libgit2,Snazz2001/libgit2,saurabhsuniljain/libgit2,spraints/libgit2,mingyaaaa/libgit2,claudelee/libgit2,linquize/libgit2,ardumont/libgit2,saurabhsuniljain/libgit2,dleehr/libgit2,mcanthony/libgit2,mhp/libgit2,zodiac/libgit2.js,nokiddin/libgit2,spraints/libgit2,Aorjoa/libgit2_maked_lib,leoyanggit/libgit2,whoisj/libgit2,t0xicCode/libgit2,Aorjoa/libgit2_maked_lib,yosefhackmon/libgit2,Tousiph/Demo1,Corillian/libgit2,MrHacky/libgit2,oaastest/libgit2,stewid/libgit2,nokiddin/libgit2,kissthink/libgit2,t0xicCode/libgit2,saurabhsuniljain/libgit2,whoisj/libgit2,JIghtuse/libgit2,zodiac/libgit2.js,stewid/libgit2,kissthink/libgit2,kenprice/libgit2,falqas/libgit2,dleehr/libgit2,leoyanggit/libgit2,leoyanggit/libgit2,linquize/libgit2,linquize/libgit2,dleehr/libgit2,mhp/libgit2,rcorre/libgit2,jeffhostetler/public_libgit2,whoisj/libgit2,JIghtuse/libgit2,since2014/libgit2,amyvmiwei/libgit2,stewid/libgit2,jflesch/libgit2-mariadb,sygool/libgit2,Tousiph/Demo1,ardumont/libgit2,KTXSoftware/libgit2,maxiaoqian/libgit2,sim0629/libgit2,claudelee/libgit2,jflesch/libgit2-mariadb,JIghtuse/libgit2,claudelee/libgit2,t0xicCode/libgit2,yosefhackmon/libgit2,yongthecoder/libgit2,stewid/libgit2,nacho/libgit2,falqas/libgit2,ardumont/libgit2,MrHacky/libgit2,KTXSoftware/libgit2,kissthink/libgit2,mcanthony/libgit2,raybrad/libit2,jamieleecool/ptest,iankronquist/libgit2,Corillian/libgit2,yosefhackmon/libgit2,iankronquist/libgit2,sygool/libgit2,jflesch/libgit2-mariadb,mhp/libgit2,nokiddin/libgit2,dleehr/libgit2,chiayolin/libgit2,jamieleecool/ptest,magnus98/TEST,raybrad/libit2,since2014/libgit2,mrksrm/Mingijura,Snazz2001/libgit2,jamieleecool/ptest,claudelee/libgit2,dleehr/libgit2,magnus98/TEST,iankronquist/libgit2,joshtriplett/libgit2,Snazz2001/libgit2,skabel/manguse,since2014/libgit2,claudelee/libgit2,skabel/manguse,oaastest/libgit2,jeffhostetler/public_libgit2,joshtriplett/libgit2,falqas/libgit2,jamieleecool/ptest,Aorjoa/libgit2_maked_lib,yosefhackmon/libgit2,swisspol/DEMO-libgit2,raybrad/libit2,kenprice/libgit2,sygool/libgit2,Tousiph/Demo1,sim0629/libgit2,raybrad/libit2,kissthink/libgit2,stewid/libgit2,Aorjoa/libgit2_maked_lib,saurabhsuniljain/libgit2,skabel/manguse,zodiac/libgit2.js,amyvmiwei/libgit2,joshtriplett/libgit2,nacho/libgit2,yongthecoder/libgit2,mingyaaaa/libgit2,Aorjoa/libgit2_maked_lib,nokiddin/libgit2,oaastest/libgit2,nokiddin/libgit2,magnus98/TEST,yosefhackmon/libgit2,yongthecoder/libgit2,ardumont/libgit2,Tousiph/Demo1,whoisj/libgit2,kissthink/libgit2,mhp/libgit2,jflesch/libgit2-mariadb,mingyaaaa/libgit2,yongthecoder/libgit2,mcanthony/libgit2,kenprice/libgit2,zodiac/libgit2.js,falqas/libgit2,spraints/libgit2,mcanthony/libgit2,whoisj/libgit2,since2014/libgit2,sim0629/libgit2,kissthink/libgit2,KTXSoftware/libgit2,maxiaoqian/libgit2,iankronquist/libgit2,sim0629/libgit2,evhan/libgit2,oaastest/libgit2,iankronquist/libgit2,t0xicCode/libgit2,skabel/manguse,leoyanggit/libgit2,swisspol/DEMO-libgit2,joshtriplett/libgit2,sim0629/libgit2,chiayolin/libgit2,skabel/manguse,whoisj/libgit2,spraints/libgit2,spraints/libgit2,mingyaaaa/libgit2,mingyaaaa/libgit2,since2014/libgit2,joshtriplett/libgit2,rcorre/libgit2,mcanthony/libgit2,mrksrm/Mingijura,jflesch/libgit2-mariadb,oaastest/libgit2,skabel/manguse,leoyanggit/libgit2,claudelee/libgit2,KTXSoftware/libgit2,Tousiph/Demo1,mhp/libgit2,jeffhostetler/public_libgit2,rcorre/libgit2,sygool/libgit2,ardumont/libgit2,evhan/libgit2,mrksrm/Mingijura,Snazz2001/libgit2,chiayolin/libgit2,mrksrm/Mingijura,rcorre/libgit2,Corillian/libgit2,falqas/libgit2,maxiaoqian/libgit2,chiayolin/libgit2,sygool/libgit2,amyvmiwei/libgit2,yongthecoder/libgit2,KTXSoftware/libgit2,mhp/libgit2,kenprice/libgit2,rcorre/libgit2,linquize/libgit2,yongthecoder/libgit2,raybrad/libit2,magnus98/TEST,leoyanggit/libgit2,nokiddin/libgit2,MrHacky/libgit2,swisspol/DEMO-libgit2,jeffhostetler/public_libgit2,evhan/libgit2,t0xicCode/libgit2,magnus98/TEST,jeffhostetler/public_libgit2,MrHacky/libgit2,mcanthony/libgit2
dc2edbb5925de782ba73ce7e2e496c17b5427cff
reptyr.h
reptyr.h
/* * Copyright (C) 2011 by Nelson Elhage * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #define REPTYR_VERSION "0.4" int attach_child(pid_t pid, const char *pty, int force_stdio); #define __printf __attribute__((format(printf, 1, 2))) void __printf die(const char *msg, ...); void __printf debug(const char *msg, ...); void __printf error(const char *msg, ...);
/* * Copyright (C) 2011 by Nelson Elhage * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #define REPTYR_VERSION "0.4dev" int attach_child(pid_t pid, const char *pty, int force_stdio); #define __printf __attribute__((format(printf, 1, 2))) void __printf die(const char *msg, ...); void __printf debug(const char *msg, ...); void __printf error(const char *msg, ...);
Bump the version number for development.
Bump the version number for development.
C
mit
nelhage/reptyr,jerome-pouiller/reredirect,yatsek/reptyr,yatsek/reptyr,nelhage/reptyr,yatsek/reptyr,developerfm/reptyr,developerfm/reptyr,developerfm/reptyr,nelhage/reptyr,jerome-pouiller/reredirect
b4324c4e201ad7a0ee1f5a316cbc119cd8be33c2
OpenMRS-iOS/EditPatientForm.h
OpenMRS-iOS/EditPatientForm.h
// // EditPatientForm.h // OpenMRS-iOS // // Created by Yousef Hamza on 7/5/15. // Copyright (c) 2015 Erway Software. All rights reserved. // #import "XLForm.h" #import "XLFormViewController.h" #import "MRSPatient.h" @interface EditPatientForm : XLFormViewController <UIAlertViewDelegate> - (instancetype)initWithPatient:(MRSPatient *)patient; @property (nonatomic, strong) MRSPatient *patient; @end
// // EditPatientForm.h // OpenMRS-iOS // // Created by Yousef Hamza on 7/5/15. // Copyright (c) 2015 Erway Software. All rights reserved. // #import "XLForm.h" #import "XLFormViewController.h" #import "MRSPatient.h" @interface EditPatientForm : XLFormViewController <UIAlertViewDelegate> @property (nonatomic, strong) MRSPatient *patient; - (instancetype)initWithPatient:(MRSPatient *)patient; @end
Move method after property declaration
Move method after property declaration
C
mpl-2.0
Undo1/openmrs-contrib-ios-client,Undo1/openmrs-contrib-ios-client,yousefhamza/openmrs-contrib-ios-client,yousefhamza/openmrs-contrib-ios-client
b781d46789fdbe4ae039ba622d1285b3a09afda3
arch/mvme88k/include/setjmp.h
arch/mvme88k/include/setjmp.h
/* $OpenBSD: setjmp.h,v 1.6 2001/08/12 12:03:02 heko Exp $ */ /* * machine/setjmp.h: machine dependent setjmp-related information. */ #ifndef __MACHINE_SETJMP_H__ #define __MACHINE_SETJMP_H__ #define _JBLEN 22 /* size, in longs, of a jmp_buf */ #endif /* __MACHINE_SETJMP_H__ */
/* $OpenBSD: setjmp.h,v 1.7 2003/08/01 07:41:33 miod Exp $ */ /* * machine/setjmp.h: machine dependent setjmp-related information. */ #ifndef __MACHINE_SETJMP_H__ #define __MACHINE_SETJMP_H__ #define _JBLEN 21 /* size, in longs, of a jmp_buf */ #endif /* __MACHINE_SETJMP_H__ */
Fix the *longjmp() behaviour - it is legal to reuse a jmp_buf several times. Gets us a working perl 5.8.
Fix the *longjmp() behaviour - it is legal to reuse a jmp_buf several times. Gets us a working perl 5.8.
C
isc
orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars
5662584a00d224dbfc0510fa97fcc96f0dfdbb1e
lib/vpsc/blocks.h
lib/vpsc/blocks.h
/** * \brief A block structure defined over the variables * * A block structure defined over the variables such that each block contains * 1 or more variables, with the invariant that all constraints inside a block * are satisfied by keeping the variables fixed relative to one another * * Authors: * Tim Dwyer <[email protected]> * * Copyright (C) 2005 Authors * * This version is released under the CPL (Common Public License) with * the Graphviz distribution. * A version is also available under the LGPL as part of the Adaptagrams * project: http://sourceforge.net/projects/adaptagrams. * If you make improvements or bug fixes to this code it would be much * appreciated if you could also contribute those changes back to the * Adaptagrams repository. */ #ifndef SEEN_REMOVEOVERLAP_BLOCKS_H #define SEEN_REMOVEOVERLAP_BLOCKS_H #ifdef RECTANGLE_OVERLAP_LOGGING #define LOGFILE "cRectangleOverlap.log" #endif #include <set> #include <list> class Block; class Variable; class Constraint; /** * A block structure defined over the variables such that each block contains * 1 or more variables, with the invariant that all constraints inside a block * are satisfied by keeping the variables fixed relative to one another */ class Blocks : public std::set<Block*> { public: Blocks(const int n, Variable *vs[]); ~Blocks(void); void mergeLeft(Block *r); void mergeRight(Block *l); void split(Block *b, Block *&l, Block *&r, Constraint *c); std::list<Variable*> *totalOrder(); void cleanup(); double cost(); private: void dfsVisit(Variable *v, std::list<Variable*> *order); void removeBlock(Block *doomed); Variable **vs; int nvs; }; extern long blockTimeCtr; #endif // SEEN_REMOVEOVERLAP_BLOCKS_H
Add the vpsc library for IPSEPCOLA features
Add the vpsc library for IPSEPCOLA features
C
epl-1.0
ellson/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,ellson/graphviz,BMJHayward/graphviz,pixelglow/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,pixelglow/graphviz,tkelman/graphviz,kbrock/graphviz,jho1965us/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,ellson/graphviz,MjAbuz/graphviz,pixelglow/graphviz,MjAbuz/graphviz,jho1965us/graphviz,jho1965us/graphviz,pixelglow/graphviz,jho1965us/graphviz,kbrock/graphviz,tkelman/graphviz,jho1965us/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,kbrock/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,kbrock/graphviz,ellson/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,tkelman/graphviz,kbrock/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,kbrock/graphviz,jho1965us/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,ellson/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,kbrock/graphviz,kbrock/graphviz,pixelglow/graphviz,jho1965us/graphviz,pixelglow/graphviz,jho1965us/graphviz,jho1965us/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,pixelglow/graphviz,tkelman/graphviz,tkelman/graphviz,BMJHayward/graphviz,jho1965us/graphviz,ellson/graphviz,MjAbuz/graphviz,kbrock/graphviz,pixelglow/graphviz,BMJHayward/graphviz
42d282fd4f4dc53389fe62eba8b934cb7174acf0
include/lldb/lldb-python.h
include/lldb/lldb-python.h
//===-- lldb-python.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_lldb_python_h_ #define LLDB_lldb_python_h_ // Python.h needs to be included before any system headers in order to avoid redefinition of macros #ifdef LLDB_DISABLE_PYTHON // Python is disabled in this build #else #include <Python/Python.h> #endif // LLDB_DISABLE_PYTHON #endif // LLDB_lldb_python_h_
//===-- lldb-python.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_lldb_python_h_ #define LLDB_lldb_python_h_ // Python.h needs to be included before any system headers in order to avoid redefinition of macros #ifdef LLDB_DISABLE_PYTHON // Python is disabled in this build #else #ifdef __FreeBSD__ #include <Python.h> #else #include <Python/Python.h> #endif #endif // LLDB_DISABLE_PYTHON #endif // LLDB_lldb_python_h_
Fix build on FreeBSD after r196141
Fix build on FreeBSD after r196141 This should probably be replaced with build infrastructure support for a platform-specific canonical Python include path, but for now it should restore the FreeBSD buildbot. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@196167 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb
963c9b00874672a03e4f1251bcdde9f5d929a81a
src/math/p_itof.c
src/math/p_itof.c
#include <pal.h> /** * * Converts integer values in 'a' to floating point values. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with * * @return None * */ #include <math.h> void p_itof(int *a, float *c, int n, int p, p_team_t team) { int i; for(i = 0; i < n; i++) { *(c + i) = (float)(*(a + i)); } }
#include <pal.h> /** * * Converts integer values in 'a' to floating point values. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with * * @return None * */ #include <math.h> void p_itof(int *a, float *c, int n, int p, p_team_t team) { for(int i = 0; i < n; i++) { *(c + i) = (float)(*(a + i)); } }
Initialize variable in the declaration
Initialize variable in the declaration Google style guide http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Local_Variables "Place a function's variables in the narrowest scope possible, and initialize variables in the declaration." Signed-off-by: Tom Anderson <[email protected]>
C
apache-2.0
eliteraspberries/pal,RafaelRMA/pal,8l/pal,debug-de-su-ka/pal,mateunho/pal,aolofsson/pal,Adamszk/pal3,parallella/pal,olajep/pal,eliteraspberries/pal,parallella/pal,mateunho/pal,Adamszk/pal3,RafaelRMA/pal,RafaelRMA/pal,8l/pal,debug-de-su-ka/pal,8l/pal,debug-de-su-ka/pal,olajep/pal,aolofsson/pal,parallella/pal,mateunho/pal,Adamszk/pal3,debug-de-su-ka/pal,olajep/pal,parallella/pal,eliteraspberries/pal,eliteraspberries/pal,debug-de-su-ka/pal,parallella/pal,aolofsson/pal,aolofsson/pal,8l/pal,mateunho/pal,RafaelRMA/pal,mateunho/pal,Adamszk/pal3,olajep/pal,eliteraspberries/pal
e194d0bc205719c2359ab339be64b93154106500
src/pythoninlua.h
src/pythoninlua.h
/* Lunatic Python -------------- Copyright (c) 2002-2005 Gustavo Niemeyer <[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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef PYTHONINLUA_H #define PYTHONINLUA_H #define POBJECT "POBJECT" int py_convert(lua_State *L, PyObject *o, int withnone); typedef struct { PyObject *o; int asindx; } py_object; void stackDump(lua_State *L); void tableDump(lua_State *L, int t); py_object *check_py_object(lua_State *L, int ud); LUA_API int luaopen_python(lua_State *L); #endif
/* Lunatic Python -------------- Copyright (c) 2002-2005 Gustavo Niemeyer <[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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef PYTHONINLUA_H #define PYTHONINLUA_H #define POBJECT "PyObject" int py_convert(lua_State *L, PyObject *o, int withnone); typedef struct { PyObject *o; int asindx; } py_object; void stackDump(lua_State *L); void tableDump(lua_State *L, int t); py_object *check_py_object(lua_State *L, int ud); LUA_API int luaopen_python(lua_State *L); #endif
Change Lua registry key to PythonObject.
Change Lua registry key to PythonObject.
C
lgpl-2.1
dmcooke/Lunatic-Python,dmcooke/Lunatic-Python
847d68b622b46fa558ddade13a1b04f9cf9a24b9
PWG3/PWG3LinkDef.h
PWG3/PWG3LinkDef.h
#ifdef __CINT__ #pragma link off all glols; #pragma link off all classes; #pragma link off all functions; #endif
#ifdef __CINT__ #pragma link off all glols; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliD0toKpi+; #pragma link C++ class AliD0toKpiAnalysis+; #pragma link C++ class AliBtoJPSItoEle+; #pragma link C++ class AliBtoJPSItoEleAnalysis+; #endif
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
C
bsd-3-clause
fcolamar/AliPhysics,dmuhlhei/AliPhysics,pbuehler/AliPhysics,carstooon/AliPhysics,rderradi/AliPhysics,mbjadhav/AliPhysics,fbellini/AliPhysics,preghenella/AliPhysics,mkrzewic/AliPhysics,btrzecia/AliPhysics,kreisl/AliPhysics,mazimm/AliPhysics,nschmidtALICE/AliPhysics,lcunquei/AliPhysics,fcolamar/AliPhysics,kreisl/AliPhysics,amatyja/AliPhysics,mkrzewic/AliPhysics,ALICEHLT/AliPhysics,amatyja/AliPhysics,lfeldkam/AliPhysics,adriansev/AliPhysics,ppribeli/AliPhysics,pbatzing/AliPhysics,rihanphys/AliPhysics,SHornung1/AliPhysics,jmargutt/AliPhysics,pbuehler/AliPhysics,pbuehler/AliPhysics,dstocco/AliPhysics,akubera/AliPhysics,preghenella/AliPhysics,fcolamar/AliPhysics,AMechler/AliPhysics,akubera/AliPhysics,pbuehler/AliPhysics,nschmidtALICE/AliPhysics,mbjadhav/AliPhysics,carstooon/AliPhysics,hcab14/AliPhysics,mbjadhav/AliPhysics,AudreyFrancisco/AliPhysics,akubera/AliPhysics,kreisl/AliPhysics,kreisl/AliPhysics,sebaleh/AliPhysics,rihanphys/AliPhysics,hzanoli/AliPhysics,dstocco/AliPhysics,lfeldkam/AliPhysics,lfeldkam/AliPhysics,btrzecia/AliPhysics,rbailhac/AliPhysics,aaniin/AliPhysics,lfeldkam/AliPhysics,rderradi/AliPhysics,lcunquei/AliPhysics,dmuhlhei/AliPhysics,pchrista/AliPhysics,lfeldkam/AliPhysics,rihanphys/AliPhysics,alisw/AliPhysics,nschmidtALICE/AliPhysics,amatyja/AliPhysics,nschmidtALICE/AliPhysics,aaniin/AliPhysics,amaringarcia/AliPhysics,mpuccio/AliPhysics,preghenella/AliPhysics,pbuehler/AliPhysics,jgronefe/AliPhysics,pchrista/AliPhysics,amatyja/AliPhysics,hcab14/AliPhysics,rihanphys/AliPhysics,mpuccio/AliPhysics,hcab14/AliPhysics,sebaleh/AliPhysics,fcolamar/AliPhysics,AudreyFrancisco/AliPhysics,preghenella/AliPhysics,mazimm/AliPhysics,adriansev/AliPhysics,aaniin/AliPhysics,mkrzewic/AliPhysics,jgronefe/AliPhysics,btrzecia/AliPhysics,jgronefe/AliPhysics,fbellini/AliPhysics,ALICEHLT/AliPhysics,fbellini/AliPhysics,rbailhac/AliPhysics,fbellini/AliPhysics,AMechler/AliPhysics,ALICEHLT/AliPhysics,dlodato/AliPhysics,jmargutt/AliPhysics,AMechler/AliPhysics,carstooon/AliPhysics,dmuhlhei/AliPhysics,amaringarcia/AliPhysics,mkrzewic/AliPhysics,mvala/AliPhysics,mpuccio/AliPhysics,yowatana/AliPhysics,rihanphys/AliPhysics,SHornung1/AliPhysics,lfeldkam/AliPhysics,mkrzewic/AliPhysics,sebaleh/AliPhysics,lfeldkam/AliPhysics,rbailhac/AliPhysics,mazimm/AliPhysics,AMechler/AliPhysics,dmuhlhei/AliPhysics,pbatzing/AliPhysics,mvala/AliPhysics,SHornung1/AliPhysics,sebaleh/AliPhysics,mpuccio/AliPhysics,amaringarcia/AliPhysics,pbuehler/AliPhysics,mkrzewic/AliPhysics,ppribeli/AliPhysics,aaniin/AliPhysics,adriansev/AliPhysics,yowatana/AliPhysics,victor-gonzalez/AliPhysics,sebaleh/AliPhysics,pchrista/AliPhysics,hcab14/AliPhysics,rihanphys/AliPhysics,victor-gonzalez/AliPhysics,lcunquei/AliPhysics,alisw/AliPhysics,yowatana/AliPhysics,jgronefe/AliPhysics,btrzecia/AliPhysics,ppribeli/AliPhysics,ALICEHLT/AliPhysics,fcolamar/AliPhysics,SHornung1/AliPhysics,dstocco/AliPhysics,pchrista/AliPhysics,dmuhlhei/AliPhysics,mkrzewic/AliPhysics,carstooon/AliPhysics,jmargutt/AliPhysics,fbellini/AliPhysics,sebaleh/AliPhysics,ppribeli/AliPhysics,mbjadhav/AliPhysics,pbatzing/AliPhysics,SHornung1/AliPhysics,mazimm/AliPhysics,amatyja/AliPhysics,adriansev/AliPhysics,preghenella/AliPhysics,alisw/AliPhysics,aaniin/AliPhysics,aaniin/AliPhysics,dmuhlhei/AliPhysics,kreisl/AliPhysics,btrzecia/AliPhysics,alisw/AliPhysics,jgronefe/AliPhysics,pbatzing/AliPhysics,hcab14/AliPhysics,hzanoli/AliPhysics,hzanoli/AliPhysics,victor-gonzalez/AliPhysics,mpuccio/AliPhysics,dlodato/AliPhysics,fbellini/AliPhysics,SHornung1/AliPhysics,rbailhac/AliPhysics,mazimm/AliPhysics,sebaleh/AliPhysics,ppribeli/AliPhysics,mvala/AliPhysics,mvala/AliPhysics,mazimm/AliPhysics,adriansev/AliPhysics,hzanoli/AliPhysics,mvala/AliPhysics,ALICEHLT/AliPhysics,fcolamar/AliPhysics,amatyja/AliPhysics,dmuhlhei/AliPhysics,jgronefe/AliPhysics,mvala/AliPhysics,jmargutt/AliPhysics,carstooon/AliPhysics,dlodato/AliPhysics,alisw/AliPhysics,amatyja/AliPhysics,AMechler/AliPhysics,lcunquei/AliPhysics,preghenella/AliPhysics,mpuccio/AliPhysics,hzanoli/AliPhysics,AudreyFrancisco/AliPhysics,SHornung1/AliPhysics,rderradi/AliPhysics,btrzecia/AliPhysics,amaringarcia/AliPhysics,pbatzing/AliPhysics,adriansev/AliPhysics,AudreyFrancisco/AliPhysics,nschmidtALICE/AliPhysics,rderradi/AliPhysics,amaringarcia/AliPhysics,pbatzing/AliPhysics,aaniin/AliPhysics,yowatana/AliPhysics,ppribeli/AliPhysics,hzanoli/AliPhysics,alisw/AliPhysics,AudreyFrancisco/AliPhysics,akubera/AliPhysics,lcunquei/AliPhysics,yowatana/AliPhysics,jmargutt/AliPhysics,AMechler/AliPhysics,victor-gonzalez/AliPhysics,AudreyFrancisco/AliPhysics,mbjadhav/AliPhysics,amaringarcia/AliPhysics,mbjadhav/AliPhysics,kreisl/AliPhysics,akubera/AliPhysics,rderradi/AliPhysics,dlodato/AliPhysics,fcolamar/AliPhysics,lcunquei/AliPhysics,dstocco/AliPhysics,jmargutt/AliPhysics,victor-gonzalez/AliPhysics,dlodato/AliPhysics,dlodato/AliPhysics,yowatana/AliPhysics,pbuehler/AliPhysics,dlodato/AliPhysics,yowatana/AliPhysics,jmargutt/AliPhysics,ppribeli/AliPhysics,victor-gonzalez/AliPhysics,mvala/AliPhysics,jgronefe/AliPhysics,nschmidtALICE/AliPhysics,hcab14/AliPhysics,rbailhac/AliPhysics,carstooon/AliPhysics,kreisl/AliPhysics,dstocco/AliPhysics,fbellini/AliPhysics,AudreyFrancisco/AliPhysics,rihanphys/AliPhysics,preghenella/AliPhysics,alisw/AliPhysics,pbatzing/AliPhysics,mpuccio/AliPhysics,mazimm/AliPhysics,hzanoli/AliPhysics,akubera/AliPhysics,rderradi/AliPhysics,lcunquei/AliPhysics,ALICEHLT/AliPhysics,AMechler/AliPhysics,amaringarcia/AliPhysics,carstooon/AliPhysics,rderradi/AliPhysics,mbjadhav/AliPhysics,pchrista/AliPhysics,adriansev/AliPhysics,ALICEHLT/AliPhysics,rbailhac/AliPhysics,nschmidtALICE/AliPhysics,akubera/AliPhysics,pchrista/AliPhysics,rbailhac/AliPhysics,dstocco/AliPhysics,pchrista/AliPhysics,btrzecia/AliPhysics,victor-gonzalez/AliPhysics,hcab14/AliPhysics,dstocco/AliPhysics
3aca30dc730b96e1ac50933bae2914c81a3a3c67
cod.c
cod.c
#include <stdio.h> unsigned int x; char in; void input(void); void main(void){ x = 0; input(); } void input(void){ printf(">> "); /* Bash-like input */ scanf("%c", &in); /* Get char input */ /* Boundary checks */ if(x == 256 || x == -1) x = 0; /* Operators */ switch(in){ case 'i': case 'x': x++; case 'd': x--; case 'o': case 'c': printf("%d\n", x); case 's': case 'k': x = x*x; default: printf("\n"); } input(); /* Loop */ }
#include <stdio.h> unsigned int x; char in; void input(void); void run(char c); void main(void){ x = 0; input(); } void input(void){ printf(">> "); /* Bash-like input */ scanf("%c", &in); /* Get char input */ run(in); input(); /* Loop */ } void run(char c){ /* Boundary checks */ if(x == 256 || x == -1) x = 0; /* Operators */ switch(in){ case 'i': case 'x': x++; case 'd': x--; case 'o': case 'c': printf("%d\n", x); case 's': case 'k': x = x*x; default: printf("\n"); } }
Move run into new method
Move run into new method
C
mit
phase/cod
5c217b60fed39ed2ac6a2e8b788df4a74fa68878
arch/ia64/kernel/irq_lsapic.c
arch/ia64/kernel/irq_lsapic.c
/* * LSAPIC Interrupt Controller * * This takes care of interrupts that are generated by the CPU's * internal Streamlined Advanced Programmable Interrupt Controller * (LSAPIC), such as the ITC and IPI interrupts. * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond <[email protected]> * Copyright (C) 2000 Hewlett-Packard Co * Copyright (C) 2000 David Mosberger-Tang <[email protected]> */ #include <linux/sched.h> #include <linux/irq.h> static unsigned int lsapic_noop_startup (unsigned int irq) { return 0; } static void lsapic_noop (unsigned int irq) { /* nothing to do... */ } static int lsapic_retrigger(unsigned int irq) { ia64_resend_irq(irq); return 1; } struct irq_chip irq_type_ia64_lsapic = { .name = "LSAPIC", .startup = lsapic_noop_startup, .shutdown = lsapic_noop, .enable = lsapic_noop, .disable = lsapic_noop, .ack = lsapic_noop, .retrigger = lsapic_retrigger, };
/* * LSAPIC Interrupt Controller * * This takes care of interrupts that are generated by the CPU's * internal Streamlined Advanced Programmable Interrupt Controller * (LSAPIC), such as the ITC and IPI interrupts. * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond <[email protected]> * Copyright (C) 2000 Hewlett-Packard Co * Copyright (C) 2000 David Mosberger-Tang <[email protected]> */ #include <linux/sched.h> #include <linux/irq.h> static unsigned int lsapic_noop_startup (struct irq_data *data) { return 0; } static void lsapic_noop (struct irq_data *data) { /* nothing to do... */ } static int lsapic_retrigger(struct irq_data *data) { ia64_resend_irq(data->irq); return 1; } struct irq_chip irq_type_ia64_lsapic = { .name = "LSAPIC", .irq_startup = lsapic_noop_startup, .irq_shutdown = lsapic_noop, .irq_enable = lsapic_noop, .irq_disable = lsapic_noop, .irq_ack = lsapic_noop, .irq_retrigger = lsapic_retrigger, };
Convert lsapic to new irq_chip functions
ia64: Convert lsapic to new irq_chip functions Signed-off-by: Thomas Gleixner <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
c6998bbba2a0dc57e5dbb2ceff2146cfd52a34d5
include/PurchaseEvent.h
include/PurchaseEvent.h
#ifndef _PURCHASEEVENT_H_ #define _PURCHASEEVENT_H_ #include <Event.h> class PurchaseEvent : public Event { public: enum Type { PURCHASE_STATUS }; PurchaseEvent(double _timestamp, int _productId, Type _type, bool _newPurchase) : Event(_timestamp), type(_type), newPurchase(_newPurchase), productId(_productId) { } Event * dup() const override { return new PurchaseEvent(*this); } void dispatch(EventHandler & element) override; bool isBroadcast() const override { return true; } Type getType() { return type; } bool isNew() { return newPurchase; } int getProductId() { return productId; } private: Type type; bool newPurchase; int productId; }; #endif
#ifndef _PURCHASEEVENT_H_ #define _PURCHASEEVENT_H_ #include <Event.h> class PurchaseEvent : public Event { public: enum Type { PURCHASE_STATUS }; PurchaseEvent(double _timestamp, std::string _productId, Type _type, bool _newPurchase) : Event(_timestamp), type(_type), newPurchase(_newPurchase), productId(_productId) { } Event * dup() const override { return new PurchaseEvent(*this); } void dispatch(EventHandler & element) override; bool isBroadcast() const override { return true; } Type getType() { return type; } bool isNew() { return newPurchase; } std::string getProductId() { return productId; } private: Type type; bool newPurchase; std::string productId; }; #endif
Change product Id to string
Change product Id to string
C
mit
Sometrik/framework,Sometrik/framework,Sometrik/framework
8f533f0b1a6a6a5b4d2d966269658efdb15319e6
Source/HaxeInit/Private/StubUObject.h
Source/HaxeInit/Private/StubUObject.h
#pragma once #include <Engine.h> #include "StubUObject.generated.h" // This class is only here to make sure we're visible to UHT. // We need to be visible to UHT so that UE4HaxeExternGenerator works correctly // (as any script generator must return a module name that is visible to UHT) // see IScriptGeneratorPluginInterface::GetGeneratedCodeModuleName for the related code UCLASS() class HAXEINIT_API UObjectStub : public UObject { GENERATED_BODY() };
Add uobject stub to make the script generator plugin happy
Add uobject stub to make the script generator plugin happy
C
mit
proletariatgames/unreal.hx,proletariatgames/unreal.hx,proletariatgames/unreal.hx
80d38eb7f25cd0fe2483a52ab225fa7331615f18
test/Parser/ms-inline-asm.c
test/Parser/ms-inline-asm.c
// RUN: %clang_cc1 %s -verify -fasm-blocks #define M __asm int 0x2c #define M2 int void t1(void) { M } void t2(void) { __asm int 0x2c } void t3(void) { __asm M2 0x2c } void t4(void) { __asm mov eax, fs:[0x10] } void t5() { __asm { int 0x2c ; } asm comments are fun! }{ } __asm {} } int t6() { __asm int 3 ; } comments for single-line asm __asm {} __asm int 4 return 10; } void t7() { __asm { push ebx mov ebx, 0x07 pop ebx } } void t8() { __asm nop __asm nop __asm nop } void t9() { __asm nop __asm nop ; __asm nop } int t_fail() { // expected-note {{to match this}} __asm __asm { // expected-error 3 {{expected}} expected-note {{to match this}}
// REQUIRES: x86-64-registered-target // RUN: %clang_cc1 %s -verify -fasm-blocks #define M __asm int 0x2c #define M2 int void t1(void) { M } void t2(void) { __asm int 0x2c } void t3(void) { __asm M2 0x2c } void t4(void) { __asm mov eax, fs:[0x10] } void t5() { __asm { int 0x2c ; } asm comments are fun! }{ } __asm {} } int t6() { __asm int 3 ; } comments for single-line asm __asm {} __asm int 4 return 10; } void t7() { __asm { push ebx mov ebx, 0x07 pop ebx } } void t8() { __asm nop __asm nop __asm nop } void t9() { __asm nop __asm nop ; __asm nop } int t_fail() { // expected-note {{to match this}} __asm __asm { // expected-error 3 {{expected}} expected-note {{to match this}}
Add x86 requirement to hopefully fix ppc bots.
Add x86 requirement to hopefully fix ppc bots. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@173190 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
38f0051c77a1057fe0547eeefb9c83d067f8265c
kernel/types.h
kernel/types.h
// The Mordax Microkernel // (c) Kristian Klomsten Skordal 2013 <[email protected]> // Report bugs and issues on <http://github.com/skordal/mordax/issues> #ifndef MORDAX_TYPES_H #define MORDAX_TYPES_H #include <stdint.h> /** Object size type. */ typedef uint32_t size_t; /** Physical pointer type. */ typedef void * physical_ptr; /** 64-bit generic big endian type. */ typedef uint64_t be64; /** 32-bit generic big endian type. */ typedef uint32_t be32; /** 64-bit generic little endian type. */ typedef uint64_t le64; /** 32-bit generic little endian type. */ typedef uint32_t le32; #endif
// The Mordax Microkernel // (c) Kristian Klomsten Skordal 2013 <[email protected]> // Report bugs and issues on <http://github.com/skordal/mordax/issues> #ifndef MORDAX_TYPES_H #define MORDAX_TYPES_H #include <stdbool.h> #include <stdint.h> /** Object size type. */ typedef uint32_t size_t; /** Physical pointer type. */ typedef void * physical_ptr; /** 64-bit generic big endian type. */ typedef uint64_t be64; /** 32-bit generic big endian type. */ typedef uint32_t be32; /** 64-bit generic little endian type. */ typedef uint64_t le64; /** 32-bit generic little endian type. */ typedef uint32_t le32; #endif
Add stdbool to the datatype header
Add stdbool to the datatype header
C
bsd-3-clause
skordal/mordax
b4aeaf99c621d17a147acf431d7e131c6860f5ac
bmmap.c
bmmap.c
#include "bmmap.h" #include "vty.h" void bmmap_init() { } void bmmap_print() { vty_puts("BIOS memory map:\n"); vty_printf("%d entries at %p\n", *bios_memmap_entries_ptr, bios_memmap_ptr); vty_printf("ADDR LOW ADDR HI LEN LOW LEN HI TYPE RESERVED\n"); for(int i = 0; i < *bios_memmap_entries_ptr; i++) { BmmapEntry * entry = &(*bios_memmap_ptr)[i]; vty_printf("%08x %08x %08x %08x %08x %08x\n", entry->base_addr_low, entry->base_addr_high, entry->length_low, entry->length_high, entry->type, entry->reserved); } }
#include "bmmap.h" #include "vty.h" void bmmap_init() { } void bmmap_print() { vty_puts("BIOS memory map:\n"); vty_printf("%d entries at %p\n", *bios_memmap_entries_ptr, bios_memmap_ptr); vty_printf(" ADDR LEN TYPE RESERVED\n"); for(int i = 0; i < *bios_memmap_entries_ptr; i++) { BmmapEntry * entry = &(*bios_memmap_ptr)[i]; vty_printf("%08x:%08x %08x:%08x %08x %08x\n", entry->base_addr_high, entry->base_addr_low, entry->length_high, entry->length_low, entry->type, entry->reserved); } }
Tweak display of BIOS memory map
Tweak display of BIOS memory map
C
mit
wconrad/brazzle,wconrad/brazzle
73689e53255c6ac22a90b0cd01fe40180ec2bbba
chrome/browser/desktop_notification_handler.h
chrome/browser/desktop_notification_handler.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #pragma once #include "content/browser/renderer_host/render_view_host_observer.h" class GURL; struct DesktopNotificationHostMsg_Show_Params; // Per-tab Desktop notification handler. Handles desktop notification IPCs // coming in from the renderer. class DesktopNotificationHandler : public RenderViewHostObserver { public: explicit DesktopNotificationHandler(RenderViewHost* render_view_host); virtual ~DesktopNotificationHandler(); private: // RenderViewHostObserver implementation. virtual bool OnMessageReceived(const IPC::Message& message); // IPC handlers. void OnShow(const DesktopNotificationHostMsg_Show_Params& params); void OnCancel(int notification_id); void OnRequestPermission(const GURL& origin, int callback_id); private: DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler); }; #endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #pragma once #include "content/browser/renderer_host/render_view_host_observer.h" class GURL; struct DesktopNotificationHostMsg_Show_Params; // Per-tab Desktop notification handler. Handles desktop notification IPCs // coming in from the renderer. class DesktopNotificationHandler : public RenderViewHostObserver { public: explicit DesktopNotificationHandler(RenderViewHost* render_view_host); virtual ~DesktopNotificationHandler(); private: // RenderViewHostObserver implementation. bool OnMessageReceived(const IPC::Message& message); // IPC handlers. void OnShow(const DesktopNotificationHostMsg_Show_Params& params); void OnCancel(int notification_id); void OnRequestPermission(const GURL& origin, int callback_id); private: DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler); }; #endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
Revert 80939 - Fix clang error [email protected]
Revert 80939 - Fix clang error [email protected] git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@80954 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
dushu1203/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,hujiajie/pa-chromium,patrickm/chromium.src,mogoweb/chromium-crosswalk,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,rogerwang/chromium,Just-D/chromium-1,dednal/chromium.src,zcbenz/cefode-chromium,robclark/chromium,anirudhSK/chromium,ondra-novak/chromium.src,Just-D/chromium-1,anirudhSK/chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,hujiajie/pa-chromium,robclark/chromium,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,robclark/chromium,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,rogerwang/chromium,ltilve/chromium,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,rogerwang/chromium,ondra-novak/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,keishi/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,keishi/chromium,Fireblend/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,keishi/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,Chilledheart/chromium,zcbenz/cefode-chromium,Jonekee/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,ondra-novak/chromium.src,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,M4sse/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,nacl-webkit/chrome_deps,jaruba/chromium.src,patrickm/chromium.src,ltilve/chromium,M4sse/chromium.src,axinging/chromium-crosswalk,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,keishi/chromium,M4sse/chromium.src,keishi/chromium,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,rogerwang/chromium,dednal/chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,jaruba/chromium.src,robclark/chromium,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,M4sse/chromium.src,dednal/chromium.src,rogerwang/chromium,ChromiumWebApps/chromium,littlstar/chromium.src,robclark/chromium,dushu1203/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,patrickm/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,robclark/chromium,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,robclark/chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,robclark/chromium,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,littlstar/chromium.src,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,keishi/chromium,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,littlstar/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,rogerwang/chromium,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,ltilve/chromium,zcbenz/cefode-chromium,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,robclark/chromium,zcbenz/cefode-chromium,ltilve/chromium,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,robclark/chromium,axinging/chromium-crosswalk,ondra-novak/chromium.src,dednal/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,rogerwang/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,zcbenz/cefode-chromium,Jonekee/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,keishi/chromium,rogerwang/chromium,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,dushu1203/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,M4sse/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,keishi/chromium,bright-sparks/chromium-spacewalk,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,keishi/chromium,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,M4sse/chromium.src,ltilve/chromium,ondra-novak/chromium.src,patrickm/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,dednal/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,Jonekee/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,keishi/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,M4sse/chromium.src,markYoungH/chromium.src
c6aef16d6f64fa9cd13ce6a1ceb89713455bc6b0
modules/electromagnetics/include/postprocessors/ReflectionCoefficient.h
modules/electromagnetics/include/postprocessors/ReflectionCoefficient.h
#ifndef REFLECTIONCOEFFICIENT_H #define REFLECTIONCOEFFICIENT_H #include "SidePostprocessor.h" #include "MooseVariableInterface.h" class ReflectionCoefficient; template <> InputParameters validParams<ReflectionCoefficient>(); class ReflectionCoefficient : public SidePostprocessor, public MooseVariableInterface<Real> { public: ReflectionCoefficient(const InputParameters & parameters); virtual void initialize() override; virtual void execute() override; virtual PostprocessorValue getValue() override; virtual void threadJoin(const UserObject & y) override; protected: virtual Real computeReflection(); const VariableValue & _u; unsigned int _qp; private: const VariableValue & _coupled_imag; Real _theta; Real _length; Real _k; Real _coeff; Real _reflection_coefficient; }; #endif // REFLECTIONCOEFFICIENT_H
#pragma once #include "SidePostprocessor.h" #include "MooseVariableInterface.h" class ReflectionCoefficient; template <> InputParameters validParams<ReflectionCoefficient>(); class ReflectionCoefficient : public SidePostprocessor, public MooseVariableInterface<Real> { public: ReflectionCoefficient(const InputParameters & parameters); virtual void initialize() override; virtual void execute() override; virtual PostprocessorValue getValue() override; virtual void threadJoin(const UserObject & y) override; protected: virtual Real computeReflection(); const VariableValue & _u; unsigned int _qp; private: const VariableValue & _coupled_imag; Real _theta; Real _length; Real _k; Real _coeff; Real _reflection_coefficient; };
Convert postprocessors to pragma once
Convert postprocessors to pragma once refs #21085
C
lgpl-2.1
harterj/moose,dschwen/moose,andrsd/moose,sapitts/moose,milljm/moose,harterj/moose,laagesen/moose,harterj/moose,harterj/moose,laagesen/moose,lindsayad/moose,milljm/moose,milljm/moose,andrsd/moose,dschwen/moose,dschwen/moose,sapitts/moose,lindsayad/moose,andrsd/moose,laagesen/moose,andrsd/moose,milljm/moose,sapitts/moose,idaholab/moose,lindsayad/moose,laagesen/moose,dschwen/moose,idaholab/moose,milljm/moose,idaholab/moose,harterj/moose,laagesen/moose,lindsayad/moose,idaholab/moose,sapitts/moose,lindsayad/moose,sapitts/moose,dschwen/moose,idaholab/moose,andrsd/moose
85de995f9baa868dd53ed84986426a63ed9bdc99
PC/dl_nt.c
PC/dl_nt.c
/* Entry point for the Windows NT DLL. About the only reason for having this, is so initall() can automatically be called, removing that burden (and possible source of frustration if forgotten) from the programmer. */ #include "windows.h" /* NT and Python share these */ #undef INCREF #undef DECREF #include "config.h" #include "allobjects.h" HMODULE PyWin_DLLhModule = NULL; BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: PyWin_DLLhModule = hInst; initall(); break; case DLL_PROCESS_DETACH: break; } return TRUE; }
/* Entry point for the Windows NT DLL. About the only reason for having this, is so initall() can automatically be called, removing that burden (and possible source of frustration if forgotten) from the programmer. */ #include "windows.h" /* NT and Python share these */ #include "config.h" #include "Python.h" HMODULE PyWin_DLLhModule = NULL; BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: PyWin_DLLhModule = hInst; //initall(); break; case DLL_PROCESS_DETACH: break; } return TRUE; }
Use Python.h, not allobjects.h. Don't call initall() (Experimental incompatible change!!!!!!)
Use Python.h, not allobjects.h. Don't call initall() (Experimental incompatible change!!!!!!)
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
f6cbd04937a2b1503a4eaeeb6e18a8c31133d0b6
hanoi.c
hanoi.c
/* * Copyright (C) 2014-2015 Pavel Dolgov * * See the LICENSE file for terms of use. */ #include <stdio.h> #define TOWER1 1 #define TOWER2 3 void hanoi(int a, int n1, int n2) { if (a == 1) { // end of recursion printf("%d %d %d\n", a, n1, n2); } else { int x, na; for (x = TOWER1; x <= TOWER2; x++) { if ((x != n1) && (x != n2)) { na = x; break; } } hanoi(a - 1, n1, na); // recursion printf("%d %d %d\n", a, n1, n2); hanoi(a - 1, na, n2); // recursion } } int main() { int n; scanf("%d", &n); hanoi(n, TOWER1, TOWER2); }
/* * Copyright (C) 2014-2015 Pavel Dolgov * * See the LICENSE file for terms of use. */ #include <stdio.h> #define TOWER1 1 #define TOWER2 3 void hanoi(int a, int n1, int n2) { if (a == 1) { // end of recursion printf("%d %d %d\n", a, n1, n2); } else { int x, na; for (x = TOWER1; x <= TOWER2; x++) { if ((x != n1) && (x != n2)) { na = x; break; } } hanoi(a - 1, n1, na); // recursion printf("%d %d %d\n", a, n1, n2); hanoi(a - 1, na, n2); // recursion } } int main() { int n; scanf("%d", &n); hanoi(n, TOWER1, TOWER2); }
Fix layout (delete empty string)
Fix layout (delete empty string)
C
mit
zer0main/hanoi_tower
f9dedee2f091dd14a8da268399c34c00b6d37695
Game.h
Game.h
#pragma once // This guarantees that the code is included only once in the game. #include "SFML/Window.hpp" #include "SFML/Graphics.hpp" class Game { public: // Objects declared static are allocated storage in static storage area, and have scope till the end of the program. static void Start(); private: static bool IsExiting(); static void GameLoop(); enum GameState { Uninitialized, ShowingSplash, Paused, ShowingMenu, Playing, Exiting }; // Represents the various states the game can be in. An enum is a user-defined type consisting of a set of named constants called enumerators. static GameState _gameState; static sf::RenderWindow _mainWindow; };
#ifndef GAME_H // This guarentees that the code is included only once in the game. #define GAME_H #include "SFML/Graphics.hpp" #include "SFML/Window.hpp" class Game { public: // Objects declared static are allocated storage in static storage area, and have scope till the end of the program. static void start(); private: static bool is_exiting(); static void game_loop(); enum game_state { Uninitialized, ShowingSplash, Paused, ShowingMenu, Playing, Exiting }; // Represents the various states the game can be in. An enum is a user-defined type consisting of a set of named constants called enumerators. static game_state s_game_state; static sf::RenderWindow s_main_window; }; #endif
Change styling convention of the variable names
Change styling convention of the variable names
C
mit
jessicaphuong/pong-clone
f533072ea6e6b4806db8166d10f40a3acb982c79
modules/solid_mechanics/include/materials/nonlinear_strain/Elastic.h
modules/solid_mechanics/include/materials/nonlinear_strain/Elastic.h
#ifndef ELASTIC_H #define ELASTIC_H #include "MaterialModel.h" // Forward declarations class ElasticityTensor; class Elastic; template<> InputParameters validParams<Elastic>(); class Elastic : public MaterialModel { public: Elastic( const std::string & name, InputParameters parameters ); virtual ~Elastic(); protected: /// Compute the stress (sigma += deltaSigma) virtual void computeStress(); }; #endif
#ifndef ELASTIC_H #define ELASTIC_H #include "MaterialModel.h" // Forward declarations class ElasticityTensor; class Elastic; template<> InputParameters validParams<Elastic>(); class Elastic : public MaterialModel { public: Elastic( const std::string & name, InputParameters parameters ); virtual ~Elastic(); protected: /// Compute the stress (sigma += deltaSigma) virtual void computeStress(); }; #endif
Update new files with SymmTensor changes
Update new files with SymmTensor changes r5226
C
lgpl-2.1
zzyfisherman/moose,jasondhales/moose,jhbradley/moose,jessecarterMOOSE/moose,cpritam/moose,jhbradley/moose,wgapl/moose,YaqiWang/moose,shanestafford/moose,xy515258/moose,raghavaggarwal/moose,andrsd/moose,Chuban/moose,apc-llc/moose,bwspenc/moose,mellis13/moose,xy515258/moose,adamLange/moose,giopastor/moose,giopastor/moose,stimpsonsg/moose,harterj/moose,sapitts/moose,waxmanr/moose,tonkmr/moose,jiangwen84/moose,roystgnr/moose,laagesen/moose,harterj/moose,idaholab/moose,katyhuff/moose,stimpsonsg/moose,yipenggao/moose,liuwenf/moose,jasondhales/moose,shanestafford/moose,lindsayad/moose,wgapl/moose,waxmanr/moose,idaholab/moose,tonkmr/moose,zzyfisherman/moose,sapitts/moose,shanestafford/moose,lindsayad/moose,jinmm1992/moose,SudiptaBiswas/moose,markr622/moose,permcody/moose,zzyfisherman/moose,lindsayad/moose,liuwenf/moose,adamLange/moose,apc-llc/moose,dschwen/moose,bwspenc/moose,friedmud/moose,joshua-cogliati-inl/moose,SudiptaBiswas/moose,andrsd/moose,harterj/moose,joshua-cogliati-inl/moose,joshua-cogliati-inl/moose,cpritam/moose,friedmud/moose,jbair34/moose,backmari/moose,markr622/moose,jiangwen84/moose,raghavaggarwal/moose,milljm/moose,YaqiWang/moose,sapitts/moose,nuclear-wizard/moose,danielru/moose,YaqiWang/moose,Chuban/moose,roystgnr/moose,backmari/moose,friedmud/moose,WilkAndy/moose,jessecarterMOOSE/moose,raghavaggarwal/moose,nuclear-wizard/moose,kasra83/moose,nuclear-wizard/moose,harterj/moose,jessecarterMOOSE/moose,roystgnr/moose,laagesen/moose,nuclear-wizard/moose,milljm/moose,WilkAndy/moose,jhbradley/moose,mellis13/moose,permcody/moose,tonkmr/moose,dschwen/moose,milljm/moose,cpritam/moose,liuwenf/moose,laagesen/moose,andrsd/moose,roystgnr/moose,WilkAndy/moose,liuwenf/moose,danielru/moose,shanestafford/moose,apc-llc/moose,cpritam/moose,laagesen/moose,bwspenc/moose,adamLange/moose,xy515258/moose,friedmud/moose,danielru/moose,mellis13/moose,mellis13/moose,zzyfisherman/moose,dschwen/moose,capitalaslash/moose,jiangwen84/moose,WilkAndy/moose,jbair34/moose,andrsd/moose,markr622/moose,jiangwen84/moose,yipenggao/moose,markr622/moose,yipenggao/moose,cpritam/moose,apc-llc/moose,giopastor/moose,jasondhales/moose,WilkAndy/moose,katyhuff/moose,idaholab/moose,capitalaslash/moose,waxmanr/moose,wgapl/moose,roystgnr/moose,laagesen/moose,Chuban/moose,stimpsonsg/moose,kasra83/moose,bwspenc/moose,backmari/moose,idaholab/moose,Chuban/moose,roystgnr/moose,katyhuff/moose,jinmm1992/moose,liuwenf/moose,raghavaggarwal/moose,YaqiWang/moose,idaholab/moose,shanestafford/moose,lindsayad/moose,lindsayad/moose,joshua-cogliati-inl/moose,sapitts/moose,danielru/moose,kasra83/moose,adamLange/moose,dschwen/moose,permcody/moose,jessecarterMOOSE/moose,SudiptaBiswas/moose,xy515258/moose,capitalaslash/moose,roystgnr/moose,sapitts/moose,backmari/moose,SudiptaBiswas/moose,liuwenf/moose,zzyfisherman/moose,jhbradley/moose,zzyfisherman/moose,milljm/moose,WilkAndy/moose,yipenggao/moose,capitalaslash/moose,tonkmr/moose,SudiptaBiswas/moose,milljm/moose,dschwen/moose,kasra83/moose,cpritam/moose,shanestafford/moose,katyhuff/moose,andrsd/moose,bwspenc/moose,stimpsonsg/moose,waxmanr/moose,jinmm1992/moose,giopastor/moose,jasondhales/moose,harterj/moose,permcody/moose,jbair34/moose,tonkmr/moose,wgapl/moose,jinmm1992/moose,tonkmr/moose,jbair34/moose,jessecarterMOOSE/moose
d037fe2cca7e0cdc8bfe48b67480201458d083d0
lib/msun/src/w_dremf.c
lib/msun/src/w_dremf.c
/* * dremf() wrapper for remainderf(). * * Written by J.T. Conklin, <[email protected]> * Placed into the Public Domain, 1994. */ #include "math.h" #include "math_private.h" float dremf(x, y) float x, y; { return remainderf(x, y); }
/* * dremf() wrapper for remainderf(). * * Written by J.T. Conklin, <[email protected]> * Placed into the Public Domain, 1994. */ /* $FreeBSD$ */ #include "math.h" #include "math_private.h" float dremf(float x, float y) { return remainderf(x, y); }
Work around known GCC 3.4.x problem and use ANSI prototype for dremf().
Work around known GCC 3.4.x problem and use ANSI prototype for dremf().
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
9e9d12f6adaeaeddc5060b5ddd353bcbdd5794e2
ex01-16.c
ex01-16.c
#include <stdio.h> #define MAXLINE 10/*00*/ /* maximum input size */ int _getline(char line[], int maxline); /* getline is a library function in POSIX; unfortunately on OS X the -ansi flag doesn't help */ void copy(char to[], char from[]); main() { int len; int max; char line[MAXLINE]; char longest[MAXLINE]; max = 0; while ((len = _getline(line, MAXLINE)) > 0) if (len > max) { max = len; copy(longest, line); } if (max > 0) { /* there was a line */ printf("%d\n", max); printf("%s", longest); } return 0; } /* _getline: read a line into s, return length */ int _getline(char s[], int lim) { int c, i, length; i = length = 0; while ((c = getchar()) != EOF) { ++length; if (i < lim - 1) { s[i] = c; ++i; } if (c == '\n') { break; } } s[i-1] = '\n'; s[i] = '\0'; return length; } /* copy: copy 'from' into 'to'; assume to is big enough */ void copy(char to[], char from[]) { int i; i = 0; while ((to[i] = from[i]) != '\0') ++i; }
Add solution for exercise 16.
Add solution for exercise 16.
C
unlicense
kdungs/exercises-KnR
0f4df1ecbd2a1b0067ae779b28599668c7a27167
inc/scc.h
inc/scc.h
#include <stddef.h> extern int debug; #ifndef NDEBUG #define DBG(...) dbg(__VA_ARGS__) #define DBGON() (debug = 1) #else #define DBG(...) #define DBGON() #endif #define TINT long long #define TUINT unsigned long long #define TFLOAT double struct items { char **s; unsigned n; }; typedef struct alloc Alloc; extern void die(const char *fmt, ...); extern void dbg(const char *fmt, ...); extern void newitem(struct items *items, char *item); extern void *xmalloc(size_t size); extern void *xcalloc(size_t nmemb, size_t size); extern char *xstrdup(const char *s); extern void *xrealloc(void *buff, register size_t size); extern Alloc *alloc(size_t size, size_t nmemb); extern void dealloc(Alloc *allocp); extern void *new(Alloc *allocp); extern void delete(Alloc *allocp, void *p); extern int casecmp(const char *s1, const char *s2); extern int lpack(unsigned char *dst, char *fmt, ...); extern int lunpack(unsigned char *src, char *fmt, ...);
#include <stddef.h> extern int debug; #ifndef NDEBUG #define DBG(...) dbg(__VA_ARGS__) #define DBGON() (debug = 1) #else #define DBG(...) #define DBGON() #endif #define TINT long long #define TUINT unsigned long long #define TUINT_MAX ULLONG_MAX #define TINT_MAX LLONG_MAX #define TFLOAT double struct items { char **s; unsigned n; }; typedef struct alloc Alloc; extern void die(const char *fmt, ...); extern void dbg(const char *fmt, ...); extern void newitem(struct items *items, char *item); extern void *xmalloc(size_t size); extern void *xcalloc(size_t nmemb, size_t size); extern char *xstrdup(const char *s); extern void *xrealloc(void *buff, register size_t size); extern Alloc *alloc(size_t size, size_t nmemb); extern void dealloc(Alloc *allocp); extern void *new(Alloc *allocp); extern void delete(Alloc *allocp, void *p); extern int casecmp(const char *s1, const char *s2); extern int lpack(unsigned char *dst, char *fmt, ...); extern int lunpack(unsigned char *src, char *fmt, ...);
Add limits macros for TUINT and TINT
Add limits macros for TUINT and TINT
C
isc
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
98c3fef74045aa6d8c7813f8ba8c511ab70ec59e
tests/regression/36-octapron/40-rational-bounds.c
tests/regression/36-octapron/40-rational-bounds.c
// SKIP PARAM: --sets ana.activated[+] octApron #include <assert.h> void main() { int x; if (x <= 10) { assert((x / 3) <= 3); } }
Add test where octApron derives non-integer bounds
Add test where octApron derives non-integer bounds
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
c2b84152f437e86cc2b55c1cc0bbb35d3fa645b5
example_no_runner.c
example_no_runner.c
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include "greatest.h" TEST standalone_pass(void) { PASS(); } /* Add all the definitions that need to be in the test runner's main file. */ GREATEST_MAIN_DEFS(); int main(int argc, char **argv) { (void)argc; (void)argv; /* Initialize greatest, but don't build the CLI test runner code. */ GREATEST_INIT(); RUN_TEST(standalone_pass); /* Print report, but do not exit. */ printf("\nStandard report, as printed by greatest:\n"); GREATEST_PRINT_REPORT(); struct greatest_report_t report; greatest_get_report(&report); printf("\nCustom report:\n"); printf("pass %u, fail %u, skip %u, assertions %u\n", report.passed, report.failed, report.skipped, report.assertions); if (report.failed > 0) { return 1; } return 0; }
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include "greatest.h" TEST standalone_pass(void) { PASS(); } /* Add all the definitions that need to be in the test runner's main file. */ GREATEST_MAIN_DEFS(); int main(int argc, char **argv) { struct greatest_report_t report; (void)argc; (void)argv; /* Initialize greatest, but don't build the CLI test runner code. */ GREATEST_INIT(); RUN_TEST(standalone_pass); /* Print report, but do not exit. */ printf("\nStandard report, as printed by greatest:\n"); GREATEST_PRINT_REPORT(); greatest_get_report(&report); printf("\nCustom report:\n"); printf("pass %u, fail %u, skip %u, assertions %u\n", report.passed, report.failed, report.skipped, report.assertions); if (report.failed > 0) { return 1; } return 0; }
Fix warning for mixing declarations and code in ISO C90.
Fix warning for mixing declarations and code in ISO C90.
C
isc
silentbicycle/greatest,silentbicycle/greatest
80bf0da7bfe646f94615ce6e3aa67cfa4648bc1d
include/libtrading/byte-order.h
include/libtrading/byte-order.h
#ifndef LIBTRADING_BYTE_ORDER_H #define LIBTRADING_BYTE_ORDER_H #include "libtrading/types.h" #include <arpa/inet.h> static inline be16 cpu_to_be16(u16 value) { return htons(value); } static inline be32 cpu_to_be32(u32 value) { return htonl(value); } static inline u16 be16_to_cpu(be16 value) { return ntohs(value); } static inline u32 be32_to_cpu(be32 value) { return ntohl(value); } #endif
#ifndef LIBTRADING_BYTE_ORDER_H #define LIBTRADING_BYTE_ORDER_H #include <endian.h> /* * Little Endian */ static inline le16 cpu_to_le16(u16 value) { return htole16(value); } static inline le32 cpu_to_le32(u32 value) { return htole32(value); } static inline le64 cpu_to_le64(u64 value) { return htole64(value); } static inline u16 le16_to_cpu(le16 value) { return le16toh(value); } static inline u32 le32_to_cpu(le32 value) { return le32toh(value); } static inline u64 le64_to_cpu(le64 value) { return le64toh(value); } /* * Big Endian */ static inline be16 cpu_to_be16(u16 value) { return htobe16(value); } static inline be32 cpu_to_be32(u32 value) { return htobe32(value); } static inline be64 cpu_to_be64(u64 value) { return htobe64(value); } static inline u16 be16_to_cpu(be16 value) { return be16toh(value); } static inline u32 be32_to_cpu(be32 value) { return be32toh(value); } static inline u64 be64_to_cpu(be64 value) { return be64toh(value); } #endif
Use <endian.h> for byte order helpers
Use <endian.h> for byte order helpers Also add missing helper functions. Signed-off-by: Pekka Enberg <[email protected]>
C
bsd-2-clause
fengzhyuan/libtrading,mstanichenko/libtrading,etoestja/libtrading,mstanichenko/libtrading,NunoEdgarGub1/libtrading,libtrading/libtrading,libtrading/libtrading,penberg/libtrading,divaykin/libtrading,etoestja/libtrading,Bitcoinsulting/libtrading,divaykin/libtrading,femtotrader/libtrading,femtotrader/libtrading,jvirtanen/libtrading,Bitcoinsulting/libtrading,svdev/libtrading,NunoEdgarGub1/libtrading,svdev/libtrading,penberg/libtrading,jvirtanen/libtrading,fengzhyuan/libtrading
54cfb51eabc5c61e3cdfdbc6e745a22d6f992e53
WildcardPattern.h
WildcardPattern.h
#import <Cocoa/Cocoa.h> @interface WildcardPattern : NSObject { NSString* pattern_; } - (id) initWithString: (NSString*) s; - (BOOL) isMatch: (NSString*) s; @end
/* * Copyright (c) 2006 KATO Kazuyoshi <[email protected]> * This source code is released under the MIT license. */ #import <Cocoa/Cocoa.h> @interface WildcardPattern : NSObject { NSString* pattern_; } - (id) initWithString: (NSString*) s; - (BOOL) isMatch: (NSString*) s; @end
Add copyright and license header.
Add copyright and license header.
C
mit
torezzz/greasekit
601b1f4970926d2b09218265ba661346a89612ea
src/util.h
src/util.h
#ifndef LACO_UTIL_H #define LACO_UTIL_H struct LacoState; struct lua_State; /** * Load a line into the lua stack to be evaluated later * * param pointer to LacoState * * return -1 if there is no line input to load */ int laco_load_line(struct LacoState* laco); /** * Called after laco_load_line, this evaluated the line as a function and * hands of the result for printing * * param pointer to LacoState */ void laco_handle_line(struct LacoState* laco); /** * Kills the loop with exiting message if specified * * param pointer to LacoState * param exit with status * param error message */ void laco_kill(struct LacoState* laco, int status, const char* message); /** * When there is a value on the lua stack, it will print out depending on * the type it is * * param pointer to lua_State * * return LUA_ERRSYNTAX if the value has some error */ int laco_print_type(struct lua_State* L); /** * Prints out and pops off errors pushed into the lua stack * * param pointer to lua_State * param incoming lua stack status */ void laco_report_error(struct lua_State* L, int status); int laco_is_match(const char** matches, const char* test_string); #endif /* LACO_UTIL_H */
#ifndef LACO_UTIL_H #define LACO_UTIL_H struct LacoState; /** * Load a line into the lua stack to be evaluated later * * param pointer to LacoState * * return -1 if there is no line input to load */ int laco_load_line(struct LacoState* laco); /** * Called after laco_load_line, this evaluated the line as a function and * hands of the result for printing * * param pointer to LacoState */ void laco_handle_line(struct LacoState* laco); /** * Kills the loop with exiting message if specified * * param pointer to LacoState * param exit with status * param error message */ void laco_kill(struct LacoState* laco, int status, const char* message); /** * When there is a value on the lua stack, it will print out depending on * the type it is * * param pointer to lua_State * * return LUA_ERRSYNTAX if the value has some error */ int laco_print_type(struct LacoState* laco); /** * Prints out and pops off errors pushed into the lua stack * * param pointer to lua_State * param incoming lua stack status */ void laco_report_error(struct LacoState* laco, int status); int laco_is_match(const char** matches, const char* test_string); #endif /* LACO_UTIL_H */
Change lua_State pointer to LacoState
Change lua_State pointer to LacoState Mostly for consistency in the API.
C
bsd-2-clause
sourrust/laco
b232dd075cad8d21bffb4096afb081f097c3caab
helpers/pgrp_placeholder.c
helpers/pgrp_placeholder.c
/* Copyright 2019 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /*! *\brief Process group placeholder. * * Does nothing except sitting around until killed. Spawned as extra process in * our process groups so that we can control on our own when the process group * ID is reclaimed to the kernel, namely by killing the entire process group. * This prevents a race condition of our process group getting reclaimed before * we try to kill possibly remaining processes in it, after which we would * possibly kill something else. * * Must be a separate executable so F_CLOEXEC applies as intended. */ #include <unistd.h> int main() { for (;;) { pause(); } return 0; }
/* Copyright 2019 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /*! *\brief Process group placeholder. * * Does nothing except sitting around until killed. Spawned as extra process in * our process groups so that we can control on our own when the process group * ID is reclaimed to the kernel, namely by killing the entire process group. * This prevents a race condition of our process group getting reclaimed before * we try to kill possibly remaining processes in it, after which we would * possibly kill something else. * * Must be a separate executable so F_CLOEXEC applies as intended. */ #include <stdlib.h> #include <unistd.h> int main() { for (;;) { pause(); } // Cannot get here. abort(); }
Return failure if the unexitable loop ever exits ;)
Return failure if the unexitable loop ever exits ;) (cleaner)
C
apache-2.0
google/xsecurelock,google/xsecurelock
952e0be71291f6475cb4c86894e43dc531eb8980
ir/be/test/invsqrt.c
ir/be/test/invsqrt.c
/** * magical invsqrt function from Quake III code * see: http://www.codemaestro.com/reviews/9 */ float InvSqrt(float x) { float xhalf = 0.5f*x; int i = *(int*)&x; i = 0x5f3759df - (i>>1); x = *(float*)&i; x = x*(1.5f-xhalf*x*x); return x; } int main(void) { int result = InvSqrt(0.00056); printf("Result: %d (should be 42)", result); return result != 42; }
Test case for historical reasons
Test case for historical reasons [r22410]
C
lgpl-2.1
8l/libfirm,MatzeB/libfirm,killbug2004/libfirm,libfirm/libfirm,libfirm/libfirm,killbug2004/libfirm,libfirm/libfirm,killbug2004/libfirm,jonashaag/libfirm,killbug2004/libfirm,jonashaag/libfirm,jonashaag/libfirm,8l/libfirm,MatzeB/libfirm,8l/libfirm,libfirm/libfirm,8l/libfirm,jonashaag/libfirm,8l/libfirm,davidgiven/libfirm,davidgiven/libfirm,MatzeB/libfirm,libfirm/libfirm,jonashaag/libfirm,8l/libfirm,8l/libfirm,davidgiven/libfirm,MatzeB/libfirm,MatzeB/libfirm,davidgiven/libfirm,jonashaag/libfirm,davidgiven/libfirm,MatzeB/libfirm,MatzeB/libfirm,killbug2004/libfirm,killbug2004/libfirm,davidgiven/libfirm,jonashaag/libfirm,davidgiven/libfirm,killbug2004/libfirm
d7ff6aa14bca10865795a218c863d3149263621f
src/debugger.h
src/debugger.h
#ifndef DEBUGGER_H #define DEBUGGER_H enum DebuggerState { DEBUGGER_PAUSED, DEBUGGER_RUNNING, DEBUGGER_EXITING }; struct ARMDebugger { enum DebuggerState state; struct ARMCore* cpu; char* lastCommand; }; void ARMDebuggerInit(struct ARMDebugger*, struct ARMCore*); void ARMDebuggerRun(struct ARMDebugger*); void ARMDebuggerEnter(struct ARMDebugger*); #endif
#ifndef DEBUGGER_H #define DEBUGGER_H enum DebuggerState { DEBUGGER_PAUSED, DEBUGGER_RUNNING, DEBUGGER_EXITING }; struct ARMDebugger { enum DebuggerState state; struct ARMCore* cpu; char* lastCommand; struct DebugBreakpoint* breakpoints; }; void ARMDebuggerInit(struct ARMDebugger*, struct ARMCore*); void ARMDebuggerRun(struct ARMDebugger*); void ARMDebuggerEnter(struct ARMDebugger*); #endif
Add missing field for breakpoints
Add missing field for breakpoints
C
mpl-2.0
askotx/mgba,fr500/mgba,sergiobenrocha2/mgba,Iniquitatis/mgba,fr500/mgba,mgba-emu/mgba,libretro/mgba,matthewbauer/mgba,fr500/mgba,Touched/mgba,jeremyherbert/mgba,cassos/mgba,askotx/mgba,fr500/mgba,nattthebear/mgba,Iniquitatis/mgba,libretro/mgba,jeremyherbert/mgba,Touched/mgba,libretro/mgba,libretro/mgba,nattthebear/mgba,AdmiralCurtiss/mgba,sergiobenrocha2/mgba,sergiobenrocha2/mgba,sergiobenrocha2/mgba,mgba-emu/mgba,Anty-Lemon/mgba,iracigt/mgba,cassos/mgba,askotx/mgba,cassos/mgba,iracigt/mgba,AdmiralCurtiss/mgba,askotx/mgba,bentley/mgba,zerofalcon/mgba,Anty-Lemon/mgba,bentley/mgba,mgba-emu/mgba,mgba-emu/mgba,zerofalcon/mgba,iracigt/mgba,MerryMage/mgba,MerryMage/mgba,MerryMage/mgba,matthewbauer/mgba,zerofalcon/mgba,iracigt/mgba,Anty-Lemon/mgba,sergiobenrocha2/mgba,jeremyherbert/mgba,Anty-Lemon/mgba,Touched/mgba,Iniquitatis/mgba,AdmiralCurtiss/mgba,Iniquitatis/mgba,libretro/mgba,jeremyherbert/mgba
9614463119c6c28626ae237f9ce7225a638d32ef
src/commands/i2c_test_command.c
src/commands/i2c_test_command.c
#include <stdint.h> #include <string.h> #include "obc.h" #include "system.h" #include "terminal.h" void I2CTestCommandHandler(uint16_t argc, char* argv[]) { UNREFERENCED_PARAMETER(argc); I2CBus* bus; if (strcmp(argv[0], "system") == 0) { bus = Main.I2C.System; } else if (strcmp(argv[0], "payload") == 0) { bus = Main.I2C.Payload; } else { TerminalPuts("Unknown bus\n"); } const uint8_t device = (uint8_t)atoi(argv[1]); const uint8_t* data = (uint8_t*)argv[2]; const size_t dataLength = strlen(argv[2]); uint8_t output[20] = {0}; size_t outputLength = dataLength; const I2CResult result = bus->WriteRead(bus, device, data, dataLength, output, outputLength); if (result == I2CResultOK) { TerminalPuts((char*)output); } else { TerminalPrintf("Error %d\n", result); } }
#include <stdint.h> #include <string.h> #include "obc.h" #include "system.h" #include "terminal.h" void I2CTestCommandHandler(uint16_t argc, char* argv[]) { UNREFERENCED_PARAMETER(argc); if (argc != 3) { TerminalPuts("i2c <system|payload> <device> <data>\n"); return; } I2CBus* bus; if (strcmp(argv[0], "system") == 0) { bus = Main.I2C.System; } else if (strcmp(argv[0], "payload") == 0) { bus = Main.I2C.Payload; } else { TerminalPuts("Unknown bus\n"); } const uint8_t device = (uint8_t)atoi(argv[1]); const uint8_t* data = (uint8_t*)argv[2]; const size_t dataLength = strlen(argv[2]); uint8_t output[20] = {0}; size_t outputLength = dataLength; const I2CResult result = bus->WriteRead(bus, device, data, dataLength, output, outputLength); if (result == I2CResultOK) { TerminalPuts((char*)output); } else { TerminalPrintf("Error %d\n", result); } }
Check args count in test i2c terminal command
Check args count in test i2c terminal command
C
agpl-3.0
PW-Sat2/PWSat2OBC,PW-Sat2/PWSat2OBC,PW-Sat2/PWSat2OBC,PW-Sat2/PWSat2OBC
01a0794bfbc6dd31c4847d2562e890622eac1ee3
Pod/Classes/GGReadabilityParser.h
Pod/Classes/GGReadabilityParser.h
/* Copyright (c) 2012 Curtis Hard - GeekyGoodness */ /* Modified by Denis Zamataev. 2014 */ #import <Foundation/Foundation.h> #import <HTMLReader.h> #import "DZReadability_constants.h" typedef void (^GGReadabilityParserCompletionHandler)( NSString * content ); typedef void (^GGReadabilityParserErrorHandler)( NSError * error ); @interface GGReadabilityParser : NSObject { float loadProgress; @private GGReadabilityParserErrorHandler errorHandler; GGReadabilityParserCompletionHandler completionHandler; GGReadabilityParserOptions options; NSURL * URL; NSURL * baseURL; long long dataLength; NSMutableData * responseData; NSURLConnection * URLConnection; NSURLResponse * URLResponse; } @property ( nonatomic, assign ) float loadProgress; - (id)initWithOptions:(GGReadabilityParserOptions)parserOptions; - (id)initWithURL:(NSURL *)aURL options:(GGReadabilityParserOptions)parserOptions completionHandler:(GGReadabilityParserCompletionHandler)cHandler errorHandler:(GGReadabilityParserErrorHandler)eHandler; - (void)cancel; - (void)render; - (void)renderWithString:(NSString *)string; - (HTMLElement *)processXMLDocument:(HTMLDocument *)XML baseURL:(NSURL *)theBaseURL error:(NSError **)error; @end
/* Copyright (c) 2012 Curtis Hard - GeekyGoodness */ /* Modified by Denis Zamataev. 2014 */ #import <Foundation/Foundation.h> #import "HTMLReader.h" #import "DZReadability_constants.h" typedef void (^GGReadabilityParserCompletionHandler)( NSString * content ); typedef void (^GGReadabilityParserErrorHandler)( NSError * error ); @interface GGReadabilityParser : NSObject { float loadProgress; @private GGReadabilityParserErrorHandler errorHandler; GGReadabilityParserCompletionHandler completionHandler; GGReadabilityParserOptions options; NSURL * URL; NSURL * baseURL; long long dataLength; NSMutableData * responseData; NSURLConnection * URLConnection; NSURLResponse * URLResponse; } @property ( nonatomic, assign ) float loadProgress; - (id)initWithOptions:(GGReadabilityParserOptions)parserOptions; - (id)initWithURL:(NSURL *)aURL options:(GGReadabilityParserOptions)parserOptions completionHandler:(GGReadabilityParserCompletionHandler)cHandler errorHandler:(GGReadabilityParserErrorHandler)eHandler; - (void)cancel; - (void)render; - (void)renderWithString:(NSString *)string; - (HTMLElement *)processXMLDocument:(HTMLDocument *)XML baseURL:(NSURL *)theBaseURL error:(NSError **)error; @end
Fix HTMLReader include when using dynamic frameworks
Fix HTMLReader include when using dynamic frameworks
C
mit
DZamataev/DZReadability,DZamataev/DZReadability,DZamataev/DZReadability,DZamataev/DZReadability
4f7bf9e92189558747c5298830afd2f9a591b5e8
src/game_state.h
src/game_state.h
// // Created by Borin Ouch on 2016-03-22. // #ifndef SFML_TEST_GAME_STATE_H #define SFML_TEST_GAME_STATE_H #include "game.h" class GameState { public: Game* game; virtual void draw(const float dt) = 0; virtual void update(const float dt) = 0; virtual void handleInput() = 0; }; #endif //SFML_TEST_GAME_STATE_H
// // Created by Borin Ouch on 2016-03-22. // #ifndef SFML_TEST_GAME_STATE_H #define SFML_TEST_GAME_STATE_H #include "game.h" class GameState { public: Game* game; virtual void draw(const float dt) = 0; virtual void update(const float dt) = 0; virtual void handleInput() = 0; virtual ~GameState() {}; }; #endif //SFML_TEST_GAME_STATE_H
Add virtual destructor to game state
Add virtual destructor to game state
C
mit
aceiii/sfml-city-builder
7d38a5e83c37a40d8277b5bbb6097c25fd390c47
include/common.h
include/common.h
#ifndef __SH_COMMON_H__ #define __SH_COMMON_H__ #include <stdio.h> #include <stdlib.h> // ensure is kinda like assert but it is always executed #define ensure(p, msg) \ do { \ if (!(p)) { \ burst_into_flames(__FILE__, __LINE__, msg); \ } \ } while(0) void burst_into_flames(const char* file, int line, const char* msg) { printf("%s - %s:%d", msg, file, line); abort(); } #endif
Add ensure for runtime assertion checking
Add ensure for runtime assertion checking
C
bsd-2-clause
GregBowyer/softheap,GregBowyer/softheap,GregBowyer/softheap,GregBowyer/softheap
4740d588a16d45add192ed3ea58627f06cba9b3f
src/plugin/synchronized_queue.h
src/plugin/synchronized_queue.h
// This is a queue that can be accessed from multiple threads safely. // // It's not well optimized, and requires obtaining a lock every time you check for a new value. #pragma once #include <condition_variable> #include <mutex> #include <optional> #include <queue> template <class T> class SynchronizedQueue { std::condition_variable cv_; std::mutex lock_; std::queue<T> q_; public: void push(T && t) { std::unique_lock l(lock_); q_.push(std::move(t)); cv_.notify_one(); } std::optional<T> get() { std::unique_lock l(lock_); if(q_.empty()) { return std::nullopt; } T t = std::move(q_.front()); q_.pop(); return t; } T get_blocking() { std::unique_lock l(lock_); while(q_.empty()) { cv_.wait(l); } T t = std::move(q_.front()); q_.pop(); return std::move(t); } };
// This is a queue that can be accessed from multiple threads safely. // // It's not well optimized, and requires obtaining a lock every time you check for a new value. #pragma once #include <condition_variable> #include <mutex> #include <optional> #include <queue> template <class T> class SynchronizedQueue { std::condition_variable cv_; std::mutex lock_; std::queue<T> q_; std::atomic_uint64_t input_count{0}, output_count{0}; public: void push(T && t) { std::unique_lock l(lock_); q_.push(std::move(t)); input_count++; cv_.notify_one(); } std::optional<T> get() { if(input_count == output_count) { return std::nullopt; } { std::unique_lock l(lock_); if(q_.empty()) { return std::nullopt; } output_count++; T t = std::move(q_.front()); q_.pop(); return t; } } T get_blocking() { std::unique_lock l(lock_); while(q_.empty()) { cv_.wait(l); } output_count++; T t = std::move(q_.front()); q_.pop(); return std::move(t); } };
Increase the efficiency of multithreading. This should slightly slightly increase frame rate.
Increase the efficiency of multithreading. This should slightly slightly increase frame rate.
C
mit
leecbaker/datareftool,leecbaker/datareftool,leecbaker/datareftool
e1aa0719162620c50ad6f402a1c58ed817f75bf7
libedataserverui/gtk-compat.h
libedataserverui/gtk-compat.h
#ifndef __GTK_COMPAT_H__ #define __GTK_COMPAT_H__ #include <gtk/gtk.h> /* Provide a compatibility layer for accessor functions introduced * in GTK+ 2.21.1 which we need to build with sealed GDK. * That way it is still possible to build with GTK+ 2.20. */ #if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21) \ || (GTK_MINOR_VERSION == 21 && GTK_MICRO_VERSION < 1) #define gdk_drag_context_get_actions(context) (context)->actions #define gdk_drag_context_get_suggested_action(context) (context)->suggested_action #define gdk_drag_context_get_selected_action(context) (context)->action #endif #if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 21 && GTK_MICRO_VERSION == 1 #define gdk_drag_context_get_selected_action(context) gdk_drag_context_get_action(context) #endif #endif /* __GTK_COMPAT_H__ */
#ifndef __GTK_COMPAT_H__ #define __GTK_COMPAT_H__ #include <gtk/gtk.h> /* Provide a compatibility layer for accessor functions introduced * in GTK+ 2.21.1 which we need to build with sealed GDK. * That way it is still possible to build with GTK+ 2.20. */ #if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21) \ || (GTK_MINOR_VERSION == 21 && GTK_MICRO_VERSION < 1) #define gdk_drag_context_get_actions(context) (context)->actions #define gdk_drag_context_get_suggested_action(context) (context)->suggested_action #define gdk_drag_context_get_selected_action(context) (context)->action #endif #if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 21 && GTK_MICRO_VERSION == 1 #define gdk_drag_context_get_selected_action(context) gdk_drag_context_get_action(context) #endif #if GTK_CHECK_VERSION (2,90,5) /* Recreate GdkRegion until we drop GTK2 compatibility. */ #define GdkRegion cairo_region_t #define gdk_region_destroy(region) \ (cairo_region_destroy (region)) #define gdk_region_point_in(region, x, y) \ (cairo_region_contains_point ((region), (x), (y))) #define gdk_region_rectangle(rectangle) \ (((rectangle)->width <= 0 || (rectangle->height <= 0)) ? \ cairo_region_create () : cairo_region_create_rectangle (rectangle)) #endif #endif /* __GTK_COMPAT_H__ */
Work around sudden disappearance of GdkRegion in GTK+ 2.90.5.
Work around sudden disappearance of GdkRegion in GTK+ 2.90.5. API was deprecated and removed in less than two hours! Sheesh!
C
lgpl-2.1
Distrotech/evolution-data-server,tintou/evolution-data-server,Distrotech/evolution-data-server,matzipan/evolution-data-server,matzipan/evolution-data-server,gcampax/evolution-data-server,tintou/evolution-data-server,matzipan/evolution-data-server,Distrotech/evolution-data-server,tintou/evolution-data-server,tintou/evolution-data-server,gcampax/evolution-data-server,matzipan/evolution-data-server,Distrotech/evolution-data-server,gcampax/evolution-data-server,gcampax/evolution-data-server,matzipan/evolution-data-server,Distrotech/evolution-data-server
7efce87f280e015217514c73097a080a47a56f05
src/wclock_test.c
src/wclock_test.c
#include <assert.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include "wclock.h" #ifdef _WIN32 # include <windows.h> static unsigned int sleep(unsigned int x) { Sleep(x * 1000); return 0; } #else # include <unistd.h> #endif int main(void) { double res, t1, t2; wclock clock; if (wclock_init(&clock)) { abort(); } res = wclock_get_res(&clock); printf("%.17g\n", res); assert(res > 0); assert(res < 2e-3); /* presumably the clock has at least ms precision! */ t1 = wclock_get(&clock); printf("%.17g\n", t1); sleep(1); t2 = wclock_get(&clock); printf("%.17g\n", t2); printf("%.17g\n", t2 - t1); assert(fabs(t2 - t1 - 1.) < 1e-1); return 0; }
#include <assert.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include "wclock.h" #ifdef _WIN32 # include <windows.h> static unsigned int sleep(unsigned int x) { Sleep(x * 1000); return 0; } #else # include <unistd.h> #endif int main(void) { double res, t1, t2; wclock clock; if (wclock_init(&clock)) { abort(); } res = wclock_get_res(&clock); printf("%.17g\n", res); assert(res > 0); assert(res < 2e-3); /* presumably the clock has at least ms precision! */ t1 = wclock_get(&clock); printf("%.17g\n", t1); sleep(1); t2 = wclock_get(&clock); printf("%.17g\n", t2); printf("%.17g\n", t2 - t1); assert(t2 - t1 >= 0.9 && t2 - t1 < 1.4); return 0; }
Increase time tolerance to reduce flakiness on slow systems
Increase time tolerance to reduce flakiness on slow systems
C
mit
Rufflewind/calico,Rufflewind/calico,Rufflewind/calico
5da72a7cbfc9d388f6f22aabfefda2bc53ce56c8
test/assertions.h
test/assertions.h
#include <setjmp.h> #include <stdarg.h> #include <stddef.h> #include <cmocka.h> #include "cbor.h" #ifndef ASSERTIONS_H_ #define ASSERTIONS_H_ void assert_uint8(cbor_item_t* item, uint8_t num); void assert_uint16(cbor_item_t* item, uint16_t num); void assert_uint32(cbor_item_t* item, uint32_t num); void assert_uint64(cbor_item_t* item, uint64_t num); void assert_decoder_result(size_t, enum cbor_decoder_status, struct cbor_decoder_result); // TODO: Docs void assert_decoder_result_nedata(size_t, struct cbor_decoder_result); /** * Check that the streaming decoder will returns a correct CBOR_DECODER_NEDATA * result for all inputs from data[0..1] through data[0..(expected-1)]. */ void assert_minimum_input_size(size_t expected, cbor_data data); #endif
#include <setjmp.h> #include <stdarg.h> #include <stddef.h> #include <cmocka.h> #include "cbor.h" #ifndef ASSERTIONS_H_ #define ASSERTIONS_H_ void assert_uint8(cbor_item_t* item, uint8_t num); void assert_uint16(cbor_item_t* item, uint16_t num); void assert_uint32(cbor_item_t* item, uint32_t num); void assert_uint64(cbor_item_t* item, uint64_t num); /** Assert that result `status` and `read` are equal. */ void assert_decoder_result(size_t read, enum cbor_decoder_status status, struct cbor_decoder_result result); /** * Assert that the result is set to CBOR_DECODER_NEDATA with the given * `cbor_decoder_result.required` value. */ void assert_decoder_result_nedata(size_t required, struct cbor_decoder_result result); /** * Check that the streaming decoder returns a correct CBOR_DECODER_NEDATA * result for all inputs from data[0..1] through data[0..(expected-1)]. */ void assert_minimum_input_size(size_t expected, cbor_data data); #endif
Add inline docs for asserts
Add inline docs for asserts
C
mit
PJK/libcbor,PJK/libcbor,PJK/libcbor,PJK/libcbor,PJK/libcbor
8724b1ecb093cf58fc07d51501487c9fc6e07a4c
chap16/setfattr.c
chap16/setfattr.c
/* setfattr.c - sets user extended attributes for a file. * * This program can be viewed as a much simpler version of setfattr(1) utility, * used to set, remove and list a file's extended attributes. All this program * can do, however, is to set user EAs. * * Usage * * $ ./setfattr <name> <value> <file> * * <name> - the name of the EA to be set. Note that the `user.` namespace * is added automatically. * <value> - the value to be set. * <file> - the file to which the program should add the EA. * * Author: Renato Mascarenhas Costa */ #include <unistd.h> #include <sys/types.h> #include <sys/xattr.h> #include <stdio.h> #include <stdlib.h> #include <string.h> static void helpAndLeave(const char *progname, int status); static void pexit(const char *fCall); int main(int argc, char *argv[]) { if (argc != 4) { helpAndLeave(argv[0], EXIT_FAILURE); } char ea_name[BUFSIZ]; char *name, *value, *file; name = argv[1]; value = argv[2]; file = argv[3]; snprintf(ea_name, BUFSIZ, "user.%s", name); if (setxattr(file, ea_name, value, strlen(ea_name), 0) == -1) { pexit("setxattr"); } exit(EXIT_SUCCESS); } static void helpAndLeave(const char *progname, int status) { FILE *stream = stderr; if (status == EXIT_SUCCESS) { stream = stdout; } fprintf(stream, "Usage: %s <name> <value> <file>\n", progname); exit(status); } static void pexit(const char *fCall) { perror(fCall); exit(EXIT_FAILURE); }
Add or replace user extended attributes on a file.
Add or replace user extended attributes on a file. Chapter 16, exercise 1.
C
mit
rmascarenhas/lpi
15828d06faf35837ae1efe22ac5ec05692af2521
buzzLockU.h
buzzLockU.h
#include <sys/types.h> #include <pthread.h> #include "vendor/simclist.h" #ifndef BUZZLOCK_H_ #define BUZZLOCK_H_ #define BZZ_BLACK 1 #define BZZ_GOLD 0 typedef int useconds_t; typedef struct { pid_t id; int color; double waiting_since; } bzz_thread_t; typedef struct { pthread_mutex_t mutex; pthread_cond_t cond; int max_active_threads; int active_threads; useconds_t timeout; list_t threads; list_t waiting_gold_threads; list_t waiting_black_threads; } bzz_t; #include "buzz.h" void* get_thread(int, bzz_t); int full_active_threads(bzz_t); int is_black(bzz_thread_t*); int is_gold(bzz_thread_t*); int is_old(bzz_thread_t*, bzz_t); void add_to_waiting_threads(bzz_thread_t*, bzz_t); void wait(bzz_t); double time_with_usec(); unsigned int num_black_waiting(bzz_t); unsigned int num_gold_waiting(bzz_t); unsigned int num_old_gold_waiting(bzz_t); void add_active(bzz_thread_t*, bzz_t); #endif
#include <sys/types.h> #include <unistd.h> #include <pthread.h> #include "vendor/simclist.h" #ifndef BUZZLOCK_H_ #define BUZZLOCK_H_ #define BZZ_BLACK 1 #define BZZ_GOLD 0 typedef struct { pid_t id; int color; double waiting_since; } bzz_thread_t; typedef struct { pthread_mutex_t mutex; pthread_cond_t cond; int max_active_threads; int active_threads; useconds_t timeout; list_t threads; list_t waiting_gold_threads; list_t waiting_black_threads; } bzz_t; #include "buzz.h" void* get_thread(int, bzz_t); int full_active_threads(bzz_t); int is_black(bzz_thread_t*); int is_gold(bzz_thread_t*); int is_old(bzz_thread_t*, bzz_t); void add_to_waiting_threads(bzz_thread_t*, bzz_t); void wait(bzz_t); double time_with_usec(); unsigned int num_black_waiting(bzz_t); unsigned int num_gold_waiting(bzz_t); unsigned int num_old_gold_waiting(bzz_t); void add_active(bzz_thread_t*, bzz_t); #endif
Use typedef of useconds_t in unistd
Use typedef of useconds_t in unistd
C
mit
skalnik/3210-project-2
ece2d63323bde9fd89956193167e09708802d73c
src/util.h
src/util.h
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef NINJA_UTIL_H_ #define NINJA_UTIL_H_ #pragma once #include <string> // Dump a backtrace to stderr. // |skip_frames| is how many frames to skip; // DumpBacktrace implicitly skips itself already. void DumpBacktrace(int skip_frames); // Log a fatal message, dump a backtrace, and exit. void Fatal(const char* msg, ...); // Canonicalize a path like "foo/../bar.h" into just "bar.h". bool CanonicalizePath(std::string* path, std::string* err); #endif // NINJA_UTIL_H_
// Copyright 2011 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef NINJA_UTIL_H_ #define NINJA_UTIL_H_ #pragma once #include <string> // Log a fatal message, dump a backtrace, and exit. void Fatal(const char* msg, ...); // Canonicalize a path like "foo/../bar.h" into just "bar.h". bool CanonicalizePath(std::string* path, std::string* err); #endif // NINJA_UTIL_H_
Remove the declaration of DumpBacktrace.
Remove the declaration of DumpBacktrace. This function was removed on 01880fb3a2a13f9071e9729c3a13752846828ed2.
C
apache-2.0
synaptek/ninja,rjogrady/ninja,maximuska/ninja,dabrahams/ninja,yannicklm/ninja,hnney/ninja,ninja-build/ninja,dendy/ninja,sorbits/ninja,Ju2ender/ninja,sgraham/ninja,liukd/ninja,purcell/ninja,metti/ninja,tychoish/ninja,jimon/ninja,justinsb/ninja,nocnokneo/ninja,dendy/ninja,dabrahams/ninja,jimon/ninja,dabrahams/ninja,dorgonman/ninja,sxlin/dist_ninja,ukai/ninja,pathscale/ninja,LuaDist/ninja,mgaunard/ninja,lizh06/ninja,curinir/ninja,juntalis/ninja,chenyukang/ninja,jimon/ninja,maximuska/ninja,nornagon/ninja,tfarina/ninja,iwadon/ninja,mathstuf/ninja,pcc/ninja,dpwright/ninja,mdempsky/ninja,ilor/ninja,mutac/ninja,ndsol/subninja,purcell/ninja,chenyukang/ninja,martine/ninja,jsternberg/ninja,okuoku/ninja,justinsb/ninja,tfarina/ninja,ikarienator/ninja,SByer/ninja,automeka/ninja,PetrWolf/ninja,PetrWolf/ninja-main,jendrikillner/ninja,Maratyszcza/ninja-pypi,glensc/ninja,nocnokneo/ninja,martine/ninja,ilor/ninja,bmeurer/ninja,tychoish/ninja,mohamed/ninja,Qix-/ninja,nafest/ninja,kissthink/ninja,jhanssen/ninja,automeka/ninja,maruel/ninja,autopulated/ninja,nocnokneo/ninja,maruel/ninja,TheOneRing/ninja,ehird/ninja,fifoforlifo/ninja,nornagon/ninja,bmeurer/ninja,Maratyszcza/ninja-pypi,iwadon/ninja,vvvrrooomm/ninja,lizh06/ninja,kimgr/ninja,atetubou/ninja,sxlin/dist_ninja,dorgonman/ninja,ikarienator/ninja,mgaunard/ninja,pck/ninja,rnk/ninja,jsternberg/ninja,ikarienator/ninja,sgraham/ninja,pck/ninja,vvvrrooomm/ninja,curinir/ninja,ThiagoGarciaAlves/ninja,bradking/ninja,ehird/ninja,rnk/ninja,metti/ninja,maruel/ninja,PetrWolf/ninja-main,TheOneRing/ninja,jendrikillner/ninja,mydongistiny/ninja,tfarina/ninja,AoD314/ninja,mdempsky/ninja,rnk/ninja,okuoku/ninja,ndsol/subninja,kissthink/ninja,PetrWolf/ninja,ThiagoGarciaAlves/ninja,metti/ninja,barak/ninja,ninja-build/ninja,ctiller/ninja,dpwright/ninja,drbo/ninja,syntheticpp/ninja,iwadon/ninja,atetubou/ninja,nico/ninja,bradking/ninja,nornagon/ninja,autopulated/ninja,fifoforlifo/ninja,kissthink/ninja,mohamed/ninja,nickhutchinson/ninja,kissthink/ninja,kimgr/ninja,pcc/ninja,drbo/ninja,okuoku/ninja,ThiagoGarciaAlves/ninja,SByer/ninja,nickhutchinson/ninja,autopulated/ninja,ctiller/ninja,PetrWolf/ninja,ikarienator/ninja,juntalis/ninja,colincross/ninja,chenyukang/ninja,martine/ninja,nafest/ninja,mutac/ninja,vvvrrooomm/ninja,PetrWolf/ninja-main,hnney/ninja,tfarina/ninja,ukai/ninja,sgraham/ninja,martine/ninja,nicolasdespres/ninja,ctiller/ninja,ignatenkobrain/ninja,mydongistiny/ninja,autopulated/ninja,ehird/ninja,dpwright/ninja,rnk/ninja,okuoku/ninja,dorgonman/ninja,Maratyszcza/ninja-pypi,LuaDist/ninja,PetrWolf/ninja-main,rjogrady/ninja,Ju2ender/ninja,yannicklm/ninja,TheOneRing/ninja,tychoish/ninja,ilor/ninja,bmeurer/ninja,ilor/ninja,AoD314/ninja,cipriancraciun/ninja,Qix-/ninja,mohamed/ninja,jimon/ninja,PetrWolf/ninja,nico/ninja,mathstuf/ninja,ndsol/subninja,juntalis/ninja,automeka/ninja,mohamed/ninja,nafest/ninja,yannicklm/ninja,ninja-build/ninja,mydongistiny/ninja,nafest/ninja,mgaunard/ninja,syntheticpp/ninja,glensc/ninja,sorbits/ninja,dendy/ninja,Maratyszcza/ninja-pypi,purcell/ninja,pathscale/ninja,Qix-/ninja,drbo/ninja,ThiagoGarciaAlves/ninja,atetubou/ninja,moroten/ninja,jhanssen/ninja,pathscale/ninja,curinir/ninja,iwadon/ninja,synaptek/ninja,fifoforlifo/ninja,nornagon/ninja,ignatenkobrain/ninja,syntheticpp/ninja,juntalis/ninja,colincross/ninja,mutac/ninja,hnney/ninja,justinsb/ninja,lizh06/ninja,syntheticpp/ninja,LuaDist/ninja,cipriancraciun/ninja,ninja-build/ninja,synaptek/ninja,vvvrrooomm/ninja,bradking/ninja,mdempsky/ninja,Ju2ender/ninja,mgaunard/ninja,atetubou/ninja,glensc/ninja,nicolasdespres/ninja,nicolasdespres/ninja,glensc/ninja,chenyukang/ninja,guiquanz/ninja,ignatenkobrain/ninja,colincross/ninja,SByer/ninja,jsternberg/ninja,mathstuf/ninja,dpwright/ninja,ctiller/ninja,nico/ninja,pcc/ninja,guiquanz/ninja,maximuska/ninja,maruel/ninja,sorbits/ninja,ignatenkobrain/ninja,jendrikillner/ninja,kimgr/ninja,pathscale/ninja,synaptek/ninja,tychoish/ninja,mathstuf/ninja,dendy/ninja,Qix-/ninja,guiquanz/ninja,jhanssen/ninja,Ju2ender/ninja,fuchsia-mirror/third_party-ninja,ukai/ninja,pck/ninja,curinir/ninja,dorgonman/ninja,SByer/ninja,mdempsky/ninja,drbo/ninja,rjogrady/ninja,nicolasdespres/ninja,hnney/ninja,sxlin/dist_ninja,yannicklm/ninja,ehird/ninja,liukd/ninja,ndsol/subninja,cipriancraciun/ninja,jendrikillner/ninja,LuaDist/ninja,sxlin/dist_ninja,fuchsia-mirror/third_party-ninja,sorbits/ninja,bmeurer/ninja,AoD314/ninja,colincross/ninja,jhanssen/ninja,fifoforlifo/ninja,jsternberg/ninja,metti/ninja,barak/ninja,liukd/ninja,fuchsia-mirror/third_party-ninja,barak/ninja,mydongistiny/ninja,nocnokneo/ninja,sxlin/dist_ninja,liukd/ninja,sxlin/dist_ninja,mutac/ninja,guiquanz/ninja,AoD314/ninja,moroten/ninja,moroten/ninja,nico/ninja,pck/ninja,maximuska/ninja,sxlin/dist_ninja,pcc/ninja,lizh06/ninja,fuchsia-mirror/third_party-ninja,kimgr/ninja,justinsb/ninja,bradking/ninja,moroten/ninja,ukai/ninja,cipriancraciun/ninja,barak/ninja,purcell/ninja,nickhutchinson/ninja,automeka/ninja,dabrahams/ninja,sgraham/ninja,TheOneRing/ninja,rjogrady/ninja,nickhutchinson/ninja
efec94aee0e0c8805645572b73dee3358abb0aac
Category/UIKit/UIKitCategory.h
Category/UIKit/UIKitCategory.h
// // UIKitCategory.h // WWCategory // // Created by ww on 2016. 1. 10.. // Copyright © 2016년 Won Woo Choi. All rights reserved. // #import "UIApplication+Keyboard.h" #import "UIBezierPath+Drawing.h" #import "UIColor+CreateColor.h" #import "UIImage+CreateImage.h" #import "UIImage+ImageProcessing.h" #import "UIImageView+CreateImageView.h" #import "UIScreen+Size.h" #import "UIStoryboard+GetInstance.h" #import "UITextField+Color.h" #import "UIView+Capture.h" #import "UIView+Rounding.h"
// // UIKitCategory.h // WWCategory // // Created by ww on 2016. 1. 10.. // Copyright © 2016년 Won Woo Choi. All rights reserved. // #import "UIApplication+Keyboard.h" #import "UIApplication+TopmostViewController.h" #import "UIBarButtonItem+Block.h" #import "UIBezierPath+Drawing.h" #import "UIButton+Align.h" #import "UICollectionView+Register.h" #import "UIColor+CreateColor.h" #import "UIImage+CreateImage.h" #import "UIImage+ImageProcessing.h" #import "UIImageView+CreateImageView.h" #import "UIScreen+Size.h" #import "UIStoryboard+GetInstance.h" #import "UITableView+Register.h" #import "UITextField+Color.h" #import "UIView+Capture.h" #import "UIView+Rounding.h" #import "UIViewController+Present.h"
Add category headers to global header.
Add category headers to global header.
C
mit
wonwoooochoi/WWCategory
5f955a6888dec963c35283899fd2b2f47f776466
src/sail/game_struct.h
src/sail/game_struct.h
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "../common/id_map.hpp" #include "boat.h" #include "../collisionlib/motion.h" namespace redc { namespace sail { struct Player { std::string name; bool spawned; Hull_Desc boat_config; collis::Motion boat_motion; }; struct Game { ID_Map<Player> players; }; } }
Add unified state of the game
Add unified state of the game
C
bsd-3-clause
RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine
b502a1ea2f1c9735c7af7d67e275532437eb539f
inet_ntop.c
inet_ntop.c
/** * \file inet_ntop * inet_ntop emulation based on inet_ntoa. * \author Matthias Andree * */ #include "config.h" #ifndef HAVE_INET_NTOP #include "leafnode.h" #include "mastring.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> #ifdef WITH_DMALLOC #include <dmalloc.h> #endif #include <string.h> const char * inet_ntop(int af, const void *s, char *dst, int x) { switch (af) { case AF_INET: mastrncpy(dst, inet_ntoa(*(const struct in_addr *)s), x); return dst; break; default: errno = EINVAL; return 0; break; } } #endif
/** * \file inet_ntop * inet_ntop emulation based on inet_ntoa. * \author Matthias Andree * */ #include "config.h" #if !HAVE_INET_NTOP #include "leafnode.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> #include <string.h> const char * inet_ntop(int af, const void *s, char *dst, int x) { switch (af) { case AF_INET: strncpy(dst, inet_ntoa(*(const struct in_addr *)s), x); if (x) dst[x-1] = '\0'; return dst; break; default: errno = EINVAL; return 0; break; } } #endif
Drop dmalloc.h, not needed. Drop dmalloc.h, not needed. Use strncpy for portability, we do not want this function to rely on mastring.
Drop dmalloc.h, not needed. Drop dmalloc.h, not needed. Use strncpy for portability, we do not want this function to rely on mastring.
C
lgpl-2.1
BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode
961e242c923ee1064fcdda28e7cb0d56c3da27f8
misc/read-region.c
misc/read-region.c
/* Test program to make a single openslide_read_region() call and write the result as a PPM. */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <inttypes.h> #include <assert.h> #include <openslide.h> int main(int argc, char **argv) { if (argc != 7) { printf("Arguments: slide out.ppm x y w h\n"); return 1; } char *slide = argv[1]; char *out = argv[2]; int64_t x = atoi(argv[3]); int64_t y = atoi(argv[4]); int64_t w = atoi(argv[5]); int64_t h = atoi(argv[6]); uint32_t *buf = malloc(w * h * 4); openslide_t *osr = openslide_open(slide); assert(osr != NULL); openslide_read_region(osr, buf, x, y, 0, w, h); assert(openslide_get_error(osr) == NULL); openslide_close(osr); FILE *fp; fp = fopen(out, "w"); assert(fp != NULL); fprintf(fp, "P6\n# Extraneous comment\n%"PRIu64" %"PRIu64" 255\n", w, h); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { uint32_t sample = buf[y * h + x]; // undo premultiplication, more or less double alpha = ((sample >> 24) ?: 1) / 255.0; uint8_t pixel[3] = { ((sample >> 16) & 0xff) / alpha, ((sample >> 8) & 0xff) / alpha, (sample & 0xff) / alpha, }; fwrite(pixel, 1, sizeof(pixel), fp); } } fclose(fp); free(buf); }
Add program for testing large openslide_read_region() calls
Add program for testing large openslide_read_region() calls Use nip2 to read the output.
C
lgpl-2.1
openslide/openslide,openslide/openslide,openslide/openslide,openslide/openslide
58f00f52de054b44bec79497e33805f57d8bc8e5
EVGEN/AliDecayer.h
EVGEN/AliDecayer.h
#ifndef ALI_DECAYER__H #define ALI_DECAYER__H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ #include "RVersion.h" #include "TVirtualMCDecayer.h" typedef TVirtualMCDecayer AliDecayer; #if ROOT_VERSION_CODE >= 197633 //Corresponds to Root v3-04-01 typedef enum { kSemiElectronic, kDiElectron, kSemiMuonic, kDiMuon, kBJpsiDiMuon, kBJpsiDiElectron, kBPsiPrimeDiMuon, kBPsiPrimeDiElectron, kPiToMu, kKaToMu, kNoDecay, kHadronicD, kOmega, kPhiKK, kAll, kNoDecayHeavy, kHardMuons, kBJpsi, kWToMuon,kWToCharm, kWToCharmToMuon } Decay_t; #endif #endif //ALI_DECAYER__H
#ifndef ALI_DECAYER__H #define ALI_DECAYER__H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ #include "RVersion.h" #include "TVirtualMCDecayer.h" typedef TVirtualMCDecayer AliDecayer; #if ROOT_VERSION_CODE >= 197633 //Corresponds to Root v3-04-01 typedef enum { kSemiElectronic, kDiElectron, kSemiMuonic, kDiMuon, kBJpsiDiMuon, kBJpsiDiElectron, kBPsiPrimeDiMuon, kBPsiPrimeDiElectron, kPiToMu, kKaToMu, kNoDecay, kHadronicD, kOmega, kPhiKK, kAll, kNoDecayHeavy, kHardMuons, kBJpsi, kWToMuon,kWToCharm, kWToCharmToMuon, kNewTest } Decay_t; #endif #endif //ALI_DECAYER__H
Test case for B0 -> mu
Test case for B0 -> mu
C
bsd-3-clause
jgrosseo/AliRoot,alisw/AliRoot,sebaleh/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,shahor02/AliRoot,miranov25/AliRoot,shahor02/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,shahor02/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,alisw/AliRoot,jgrosseo/AliRoot,alisw/AliRoot,shahor02/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,ALICEHLT/AliRoot,coppedis/AliRoot,miranov25/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,shahor02/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,alisw/AliRoot,miranov25/AliRoot,ALICEHLT/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,miranov25/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,miranov25/AliRoot
22c56c3a03b377d21d8363f737aa2a855d892458
arch/mips/oprofile/op_impl.h
arch/mips/oprofile/op_impl.h
/** * @file arch/alpha/oprofile/op_impl.h * * @remark Copyright 2002 OProfile authors * @remark Read the file COPYING * * @author Richard Henderson <[email protected]> */ #ifndef OP_IMPL_H #define OP_IMPL_H 1 struct pt_regs; extern int null_perf_irq(void); extern int (*perf_irq)(void); /* Per-counter configuration as set via oprofilefs. */ struct op_counter_config { unsigned long enabled; unsigned long event; unsigned long count; /* Dummies because I am too lazy to hack the userspace tools. */ unsigned long kernel; unsigned long user; unsigned long exl; unsigned long unit_mask; }; /* Per-architecture configury and hooks. */ struct op_mips_model { void (*reg_setup) (struct op_counter_config *); void (*cpu_setup) (void * dummy); int (*init)(void); void (*exit)(void); void (*cpu_start)(void *args); void (*cpu_stop)(void *args); char *cpu_type; unsigned char num_counters; }; #endif
/** * @file arch/alpha/oprofile/op_impl.h * * @remark Copyright 2002 OProfile authors * @remark Read the file COPYING * * @author Richard Henderson <[email protected]> */ #ifndef OP_IMPL_H #define OP_IMPL_H 1 extern int null_perf_irq(void); extern int (*perf_irq)(void); /* Per-counter configuration as set via oprofilefs. */ struct op_counter_config { unsigned long enabled; unsigned long event; unsigned long count; /* Dummies because I am too lazy to hack the userspace tools. */ unsigned long kernel; unsigned long user; unsigned long exl; unsigned long unit_mask; }; /* Per-architecture configury and hooks. */ struct op_mips_model { void (*reg_setup) (struct op_counter_config *); void (*cpu_setup) (void * dummy); int (*init)(void); void (*exit)(void); void (*cpu_start)(void *args); void (*cpu_stop)(void *args); char *cpu_type; unsigned char num_counters; }; #endif
Delete unneeded pt_regs forward declaration.
[MIPS] Delete unneeded pt_regs forward declaration. Signed-off-by: Ralf Baechle <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
a7540887e8b5cb34ee28c12bef863bad85c65b6f
test/Driver/coverage.c
test/Driver/coverage.c
// Test coverage flag. // // RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s // CLANG-CL-COVERAGE-NOT: error: // CLANG-CL-COVERAGE-NOT: warning: // CLANG-CL-COVERAGE-NOT: argument unused // CLANG-CL-COVERAGE-NOT: unknown argument
// Test coverage flag. // REQUIRES: system-windows // // RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s // CLANG-CL-COVERAGE-NOT: error: // CLANG-CL-COVERAGE-NOT: warning: // CLANG-CL-COVERAGE-NOT: argument unused // CLANG-CL-COVERAGE-NOT: unknown argument
Add a missing "REQUIRES: system-windows" to a Windows-only test.
Add a missing "REQUIRES: system-windows" to a Windows-only test. This un-breaks builds on other platforms. Otherwise, they fail due to warnings like: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found] git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@317716 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,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
6d31cc20116485bf732cdd9e3e8d7ebaa9b24f25
master/basic.h
master/basic.h
//Basic master parser extern uint8_t MODBUSParseResponseBasic( union MODBUSParser * );
//Basic master parser extern uint8_t MODBUSParseResponseBasic( union MODBUSParser *, union MODBUSParser * );
Add passing of request frame to parsing functions
Add passing of request frame to parsing functions
C
mit
Jacajack/modlib
8493cdb9c63ed7a720a4b8e6077c07fa1513659b
test/small2/index1.c
test/small2/index1.c
#include "../small1/testharness.h" // NUMERRORS 1 struct foo { int a[8]; int *b; } gfoo; struct bar { int a[8]; int *b; }; int main() { int * __INDEX p = & gfoo.a[2]; // Force gfoo.a to have a length // This should be Ok, but pbar->b is gfoo.a[7] struct bar *pbar = (struct bar*)&gfoo; gfoo.a[7] = 5; pbar->b = 0; printf("Pointer is %lx\n", (unsigned long)pbar->b); *(pbar->b) = 0; //ERROR(1): Null SUCCESS; }
#include "../small1/testharness.h" #include "../small1/testkinds.h" // NUMERRORS 3 struct foo { int a[8]; int *b; } gfoo; struct bar { int a[8]; int *b; }; #if ERROR == 2 struct s1 { int a[8]; int *b; } * s1; struct s2 { int *c; int d[8]; } * s2; #endif #if ERROR == 3 struct s_with_index { int __INDEX arr[8] __INDEX; } * s1; struct s_with_non_array { int a,b,c,d,e,f,g,h; } * s2; #endif int main() { int * __INDEX p = & gfoo.a[2]; // Force gfoo.a to have a length // This should be Ok, but pbar->b is gfoo.a[7] struct bar *pbar = (struct bar*)&gfoo; pbar->b = 0; gfoo.a[7] = 5; printf("Pointer is %lx\n", (unsigned long)pbar->b); *(pbar->b) = 0; //ERROR(1): Null s1 = s2; if (HAS_KIND(s1, WILD_KIND)) E(2); // ERROR(2):Error #if ERROR == 3 s1 = s2; // ERROR(3): compared with a non-array #endif SUCCESS; }
Change the solver handling of arrays. Previously we were calling compat on the pointers underneath matching arrays. However, this led to problems: union { char a[8]; int b[2]; } This is in fact fine, but we'd end up with compat edges between a node pointing to char and a node pointing to int and they wouldn't be congruent so they would end up being WILD. However, if one of them is INDEX, the other should be as well. So we remember whenever an array is compared against another array and we make sure that they have the same flags. However: union { char a[4] __INDEX; int b; } Should fail. So we remember whenever an array is compared with a non-array. Later, if any such array ends up being INDEX we die with an error in the solver.
Change the solver handling of arrays. Previously we were calling compat on the pointers underneath matching arrays. However, this led to problems: union { char a[8]; int b[2]; } This is in fact fine, but we'd end up with compat edges between a node pointing to char and a node pointing to int and they wouldn't be congruent so they would end up being WILD. However, if one of them is INDEX, the other should be as well. So we remember whenever an array is compared against another array and we make sure that they have the same flags. However: union { char a[4] __INDEX; int b; } Should fail. So we remember whenever an array is compared with a non-array. Later, if any such array ends up being INDEX we die with an error in the solver. This commit also beefs up the test-bad/index1 testcase.
C
bsd-3-clause
samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c
9625f1629e5a43315077d066fe32bfa8bc415715
alura/c/tabuada2.c
alura/c/tabuada2.c
#include <stdio.h> void abertura(int m) { printf("Tabuada do %d\n", m); } int main() { int multiplicador = 2; abertura(multiplicador); for(int i = 1; i <= 10; i++) { printf("%d x %d = %d\n", multiplicador, i, multiplicador * i); } }
Update files, Alura, Introdução a C - Parte 2, Aula 4.3
Update files, Alura, Introdução a C - Parte 2, Aula 4.3
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
64a8dc5bd7c39e8ac93dc314d06aef8bba6bdd78
test2/parsing/expr_if_assign.c
test2/parsing/expr_if_assign.c
// RUN: %check -e %s f(int a, int b, int dir) { struct { int x, y; } c = { }; a & b ? c.x += dir : c.y += dir; // CHECK: error: assignment to int/if - not an lvalue }
Test for parsing assignment in a ?:'s rhs
Test for parsing assignment in a ?:'s rhs
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
7ed253755ce6b40f7b88662723aeff2d62e52336
src/lib/VSDXDocumentStructure.h
src/lib/VSDXDocumentStructure.h
/* libvisio * Copyright (C) 2011 Fridrich Strba <[email protected]> * Copyright (C) 2011 Eilidh McAdam <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02111-1301 USA */ #ifndef VSDXDOCUMENTSTRUCTURE_H #define VSDXDOCUMENTSTRUCTURE_H #endif /* VSDXDOCUMENTSTRUCTURE_H */
Add an empty header that will contain defines concerning the document structure
Add an empty header that will contain defines concerning the document structure
C
mpl-2.0
LibreOffice/libvisio,LibreOffice/libvisio,sdteffen/libvisio,sdteffen/libvisio,LibreOffice/libvisio,sdteffen/libvisio,sdteffen/libvisio
6fe16f4a387a58169ee4fa48c25d76c362a41d6a
Sub-Terra/include/Renderer.h
Sub-Terra/include/Renderer.h
#pragma once #include <boost/container/vector.hpp> #include "System.h" class Renderer : public System { protected: uint16_t width = 1280; uint16_t height = 720; Decimal fovPlus = glm::radians(10.0f); Decimal zNear = 0.05f; Decimal zFar = 48.0f; Decimal pixelDistanceFromScreen = 1000.0f; public: bool showFPS = false; uint32_t time = 0; static bool IsSupported() { return false; } Renderer(Polar *engine) : System(engine) {} virtual void MakePipeline(const boost::container::vector<std::string> &) = 0; virtual void SetClearColor(const Point4 &) = 0; virtual Decimal GetUniformDecimal(const std::string &, const Decimal = 0) = 0; virtual Point3 GetUniformPoint3(const std::string &, const Point3 = Point3(0)) = 0; virtual void SetUniform(const std::string &, glm::uint32) = 0; virtual void SetUniform(const std::string &, Decimal) = 0; virtual void SetUniform(const std::string &, Point3) = 0; };
#pragma once #include <boost/container/vector.hpp> #include "System.h" class Renderer : public System { protected: uint16_t width = 1280; uint16_t height = 720; Decimal fovPlus = glm::radians(10.0f); Decimal zNear = 0.05f; Decimal zFar = 48.0f; Decimal pixelDistanceFromScreen = 1000.0f; public: bool showFPS = false; uint32_t time = 0; static bool IsSupported() { return false; } Renderer(Polar *engine) : System(engine) {} inline uint16_t GetWidth() { return width; } inline uint16_t GetHeight() { return height; } virtual void MakePipeline(const boost::container::vector<std::string> &) = 0; virtual void SetClearColor(const Point4 &) = 0; virtual Decimal GetUniformDecimal(const std::string &, const Decimal = 0) = 0; virtual Point3 GetUniformPoint3(const std::string &, const Point3 = Point3(0)) = 0; virtual void SetUniform(const std::string &, glm::uint32) = 0; virtual void SetUniform(const std::string &, Decimal) = 0; virtual void SetUniform(const std::string &, Point3) = 0; };
Add getters for width/height of renderer
Add getters for width/height of renderer
C
mpl-2.0
polar-engine/polar,shockkolate/polar4,polar-engine/polar,shockkolate/polar4,shockkolate/polar4,shockkolate/polar4
2f947132e0af53bcb7863629589e989d8c6262f2
packages/Python/lldbsuite/test/functionalities/swift-runtime-reporting/abi-v2/library.h
packages/Python/lldbsuite/test/functionalities/swift-runtime-reporting/abi-v2/library.h
// library.h // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // // ----------------------------------------------------------------------------- // From swift's include/swift/Runtime/Debug.h file. struct RuntimeErrorDetails { uintptr_t version; const char *errorType; const char *currentStackDescription; uintptr_t framesToSkip; void *memoryAddress; struct Thread { const char *description; uint64_t threadID; uintptr_t numFrames; void **frames; }; uintptr_t numExtraThreads; Thread *threads; struct FixIt { const char *filename; uintptr_t startLine; uintptr_t startColumn; uintptr_t endLine; uintptr_t endColumn; const char *replacementText; }; struct Note { const char *description; uintptr_t numFixIts; FixIt *fixIts; }; uintptr_t numFixIts; FixIt *fixIts; uintptr_t numNotes; Note *notes; }; enum: uintptr_t { RuntimeErrorFlagNone = 0, RuntimeErrorFlagFatal = 1 << 0 }; extern "C" void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);
// library.h // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // // ----------------------------------------------------------------------------- #include <stdint.h> // From swift's include/swift/Runtime/Debug.h file. struct RuntimeErrorDetails { uintptr_t version; const char *errorType; const char *currentStackDescription; uintptr_t framesToSkip; void *memoryAddress; struct Thread { const char *description; uint64_t threadID; uintptr_t numFrames; void **frames; }; uintptr_t numExtraThreads; Thread *threads; struct FixIt { const char *filename; uintptr_t startLine; uintptr_t startColumn; uintptr_t endLine; uintptr_t endColumn; const char *replacementText; }; struct Note { const char *description; uintptr_t numFixIts; FixIt *fixIts; }; uintptr_t numFixIts; FixIt *fixIts; uintptr_t numNotes; Note *notes; }; enum: uintptr_t { RuntimeErrorFlagNone = 0, RuntimeErrorFlagFatal = 1 << 0 }; extern "C" void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);
Include the necessary headers to make the swift-runtime-reporting test work.
[testsuite] Include the necessary headers to make the swift-runtime-reporting test work.
C
apache-2.0
apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
2f7233f074e58e9d8690af8ca2c3aa6a61661819
projects/com.oracle.truffle.llvm.test/tests/c/address-to-function-ptr-call.c
projects/com.oracle.truffle.llvm.test/tests/c/address-to-function-ptr-call.c
void abort(); int add(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } int mul(int a, int b) { return a * b; } int div(int a, int b) { return a / b; } int rem(int a, int b) { return a % b; } long *arr[5] = {(long *)&add, (long *)&sub, (long *)&mul, (long *)&div, (long *)&rem }; int main() { int i; int sum = 0; for (i = 0; i < 10000; i++) { int (*p)(int x, int y) = (int (*)(int x, int y))arr[i % 5]; sum += p(i, 2); } if (sum != 44991000) { abort(); } }
Add test case for casting addresses to function pointers
Add test case for casting addresses to function pointers
C
bsd-3-clause
lxp/sulong,PrinzKatharina/sulong,lxp/sulong,lxp/sulong,crbb/sulong,PrinzKatharina/sulong,crbb/sulong,lxp/sulong,PrinzKatharina/sulong,crbb/sulong,PrinzKatharina/sulong,crbb/sulong
71c0305e5ae4e2734e92d3760992a3856b62f6be
inc/osvr/Server/ServerPtr.h
inc/osvr/Server/ServerPtr.h
/** @file @brief Header @date 2014 @author Ryan Pavlik <[email protected]> <http://sensics.com> */ // Copyright 2014 Sensics, Inc. // // All rights reserved. // // (Final version intended to be licensed under // the Apache License, Version 2.0) #ifndef INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207 #define INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207 // Internal Includes #include <osvr/Util/SharedPtr.h> // Library/third-party includes // - none // Standard includes // - none namespace osvr { namespace server { class Server; /// @brief How one should hold a Server. typedef shared_ptr<Server> ServerPtr; } // namespace server } // namespace osvr #endif // INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207
/** @file @brief Header @date 2014 @author Ryan Pavlik <[email protected]> <http://sensics.com> */ // Copyright 2014 Sensics, Inc. // // All rights reserved. // // (Final version intended to be licensed under // the Apache License, Version 2.0) #ifndef INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207 #define INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207 // Internal Includes #include <osvr/Util/SharedPtr.h> // Library/third-party includes // - none // Standard includes // - none namespace osvr { namespace server { class Server; /// @brief How one should hold a Server. typedef shared_ptr<Server> ServerPtr; /// @brief How one might observe a Server without owning it. typedef weak_ptr<Server> ServerWeakPtr; } // namespace server } // namespace osvr #endif // INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207
Add a weak pointer type for the server.
Add a weak pointer type for the server.
C
apache-2.0
d235j/OSVR-Core,leemichaelRazer/OSVR-Core,Armada651/OSVR-Core,OSVR/OSVR-Core,OSVR/OSVR-Core,feilen/OSVR-Core,OSVR/OSVR-Core,Armada651/OSVR-Core,d235j/OSVR-Core,feilen/OSVR-Core,feilen/OSVR-Core,leemichaelRazer/OSVR-Core,leemichaelRazer/OSVR-Core,d235j/OSVR-Core,OSVR/OSVR-Core,d235j/OSVR-Core,feilen/OSVR-Core,Armada651/OSVR-Core,godbyk/OSVR-Core,godbyk/OSVR-Core,OSVR/OSVR-Core,feilen/OSVR-Core,Armada651/OSVR-Core,d235j/OSVR-Core,godbyk/OSVR-Core,leemichaelRazer/OSVR-Core,leemichaelRazer/OSVR-Core,godbyk/OSVR-Core,OSVR/OSVR-Core,Armada651/OSVR-Core,godbyk/OSVR-Core,godbyk/OSVR-Core