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
f6890fe5dbf709d7edc28413f8250f0077d2f006
RISCOS/Modules/getpath_riscos.c
RISCOS/Modules/getpath_riscos.c
#include "Python.h" #include "osdefs.h" static char *prefix,*exec_prefix,*progpath,*module_search_path=0; static void calculate_path() { char *pypath=getenv("Python$Path"); if(pypath) { module_search_path=malloc(strlen(pypath)+1); if (module_search_path) sprintf(module_search_path,"%s",pypath); else { /* We can't exit, so print a warning and limp along */ fprintf(stderr, "Not enough memory for dynamic PYTHONPATH.\n"); fprintf(stderr, "Using default static PYTHONPATH.\n"); } } if(!module_search_path) module_search_path = "<Python$Dir>.Lib"; prefix="<Python$Dir>"; exec_prefix=prefix; progpath=Py_GetProgramName(); } /* External interface */ char * Py_GetPath() { if (!module_search_path) calculate_path(); return module_search_path; } char * Py_GetPrefix() { if (!module_search_path) calculate_path(); return prefix; } char * Py_GetExecPrefix() { if (!module_search_path) calculate_path(); return exec_prefix; } char * Py_GetProgramFullPath() { if (!module_search_path) calculate_path(); return progpath; }
#include "Python.h" #include "osdefs.h" static char *prefix, *exec_prefix, *progpath, *module_search_path=NULL; static void calculate_path() { char *pypath = getenv("Python$Path"); if (pypath) { int pathlen = strlen(pypath); module_search_path = malloc(pathlen + 1); if (module_search_path) strncpy(module_search_path, pypath, pathlen); else { fprintf(stderr, "Not enough memory for dynamic PYTHONPATH.\n" "Using default static PYTHONPATH.\n"); } } if (!module_search_path) module_search_path = "<Python$Dir>.Lib"; prefix = "<Python$Dir>"; exec_prefix = prefix; progpath = Py_GetProgramName(); } /* External interface */ char * Py_GetPath() { if (!module_search_path) calculate_path(); return module_search_path; } char * Py_GetPrefix() { if (!module_search_path) calculate_path(); return prefix; } char * Py_GetExecPrefix() { if (!module_search_path) calculate_path(); return exec_prefix; } char * Py_GetProgramFullPath() { if (!module_search_path) calculate_path(); return progpath; }
Use strncpy() instead of sprintf() in calculate_path().
Use strncpy() instead of sprintf() in calculate_path(). Also reformat calculate_path() using the standard format.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
2855f6de3836d6e6c1ee7846851bc27930824d2b
src/event.h
src/event.h
#define JLOG LOG #define HLOG(D_msg) JLOG("HNDL: " << D_msg) enum class EventType { Trigger, Disconnect }; inline std::string toString(EventType type) { switch (type) { case EventType::Trigger: return "trigger"; case EventType::Disconnect: return "disconnect"; default: RAISE("Unknown event type"); } } inline std::ostream& operator<<(std::ostream& o, EventType type) { return o << toString(type); } struct NodeHandler : Handler { using Handler::Handler; // FIX: workaround GCC 4.9 NodeHandler(Handler&& h) : Handler(std::move(h)) {} std::string name; EventType type; // container section ListHook queue; // list of scheduled handlers //ListHook front; // list of available handlers void invoke() { HLOG("invoking: " << name << " [" << type << "]"); (*this)(); delete this; } static NodeHandler& create(Handler handler, std::string name, EventType type) { HLOG("creating: " << name); auto* h = new NodeHandler(std::move(handler)); h->name = std::move(name); h->type = type; return *h; } };
#define JLOG LOG #define HLOG(D_msg) JLOG("HNDL: " << D_msg) enum class EventType { Trigger, Disconnect }; inline std::string toString(EventType type) { switch (type) { case EventType::Trigger: return "trigger"; case EventType::Disconnect: return "disconnect"; default: RAISE("Unknown event type"); } } inline std::ostream& operator<<(std::ostream& o, EventType type) { return o << toString(type); } struct NodeHandler; inline void attach(NodeHandler& h); struct NodeHandler : Handler { using Handler::Handler; // FIX: workaround GCC 4.9 NodeHandler(Handler&& h) : Handler(std::move(h)) {} std::string name; EventType type; // container section ListHook queue; // list of scheduled handlers ListHook all; // list of all handlers void invoke() { HLOG("invoking: " << name << " [" << type << "]"); (*this)(); delete this; } static NodeHandler& create(Handler handler, std::string name, EventType type) { HLOG("creating: " << name); auto* h = new NodeHandler(std::move(handler)); attach(*h); h->name = std::move(name); h->type = type; return *h; } }; using Handlers = List<NodeHandler, &NodeHandler::all>; inline void attach(NodeHandler& h) { An<Handlers>()->push_back(h); }
Add handlers to the common list
Add handlers to the common list
C
apache-2.0
gridem/DAVE
db02329581ccd65614b1d81c9b121debb1e8e22e
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; 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 { 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
Add enum to distinct pattern
Add enum to distinct pattern
C
mit
kenhys/fake-lock-screen-pattern,kenhys/fake-lock-screen-pattern
11c7bdb4e410102af298943526a48fffa9a9eb19
src/include/strdup.h
src/include/strdup.h
/* This is the prototype for the strdup() function which is distributed with Postgres. That strdup() is only needed on those systems that don't already have strdup() in their system libraries. The Postgres strdup() is in src/utils/strdup.c. */ extern char *strdup(char const *);
/* This is the prototype for the strdup() function which is distributed with Postgres. That strdup() is only needed on those systems that don't already have strdup() in their system libraries. The Postgres strdup() is in src/port/strdup.c. */ extern char *strdup(char const *);
Fix an obsolete file path mentioned in a comment.
Fix an obsolete file path mentioned in a comment.
C
mpl-2.0
techdragon/Postgres-XL,ovr/postgres-xl,kmjungersen/PostgresXL,techdragon/Postgres-XL,adam8157/gpdb,zeroae/postgres-xl,oberstet/postgres-xl,rubikloud/gpdb,yazun/postgres-xl,janebeckman/gpdb,lintzc/gpdb,edespino/gpdb,cjcjameson/gpdb,chrishajas/gpdb,edespino/gpdb,royc1/gpdb,rvs/gpdb,snaga/postgres-xl,lisakowen/gpdb,CraigHarris/gpdb,Quikling/gpdb,adam8157/gpdb,rubikloud/gpdb,jmcatamney/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,Quikling/gpdb,rvs/gpdb,royc1/gpdb,cjcjameson/gpdb,rubikloud/gpdb,Postgres-XL/Postgres-XL,Chibin/gpdb,snaga/postgres-xl,tangp3/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,janebeckman/gpdb,edespino/gpdb,Chibin/gpdb,tpostgres-projects/tPostgres,atris/gpdb,randomtask1155/gpdb,zeroae/postgres-xl,zaksoup/gpdb,kmjungersen/PostgresXL,ahachete/gpdb,rvs/gpdb,edespino/gpdb,lisakowen/gpdb,Quikling/gpdb,randomtask1155/gpdb,atris/gpdb,edespino/gpdb,jmcatamney/gpdb,rubikloud/gpdb,yuanzhao/gpdb,0x0FFF/gpdb,foyzur/gpdb,atris/gpdb,adam8157/gpdb,postmind-net/postgres-xl,zaksoup/gpdb,ashwinstar/gpdb,xuegang/gpdb,rubikloud/gpdb,oberstet/postgres-xl,rvs/gpdb,royc1/gpdb,pavanvd/postgres-xl,postmind-net/postgres-xl,techdragon/Postgres-XL,techdragon/Postgres-XL,randomtask1155/gpdb,greenplum-db/gpdb,royc1/gpdb,chrishajas/gpdb,randomtask1155/gpdb,lpetrov-pivotal/gpdb,xuegang/gpdb,jmcatamney/gpdb,zaksoup/gpdb,tpostgres-projects/tPostgres,kaknikhil/gpdb,randomtask1155/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,postmind-net/postgres-xl,0x0FFF/gpdb,snaga/postgres-xl,rubikloud/gpdb,50wu/gpdb,ahachete/gpdb,tangp3/gpdb,lpetrov-pivotal/gpdb,xinzweb/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,50wu/gpdb,chrishajas/gpdb,rvs/gpdb,xuegang/gpdb,xuegang/gpdb,edespino/gpdb,yuanzhao/gpdb,oberstet/postgres-xl,50wu/gpdb,arcivanov/postgres-xl,royc1/gpdb,ashwinstar/gpdb,janebeckman/gpdb,ahachete/gpdb,zaksoup/gpdb,arcivanov/postgres-xl,adam8157/gpdb,xuegang/gpdb,lpetrov-pivotal/gpdb,yazun/postgres-xl,Postgres-XL/Postgres-XL,tangp3/gpdb,kaknikhil/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,cjcjameson/gpdb,Chibin/gpdb,royc1/gpdb,rvs/gpdb,techdragon/Postgres-XL,rvs/gpdb,ahachete/gpdb,Chibin/gpdb,atris/gpdb,ahachete/gpdb,kmjungersen/PostgresXL,greenplum-db/gpdb,Chibin/gpdb,yazun/postgres-xl,kaknikhil/gpdb,pavanvd/postgres-xl,janebeckman/gpdb,Chibin/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,foyzur/gpdb,0x0FFF/gpdb,xinzweb/gpdb,tangp3/gpdb,rvs/gpdb,yuanzhao/gpdb,lisakowen/gpdb,xinzweb/gpdb,lintzc/gpdb,yuanzhao/gpdb,foyzur/gpdb,50wu/gpdb,lisakowen/gpdb,ahachete/gpdb,xinzweb/gpdb,tangp3/gpdb,CraigHarris/gpdb,ovr/postgres-xl,zaksoup/gpdb,Quikling/gpdb,tpostgres-projects/tPostgres,rubikloud/gpdb,chrishajas/gpdb,janebeckman/gpdb,randomtask1155/gpdb,cjcjameson/gpdb,Chibin/gpdb,janebeckman/gpdb,Chibin/gpdb,zaksoup/gpdb,ahachete/gpdb,yuanzhao/gpdb,lintzc/gpdb,randomtask1155/gpdb,zeroae/postgres-xl,foyzur/gpdb,postmind-net/postgres-xl,lintzc/gpdb,yuanzhao/gpdb,0x0FFF/gpdb,50wu/gpdb,tpostgres-projects/tPostgres,royc1/gpdb,atris/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,lintzc/gpdb,lisakowen/gpdb,cjcjameson/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,edespino/gpdb,janebeckman/gpdb,tangp3/gpdb,50wu/gpdb,cjcjameson/gpdb,atris/gpdb,Quikling/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,lisakowen/gpdb,jmcatamney/gpdb,rvs/gpdb,adam8157/gpdb,xuegang/gpdb,edespino/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,janebeckman/gpdb,zaksoup/gpdb,ashwinstar/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,chrishajas/gpdb,ashwinstar/gpdb,kmjungersen/PostgresXL,Quikling/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,rvs/gpdb,arcivanov/postgres-xl,lintzc/gpdb,janebeckman/gpdb,randomtask1155/gpdb,greenplum-db/gpdb,chrishajas/gpdb,50wu/gpdb,chrishajas/gpdb,ovr/postgres-xl,ashwinstar/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,pavanvd/postgres-xl,arcivanov/postgres-xl,0x0FFF/gpdb,yuanzhao/gpdb,kmjungersen/PostgresXL,lisakowen/gpdb,snaga/postgres-xl,Quikling/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,tangp3/gpdb,foyzur/gpdb,snaga/postgres-xl,atris/gpdb,Quikling/gpdb,xuegang/gpdb,yazun/postgres-xl,50wu/gpdb,lintzc/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,royc1/gpdb,Quikling/gpdb,CraigHarris/gpdb,lpetrov-pivotal/gpdb,CraigHarris/gpdb,Chibin/gpdb,kaknikhil/gpdb,oberstet/postgres-xl,arcivanov/postgres-xl,adam8157/gpdb,CraigHarris/gpdb,ovr/postgres-xl,Postgres-XL/Postgres-XL,zaksoup/gpdb,Chibin/gpdb,CraigHarris/gpdb,lisakowen/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,oberstet/postgres-xl,foyzur/gpdb,arcivanov/postgres-xl,tangp3/gpdb,yuanzhao/gpdb,xinzweb/gpdb,adam8157/gpdb,cjcjameson/gpdb,adam8157/gpdb,ashwinstar/gpdb,xuegang/gpdb,chrishajas/gpdb,edespino/gpdb,xinzweb/gpdb,foyzur/gpdb,0x0FFF/gpdb,greenplum-db/gpdb,xuegang/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,Quikling/gpdb,CraigHarris/gpdb,postmind-net/postgres-xl,rubikloud/gpdb,ashwinstar/gpdb,ahachete/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,kaknikhil/gpdb,atris/gpdb,yazun/postgres-xl
5a3d7873993eb4c6f4e4d650e2b46b0d403fecd3
kernel/core/main.c
kernel/core/main.c
#include <truth/panic.h> #include <truth/cpu.h> #include <truth/types.h> #include <truth/log.h> #include <truth/slab.h> #include <truth/heap.h> #include <truth/physical_allocator.h> string Logo = str("\n" " _.-.\n" " .-. `) | .-.\n" " _.'`. .~./ \\.~. .`'._\n" " .-' .'.'.'.-| |-.'.'.'. '-.\n" " `'`'`'`'` \\ / `'`'`'`'`\n" " /||\\\n" " //||\\\\\n" "\n" " The Kernel of Truth\n"); void kernel_main(void *multiboot_tables) { enum status status = init_log("log"); assert(status == Ok); log(Logo); logf("\tVersion %d.%d.%d\n\tCommit %s\n\t%s\n", kernel_major, kernel_minor, kernel_patch, vcs_version, project_website); init_interrupts(); init_physical_allocator(multiboot_tables); init_slab(); status = init_heap(); assert(status == Ok); halt(); }
#include <truth/panic.h> #include <truth/cpu.h> #include <truth/types.h> #include <truth/log.h> #include <truth/slab.h> #include <truth/heap.h> #include <truth/physical_allocator.h> string Logo = str("\n" " _.-.\n" " .-. `) | .-.\n" " _.'`. .~./ \\.~. .`'._\n" " .-' .'.'.'.-| |-.'.'.'. '-.\n" " `'`'`'`'` \\ / `'`'`'`'`\n" " /||\\\n" " //||\\\\\n" "\n" " The Kernel of Truth\n"); void kernel_main(void *multiboot_tables) { enum status status = init_log("log"); assert(status == Ok); log(Logo); logf("\tVersion %d.%d.%d\n\tCommit %s\n\t%s\n\tCPU Time %ld\n", kernel_major, kernel_minor, kernel_patch, vcs_version, project_website, cpu_time()); init_interrupts(); init_physical_allocator(multiboot_tables); init_slab(); status = init_heap(); assert(status == Ok); halt(); }
Print CPU time in splash screen
Print CPU time in splash screen
C
mit
iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth
6aba02ecbbacb85918853ed86fea114138945643
atom/common/common_message_generator.h
atom/common/common_message_generator.h
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. // Multiply-included file, no traditional include guard. #include "atom/common/api/api_messages.h" #include "chrome/common/print_messages.h" #include "chrome/common/tts_messages.h" #include "chrome/common/widevine_cdm_messages.h"
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. // Multiply-included file, no traditional include guard. #include "atom/common/api/api_messages.h" #include "chrome/common/print_messages.h" #include "chrome/common/tts_messages.h" #include "chrome/common/widevine_cdm_messages.h" #include "chrome/common/chrome_utility_messages.h"
Fix linking problem with IPC::MessageT
Fix linking problem with IPC::MessageT IPC::MessageT<ChromeUtilityHostMsg_ProcessStarted_Meta, std::__1::tuple<>, void>::MessageT(IPC::Routing)
C
mit
Floato/electron,Floato/electron,Floato/electron,Floato/electron,Floato/electron,Floato/electron
8c39774323a9f462dd513032c5d84a43af3d5a89
ActionLog/scripts/specific-action-log/newIssueGroup.c
ActionLog/scripts/specific-action-log/newIssueGroup.c
specific action log: newIssueGroup # Set Variable [ $brainstate; Value:brainstate::_lockBrainstateID ] # Go to Layout [ “IssuesAndObservations Copy” (issue) ] # New Record/Request Set Field [ issue::lock; "location" ] Set Field [ issue::_keyBrainstate; $brainstate ] # Set Variable [ $group; Value:issue::_LockList ] # Go to Layout [ original layout ] # Go to Object [ Object Name: "group" ] # Go to Portal Row [ First ] Loop Exit Loop If [ $group = category::_LockList ] Go to Portal Row [ Select; Next ] End Loop # Go to Field [ category::text ] January 6, 平成26 11:15:58 ActionLog.fp7 - newIssueGroup -1-
specific action log: newIssueGroup # Set Variable [ $brainstate; Value:brainstate::_lockBrainstateID ] # Go to Layout [ “IssuesAndObservations Copy” (issue) ] # New Record/Request Set Field [ issue::lock; "location" ] Set Field [ issue::_keyBrainstate; $brainstate ] # Set Variable [ $group; Value:issue::_LockList ] # Go to Layout [ original layout ] # Go to Object [ Object Name: "group" ] # Go to Portal Row [ First ] Loop Exit Loop If [ $group = category::_LockList ] Go to Portal Row [ Select; Next; Exit after last ] End Loop # Go to Field [ category::text ] February 24, 平成26 15:13:03 ActionLog.fp7 - newIssueGroup -1-
Fix logic loop in script
Fix logic loop in script Fix logic loop in script attached to button [Specific Action Tag 47] so it exists after reaching last item.
C
apache-2.0
HelpGiveThanks/ActionLog,HelpGiveThanks/ActionLog
81ce26a410a2bcd751f40022d78e20c95bf7b60e
test/FrontendC/ARM/inline-asm-multichar.c
test/FrontendC/ARM/inline-asm-multichar.c
// RUN: %llvmgcc -S -march=armv7a %s // XFAIL: * // XTARGET: arm int t1() { static float k = 1.0f; CHECK: call void asm sideeffect "flds s15, $0 \0A", "*^Uv,~{s15}" __asm__ volatile ("flds s15, %[k] \n" :: [k] "Uv,m" (k) : "s15"); return 0; }
// RUN: %llvmgcc -S -march=armv7a %s | FileCheck %s // XFAIL: * // XTARGET: arm int t1() { static float k = 1.0f; // CHECK: "flds s15, $0 \0A", "*^Uv,~{s15}" __asm__ volatile ("flds s15, %[k] \n" :: [k] "Uv,m" (k) : "s15"); return 0; }
Fix this test to actually check something and be able to be compiled.
Fix this test to actually check something and be able to be compiled. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@133952 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm
b0f2dc244acaf14306add643fc61482f6fe211a9
offset.c
offset.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "crypt.h" #include "accessdata.h" #include "vars.h" static char fileName[] = "ruleDB.dsg"; void main() { // struct staticVar svar; struct staticVar *p; p = malloc(sizeof(struct staticVar)); // p = &svar; // strcpy(svar.s1, "Sarat"); // svar.s2 = 10; // svar.s3 = 16.5; // strcpy(svar.s4, "Mahesh"); // svar.s5 = 1234567.67; // strcpy(svar.s6, "Y"); // svar.s7 = 143.23; // svar.s8.varId = 10; // strcpy(svar.s8.varData,"Inside a structure."); FILE * fp; // fp = fopen (fileName, "w+"); fp = fopen (fileName, "r+"); // fwrite(p,sizeof(struct staticVar),1,fp); fread(p,sizeof(struct staticVar),1,fp); printf("%s \n", p->s4); fclose(fp); }
Read data from Static File
Read data from Static File Reading data from static file and then displaying the data using pointers
C
apache-2.0
saratsarat7/myTest
9eb00b97c35261d4bcd2f0a6ec66c0ac2cc4d196
compat/compat.h
compat/compat.h
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_PLEDGE #include "pledge.h" #endif #ifndef HAVE_STRTONUM #include "strtonum.h" #endif #ifndef timespecsub #define timespecsub(tsp, usp, vsp) \ do { \ (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ if ((vsp)->tv_nsec < 0) { \ (vsp)->tv_sec--; \ (vsp)->tv_nsec += 1000000000L; \ } \ } while (0) #endif #endif /* COMPAT_H */
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_PLEDGE #include "pledge.h" #endif #ifndef HAVE_STRTONUM #include "strtonum.h" #endif /* Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available */ #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC CLOCK_REALTIME #endif #ifndef timespecsub #define timespecsub(tsp, usp, vsp) \ do { \ (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ if ((vsp)->tv_nsec < 0) { \ (vsp)->tv_sec--; \ (vsp)->tv_nsec += 1000000000L; \ } \ } while (0) #endif #endif /* COMPAT_H */
Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available.
Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available.
C
bsd-2-clause
fcambus/logswan,fcambus/logswan
a9200680ad64099de4fa658e9051ab6e0e058170
src/exercise115.c
src/exercise115.c
/* Exercise 1-15: Rewrite the temperature conversion program of Section 1.2 to * use a function for conversion. */ #include <stdio.h> #include <stdlib.h> float farenheitToCelsius(float farenheit) { return (5.0 / 9.0) * (farenheit - 32.0); } int main(int argc, char **argv) { printf("F\tC\n=============\n"); float i; for (i = 0; i <= 300; i += 20) { printf("%3.0f\t%5.1f\n", i, farenheitToCelsius(i)); } return EXIT_SUCCESS; }
Add solution to Exercise 1-15.
Add solution to Exercise 1-15.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
1a8820a34f7405743ce0376d63a66694bfd533af
ports/gtk-webkit/next-gtk-webkit.c
ports/gtk-webkit/next-gtk-webkit.c
/* Copyright © 2018-2019 Atlas Engineer LLC. Use of this file is governed by the license that can be found in LICENSE. */ #include <gtk/gtk.h> #include <stdlib.h> #include "server.h" static void on_name_acquired(GDBusConnection *connection, const gchar *name, gpointer user_data) { g_message("Starting platform port"); } static void on_name_lost(GDBusConnection *_connection, const gchar *_name, gpointer _user_data) { g_message("Platform port disconnected"); // TODO: Call stop_server here? exit(1); } int main(int argc, char *argv[]) { // TODO: Use GtkApplication? guint owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, PLATFORM_PORT_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, start_server, on_name_acquired, on_name_lost, NULL, NULL); // TODO: Start the RPC server first? If GUI is started, then we can // report RPC startup issues graphically. gtk_main(); stop_server(); g_bus_unown_name(owner_id); return EXIT_SUCCESS; }
/* Copyright © 2018-2019 Atlas Engineer LLC. Use of this file is governed by the license that can be found in LICENSE. */ #include <gtk/gtk.h> #include <stdlib.h> #include "server.h" static void on_name_acquired(GDBusConnection *connection, const gchar *name, gpointer user_data) { g_message("Starting platform port"); } static void on_name_lost(GDBusConnection *_connection, const gchar *_name, gpointer _user_data) { g_message("Platform port disconnected"); // TODO: Call stop_server here? exit(1); } int main(int argc, char *argv[]) { // It's safer to initialize GTK before the server is started. In particular, // without it the program would crash if hardware acceleration is disabled // (e.g. with the WEBKIT_DISABLE_COMPOSITING_MODE=1 environment variable). gtk_init(NULL, NULL); // TODO: Use GtkApplication? guint owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, PLATFORM_PORT_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, start_server, on_name_acquired, on_name_lost, NULL, NULL); // TODO: Start the RPC server first? If GUI is started, then we can // report RPC startup issues graphically. gtk_main(); stop_server(); g_bus_unown_name(owner_id); return EXIT_SUCCESS; }
Fix crash when hardware acceleration is disabled.
ports/gtk-webkit: Fix crash when hardware acceleration is disabled.
C
bsd-3-clause
jmercouris/NeXT,jmercouris/NeXT
ec2da88354ef61aa2020c666cf6ccf72ac3e619a
JPEGReadWriter2Plugin/Error.c
JPEGReadWriter2Plugin/Error.c
#include <stdio.h> #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2 * error_ptr2; /* * Here's the routine that will replace the standard error_exit method: */ void error_exit (j_common_ptr cinfo) { /* cinfo->err really points to a error_mgr2 struct, so coerce pointer */ error_ptr2 myerr = (error_ptr2) cinfo->err; /* Return control to the setjmp point */ longjmp(myerr->setjmp_buffer, 1); } 
#include <stdio.h> #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2 * error_ptr2; /* * Here's the routine that will replace the standard error_exit method: */ void error_exit (j_common_ptr cinfo) { /* cinfo->err really points to a error_mgr2 struct, so coerce pointer */ error_ptr2 myerr = (error_ptr2) cinfo->err; /* Return control to the setjmp point */ longjmp(myerr->setjmp_buffer, 1); }
Remove nasty character at end of file that prevents compiles
Remove nasty character at end of file that prevents compiles git-svn-id: 5c8b60fcb9320cccfd2f497bdea85b37ac3f2028@72 fa1542d4-bde8-0310-ad64-8ed1123d492a
C
mit
bencoman/pharo-vm,guillep/OzVM,ronsaldo/pharo-vm-lowcode,ronsaldo/pharo-raspberry,peteruhnak/pharo-vm,zecke/old-pharo-vm-sctp,ronsaldo/pharo-raspberry,takano32/pharo-vm,takano32/pharo-vm,ronsaldo/pharo-vm-lowcode,zecke/old-pharo-vm-sctp,philippeback/pharo-vm,peteruhnak/pharo-vm,bencoman/pharo-vm,takano32/pharo-vm,zecke/old-pharo-vm-sctp,zecke/old-pharo-vm-sctp,philippeback/pharo-vm,ronsaldo/pharo-vm-lowcode,ronsaldo/pharo-raspberry,peteruhnak/pharo-vm,ronsaldo/pharo-vm-lowcode,theseion/pharo-vm,takano32/pharo-vm,theseion/pharo-vm,bencoman/pharo-vm,bencoman/pharo-vm,philippeback/pharo-vm,theseion/pharo-vm,zecke/old-pharo-vm-sctp,guillep/OzVM,zecke/old-pharo-vm-sctp,takano32/pharo-vm,theseion/pharo-vm,theseion/pharo-vm,ronsaldo/pharo-raspberry,ronsaldo/pharo-raspberry,philippeback/pharo-vm,guillep/OzVM,ronsaldo/pharo-vm-lowcode,theseion/pharo-vm,peteruhnak/pharo-vm,guillep/OzVM,peteruhnak/pharo-vm,ronsaldo/pharo-vm-lowcode,ronsaldo/pharo-raspberry,philippeback/pharo-vm,bencoman/pharo-vm,theseion/pharo-vm,takano32/pharo-vm,guillep/OzVM,ronsaldo/pharo-vm-lowcode,ronsaldo/pharo-raspberry,theseion/pharo-vm,philippeback/pharo-vm,bencoman/pharo-vm,bencoman/pharo-vm,philippeback/pharo-vm,guillep/OzVM,guillep/OzVM,theseion/pharo-vm,peteruhnak/pharo-vm,bencoman/pharo-vm,guillep/OzVM,takano32/pharo-vm,peteruhnak/pharo-vm,ronsaldo/pharo-vm-lowcode,zecke/old-pharo-vm-sctp,takano32/pharo-vm,guillep/OzVM,philippeback/pharo-vm,ronsaldo/pharo-vm-lowcode,bencoman/pharo-vm,zecke/old-pharo-vm-sctp,ronsaldo/pharo-raspberry,peteruhnak/pharo-vm
e4d0eac063b91386fc309c1766149aadaa940449
MKCommons/MKUIThemeProtocol.h
MKCommons/MKUIThemeProtocol.h
// // Created by Michael Kuck on 8/20/14. // Copyright (c) 2014 Michael Kuck. All rights reserved. // #import <Foundation/Foundation.h> //============================================================ //== MKUITheme protocol //============================================================ @protocol MKUIThemeProtocol<NSObject> + (UIColor *)lightThemeColor; + (UIColor *)normalThemeColor; + (UIColor *)darkThemeColor; + (UIStatusBarStyle)statusBarStyle; + (UIColor *)navigationBarContentColor; + (void)configureApplication; @end
// // Created by Michael Kuck on 8/20/14. // Copyright (c) 2014 Michael Kuck. All rights reserved. // #import <Foundation/Foundation.h> //============================================================ //== MKUITheme protocol //============================================================ @protocol MKUIThemeProtocol<NSObject> + (UIColor *)lightThemeColor; + (UIColor *)normalThemeColor; + (UIColor *)darkThemeColor; + (UIStatusBarStyle)statusBarStyle; + (UIColor *)navigationBarContentColor; + (CGFloat)bigViewPadding; + (CGFloat)defaultViewPadding; + (void)configureApplication; @end
Extend UIThemeProtocol with padding/inset sizes
Extend UIThemeProtocol with padding/inset sizes
C
mit
mikumi/mkcommons-obj
9ffc9710fa7d6d3f3f9f4ff2bf7068d7be1bbee9
core/src/util/topologicalSort.h
core/src/util/topologicalSort.h
#pragma once #include <algorithm> #include <unordered_map> #include <utility> #include <vector> /** * Given a list of edges describing a directed acyclic graph, returns a * list of nodes sorted in topological order; that is, if there is a path * from node 'a' to node 'b' in the graph, then 'a' will always precede * 'b' in the sorted result. */ template<typename T> std::vector<T> topologicalSort(std::vector<std::pair<T, T>> edges) { // Produce a sorted list of nodes using Kahn's algorithm. std::vector<T> sorted; // Loop over input edges, counting the incoming edges for each node. std::unordered_map<T, size_t> incoming_edges; for (const auto& edge : edges) { incoming_edges[edge.first]; ++incoming_edges[edge.second]; } // Find the set of starting nodes that have no incoming edges. std::vector<T> start_nodes; for (const auto& node : incoming_edges) { if (node.second == 0) { start_nodes.push_back(node.first); } } while (!start_nodes.empty()) { // Choose a node 'n' from the set of starting nodes and remove it. auto n = start_nodes.back(); start_nodes.pop_back(); // Add the value of 'n' to the sorted list. sorted.push_back(n); // For each node 'm' with an edge 'e' from 'n' to 'm' ... for (auto it = edges.begin(); it != edges.end(); ) { auto e = *it; if (e.first == n) { auto m = e.second; // ... remove edge 'e' from the graph. it = edges.erase(it); // If 'm' has no more incoming edges, // add it to the set of starting nodes. if (--incoming_edges[m] == 0) { start_nodes.push_back(m); } } else { ++it; } } } if (!edges.empty()) { // Graph has cycles! This is an error. return {}; } return sorted; }
Add a topological sort utility file
Add a topological sort utility file
C
mit
cleeus/tangram-es,quitejonny/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,quitejonny/tangram-es,quitejonny/tangram-es,cleeus/tangram-es,tangrams/tangram-es,tangrams/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,tangrams/tangram-es,tangrams/tangram-es,cleeus/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,cleeus/tangram-es,cleeus/tangram-es
7ea1cb0d03e30bf5fc0880fe2c10ca9f9bd766be
src/flags.c
src/flags.c
#include "flags.h" #include <stdio.h> #include "laco.h" #include "util.h" static const char* version_matches[] = {"-v", "--version", NULL}; static const char* help_matches[] = {"-h", "--help", NULL}; /* Print off the current version of laco */ static void handle_version(LacoState* laco, const char** arguments) { const char* version = laco_get_laco_version(laco); printf("laco version %s\n", version); laco_kill(laco, 0, NULL); } /* Print off the help screen */ static void handle_help(LacoState* laco, const char** arguments) { puts("A better REPL for Lua.\n"); puts("Usage: laco [options]\n"); puts("-h | --help Print this help screen"); puts("-v | --version Print current version"); laco_kill(laco, 0, NULL); } static const LacoCommand flag_commands[] = { { version_matches, handle_version }, { help_matches, handle_help }, { NULL, NULL } }; /* External API */ void laco_handle_flag(LacoState* laco) { const char* command = laco_get_laco_args(laco)[1]; laco_dispatch(flag_commands, laco, command, NULL); }
#include "flags.h" #include <stdio.h> #include "laco.h" #include "util.h" static const char* version_matches[] = {"-v", "--version", NULL}; static const char* help_matches[] = {"-h", "--help", NULL}; /* Print off the current version of laco */ static void handle_version(LacoState* laco, const char** arguments) { const char* version = laco_get_laco_version(laco); printf("laco version %s\n", version); laco_kill(laco, 0, NULL); } /* Print off the help screen */ static void handle_help(LacoState* laco, const char** arguments) { puts("A better REPL for Lua.\n"); puts("Usage: laco [options]\n"); puts("-h, --help Print this help screen"); puts("-v, --version Print current version"); laco_kill(laco, 0, NULL); } static const LacoCommand flag_commands[] = { { version_matches, handle_version }, { help_matches, handle_help }, { NULL, NULL } }; /* External API */ void laco_handle_flag(LacoState* laco) { const char* command = laco_get_laco_args(laco)[1]; laco_dispatch(flag_commands, laco, command, NULL); }
Change flag separation from `|` to `,`
Change flag separation from `|` to `,`
C
bsd-2-clause
sourrust/laco
f79ad5f49198dd251501dae66fe5c594842583e8
test/PCH/reloc.c
test/PCH/reloc.c
// RUN: clang-cc -emit-pch -o %t --relocatable-pch -isysroot `pwd`/libroot `pwd`/libroot/usr/include/reloc.h && // RUN: clang-cc -include-pch %t -isysroot `pwd`/libroot %s -verify // FIXME (test harness can't do this?): not clang-cc -include-pch %t %s #include <reloc.h> int x = 2; // expected-error{{redefinition}} int y = 5; // expected-error{{redefinition}} // expected-note{{previous definition}} // expected-note{{previous definition}}
// RUN: clang-cc -emit-pch -o %t --relocatable-pch -isysroot %S/libroot %S/libroot/usr/include/reloc.h && // RUN: clang-cc -include-pch %t -isysroot %S/libroot %s -verify && // RUN: not clang-cc -include-pch %t %s #include <reloc.h> int x = 2; // expected-error{{redefinition}} int y = 5; // expected-error{{redefinition}} // expected-note{{previous definition}} // expected-note{{previous definition}}
Use %S, not `pwd`, and enable a line that *does* work. - Doug, please check.
Use %S, not `pwd`, and enable a line that *does* work. - Doug, please check. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@77778 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
899ee459ef10181a7011be87887fb25e17898e16
test/test-non-bopomofo-IM.c
test/test-non-bopomofo-IM.c
/** * test-non-bopomofo-IM.c * * Copyright (c) 2013 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ /** * @file test-non-bopomofo-IM.c * @brief Test cases of newly built APIs for non-phonetic IM's. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include "chewing.h" #include "testhelper.h"
Add a file to contain test cases for non-phonetic IM's.
Add a file to contain test cases for non-phonetic IM's.
C
lgpl-2.1
school510587/general_index_libchewing,school510587/general_index_libchewing,school510587/general_index_libchewing,school510587/general_index_libchewing
687d84793938928c192950dd3d0429235c36d59b
test/printstr.c
test/printstr.c
#include <stdio.h> #include <ctype.h> static void printstr(FILE *stream, const char *str) { char c; while ((c = *str++) != '\0') { putc(c, stream); if (isprint(c) && c != '"' && c != '\\') putc(c, stream); else fprintf(stream, "\\x%x", (int) c); } } int main() { printstr(stdout, "heisann!\n"); return 0; }
Add string function to test suite
Add string function to test suite Taken from string.c.
C
mit
larmel/c-compiler,larmel/lacc,larmel/c-compiler,larmel/c-compiler,larmel/lacc
c5f766b9b116c7bcdb2e7ece1ca1802327376778
src/zcash/Zcash.h
src/zcash/Zcash.h
#ifndef _ZCCONSTANTS_H_ #define _ZCCONSTANTS_H_ #define ZC_NUM_JS_INPUTS 2 #define ZC_NUM_JS_OUTPUTS 2 #define INCREMENTAL_MERKLE_TREE_DEPTH 20 #define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4 #define ZC_NOTEPLAINTEXT_LEADING 1 #define ZC_V_SIZE 8 #define ZC_RHO_SIZE 32 #define ZC_R_SIZE 32 #define ZC_MEMO_SIZE 128 #define ZKSNARK_PROOF_SIZE 584 #endif // _ZCCONSTANTS_H_
#ifndef _ZCCONSTANTS_H_ #define _ZCCONSTANTS_H_ #define ZC_NUM_JS_INPUTS 2 #define ZC_NUM_JS_OUTPUTS 2 #define INCREMENTAL_MERKLE_TREE_DEPTH 29 #define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4 #define ZC_NOTEPLAINTEXT_LEADING 1 #define ZC_V_SIZE 8 #define ZC_RHO_SIZE 32 #define ZC_R_SIZE 32 #define ZC_MEMO_SIZE 128 #define ZKSNARK_PROOF_SIZE 584 #endif // _ZCCONSTANTS_H_
Change merkle tree depth to 29.
Change merkle tree depth to 29.
C
mit
bitcoinsSG/zcash,bitcoinsSG/zcash,bitcoinsSG/zcash,aniemerg/zcash,CTRoundTable/Encrypted.Cash,aniemerg/zcash,CTRoundTable/Encrypted.Cash,aniemerg/zcash,CTRoundTable/Encrypted.Cash,CTRoundTable/Encrypted.Cash,aniemerg/zcash,bitcoinsSG/zcash,bitcoinsSG/zcash,aniemerg/zcash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,aniemerg/zcash
b608152c41f235a0bf4ffd9db21d954bada3ceea
atom/common/chrome_version.h
atom/common/chrome_version.h
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. // This file is generated by script/bootstrap.py, you should never modify it // by hand. #ifndef ATOM_COMMON_CHROME_VERSION_H_ #define ATOM_COMMON_CHROME_VERSION_H_ #define CHROME_VERSION_STRING "62.0.3202.94" #define CHROME_VERSION "v" CHROME_VERSION_STRING #endif // ATOM_COMMON_CHROME_VERSION_H_
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. // This file is generated by script/bootstrap.py, you should never modify it // by hand. #ifndef ATOM_COMMON_CHROME_VERSION_H_ #define ATOM_COMMON_CHROME_VERSION_H_ #define CHROME_VERSION_STRING "63.0.3239.84" #define CHROME_VERSION "v" CHROME_VERSION_STRING #endif // ATOM_COMMON_CHROME_VERSION_H_
Update Chrome version to 63.0.3239.84
Update Chrome version to 63.0.3239.84
C
mit
bpasero/electron,electron/electron,shiftkey/electron,shiftkey/electron,gerhardberger/electron,shiftkey/electron,bpasero/electron,bpasero/electron,gerhardberger/electron,shiftkey/electron,bpasero/electron,electron/electron,electron/electron,seanchas116/electron,seanchas116/electron,the-ress/electron,gerhardberger/electron,the-ress/electron,shiftkey/electron,the-ress/electron,electron/electron,bpasero/electron,gerhardberger/electron,the-ress/electron,the-ress/electron,bpasero/electron,seanchas116/electron,seanchas116/electron,seanchas116/electron,shiftkey/electron,gerhardberger/electron,gerhardberger/electron,gerhardberger/electron,the-ress/electron,bpasero/electron,electron/electron,the-ress/electron,electron/electron,electron/electron,seanchas116/electron
61377d69a4eba2ccfda4a6bf8c16cfdb84fe70c3
assembly/screenmsg.c
assembly/screenmsg.c
/* * screenmsg - Print a message to terminal * * Written in 2012 by Prashant P Shah <[email protected]> * * To the extent possible under law, the author(s) have dedicated * all copyright and related and neighboring rights to this software * to the public domain worldwide. This software is distributed * without any warranty. * * You should have received a copy of the CC0 Public Domain Dedication * along with this software. * If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. */ #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { char *msg = "Hello world from assembly\n"; // http://asm.sourceforge.net/syscall.html#p33 // http://jakash3.wordpress.com/2010/10/14/linux-assembly/ asm("MOVL $4, %eax"); // system call code for write asm("MOVL $1, %ebx"); // file descriptor = stdout (1) asm("MOVL %0, %%ecx" : : "m"(msg)); // pointer to buffer asm("MOVL $26, %edx"); // size of buffer asm("INT $0x80"); // software interrrupt to system call return 0; }
Print a message to terminal screen
Print a message to terminal screen Signed-off-by: Prashant Shah <[email protected]>
C
cc0-1.0
prashants/c
efbf667dd43005cc46c83097ee19499f57be14af
src/lib/blockdev.h
src/lib/blockdev.h
#include <glib.h> #ifndef BD_LIB #define BD_LIB #include "plugins.h" gboolean bd_init (BDPluginSpec *force_plugins); gboolean bd_reinit (BDPluginSpec *force_plugins, gboolean replace); gchar** bd_get_available_plugin_names (); gboolean bd_is_plugin_available (BDPlugin plugin); #endif /* BD_LIB */
#include <glib.h> #ifndef BD_LIB #define BD_LIB #include "plugins.h" gboolean bd_init (BDPluginSpec *force_plugins); gboolean bd_reinit (BDPluginSpec *force_plugins, gboolean reload); gchar** bd_get_available_plugin_names (); gboolean bd_is_plugin_available (BDPlugin plugin); #endif /* BD_LIB */
Fix name of the paramenter for requesting plugin reload
Fix name of the paramenter for requesting plugin reload 'reload' better explains what happens than 'replace'.
C
lgpl-2.1
vpodzime/libblockdev,vpodzime/libblockdev,rhinstaller/libblockdev,snbueno/libblockdev,dashea/libblockdev,vpodzime/libblockdev,rhinstaller/libblockdev,atodorov/libblockdev,rhinstaller/libblockdev,dashea/libblockdev,atodorov/libblockdev,snbueno/libblockdev,atodorov/libblockdev
7d95d1ae451ed247f4c25f2b21cd2d5ff37046c9
Sources/Rumia/Iterator.h
Sources/Rumia/Iterator.h
#pragma once namespace Rumia { template<typename Ty, typename ContainerTy> class Iterator { public: using DataType = Ty; using ContainerType = ContainerTy; public: Iterator( ContainerType& container ) : m_container( container ) { } virtual ~Iterator( ) { } virtual Ty& operator*( ) = 0; virtual Ty& operator*( ) const = 0; protected: ContainerType& m_container; }; }
#pragma once namespace Rumia { template<typename Ty, typename ContainerTy> class Iterator { public: using DataType = Ty; using ContainerType = ContainerTy; public: Iterator( ContainerType& container ) : m_container( container ) { } virtual ~Iterator( ) { } virtual Ty& operator*( ) const = 0; protected: ContainerType& m_container; }; }
Delete non-const reference operator pure virtual function
Delete non-const reference operator pure virtual function
C
mit
HoRangDev/Rumia,HoRangDev/Rumia
bb072543fdf3b2954715351399ad29ff5c4d74d0
hw3/syscall/accomodate_space.c
hw3/syscall/accomodate_space.c
#include<stdio.h> #include<stdlib.h> #include<unistd.h> int main( int argc, char *argv[] ){ int *pointer; int i; pointer = (int*)malloc(sizeof(int)*1337); //Declare 5 arrays of 'char' variables char *space0, *space1, *space2, *space3, *space4; //Accomodate some (random) space for them space0 = (char*) malloc (sizeof(char) *333333); space1 = (char*) malloc (sizeof(char) *44444); space2 = (char*) malloc (sizeof(char) *3214); space3 = (char*) malloc (sizeof(char) *10000000); space4 = (char*) malloc (sizeof(char) *55630); //Do this 100 times for(i=0; i < 100; i++){ //Attempt to resize the memory block pointed to by 'pointer' for i*1337 bytes pointer = (int*)realloc(pointer,(i*1337) ); sleep(2); // not needed } return 0; }
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<time.h> int main( int argc, char *argv[] ){ int *pointer; int i; pointer = (int*)malloc(sizeof(int)*1337); //Declare 5 arrays of 'char' variables char *space0, *space1, *space2, *space3, *space4; clock_t begin = clock(); //Accomodate some (random) space for them space0 = (char*) malloc (sizeof(char) *333333); space1 = (char*) malloc (sizeof(char) *44444); space2 = (char*) malloc (sizeof(char) *3214); space3 = (char*) malloc (sizeof(char) *10000000); space4 = (char*) malloc (sizeof(char) *55630); //Do this 100 times for(i=0; i < 100; i++){ //Attempt to resize the memory block pointed to by 'pointer' for i*1337 bytes - big size pointer = (int*)realloc(pointer,(i*1337) ); sleep(2); // not needed } clock_t end = clock(); //return time in an internal scale called "clocks" double time_spent = (double)(end-begin) * 1000.0 / CLOCKS_PER_SEC; printf("%Time elapsed with the current algorithm is %f ", time_spent); return 0; }
Test Program that accomodates space now returns the time spent
Test Program that accomodates space now returns the time spent
C
mit
eloukas/Operating-Systems,eloukas/Operating-Systems,eloukas/Operating-Systems,eloukas/Operating-Systems
526d5c80f57093bcfe5d294c3b48e7fd395b272b
timeout_getaline.c
timeout_getaline.c
#include "leafnode.h" #include "ln_log.h" #include <signal.h> #include <setjmp.h> #ifdef WITH_DMALLOC #include <dmalloc.h> #endif #include <unistd.h> static jmp_buf to; static RETSIGTYPE timer(int sig) { (void)sig; siglongjmp(to, 1); } /* * call getaline with timeout */ char * timeout_getaline(FILE * f, unsigned int timeout) { char *l; struct sigaction sa; if (sigsetjmp(to, 1)) { ln_log(LNLOG_SERR, LNLOG_CTOP, "timeout reading."); return NULL; } sa.sa_handler = timer; sa.sa_flags = SA_NOCLDSTOP | SA_RESTART; sigemptyset(&sa.sa_mask); (void)sigaction(SIGALRM, &sa, NULL); (void)alarm(timeout); l = getaline(f); (void)alarm(0U); return l; } char * mgetaline(FILE * f) { return timeout_getaline(f, timeout_client); }
#include "leafnode.h" #include "ln_log.h" #include <signal.h> #include <setjmp.h> #ifdef WITH_DMALLOC #include <dmalloc.h> #endif #include <unistd.h> static sigjmp_buf to; static RETSIGTYPE timer(int sig) { (void)sig; siglongjmp(to, 1); } /* * call getaline with timeout */ char * timeout_getaline(FILE * f, unsigned int timeout) { char *l; struct sigaction sa; if (sigsetjmp(to, 1)) { ln_log(LNLOG_SERR, LNLOG_CTOP, "timeout reading."); return NULL; } sa.sa_handler = timer; sa.sa_flags = SA_NOCLDSTOP | SA_RESTART; sigemptyset(&sa.sa_mask); (void)sigaction(SIGALRM, &sa, NULL); (void)alarm(timeout); l = getaline(f); (void)alarm(0U); return l; } char * mgetaline(FILE * f) { return timeout_getaline(f, timeout_client); }
Fix type: jmp_buf -> sigjmp_buf.
Fix type: jmp_buf -> sigjmp_buf.
C
lgpl-2.1
BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode
112bb84c8ea50a4e5a415723906ea314a4cd374a
transmitter/comm.h
transmitter/comm.h
#ifndef COMM_H_ #define COMM_H_ #define COMM_BUFFER_LEN 3 typedef struct{ uint8_t key; uint16_t val; } comm_t; // Buffer messages to sent to the monitor comm_t comm_buffer[COMM_BUFFER_LEN]; unsigned char comm_head; unsigned char comm_tail; /** * Push an element onto the end of the buffer. */ void comm_push(comm_t d) { // Add to the buffer comm_buffer[comm_head] = d; // Increment the index comm_head++; if (comm_head >= COMM_BUFFER_LEN) { comm_head = 0; } } /** * Shift an element off the beginning of the buffer. */ comm_t comm_shift() { comm_t d = comm_buffer[comm_tail]; // Increase the processed index comm_tail++; if (comm_tail >= COMM_BUFFER_LEN) { comm_tail = 0; } return d; } /** * Determine whether the buffer is empty. */ uint8_t comm_empty() { if (comm_head == comm_tail) { return 1; } return 0; } #endif
#ifndef COMM_H_ #define COMM_H_ #define COMM_BUFFER_LEN 4 typedef struct{ uint8_t key; uint16_t val; } comm_t; // Buffer messages to sent to the monitor comm_t comm_buffer[COMM_BUFFER_LEN]; unsigned char comm_head; unsigned char comm_tail; /** * Push an element onto the end of the buffer. */ void comm_push(comm_t d) { // Add to the buffer comm_buffer[comm_head] = d; // Increment the index comm_head++; if (comm_head >= COMM_BUFFER_LEN) { comm_head = 0; } } /** * Shift an element off the beginning of the buffer. */ comm_t comm_shift() { comm_t d = comm_buffer[comm_tail]; // Increase the processed index comm_tail++; if (comm_tail >= COMM_BUFFER_LEN) { comm_tail = 0; } return d; } /** * Determine whether the buffer is empty. */ uint8_t comm_empty() { if (comm_head == comm_tail) { return 1; } return 0; } #endif
Make the buffer a little larger
Make the buffer a little larger
C
mit
theapi/quadcopter
2ee6ed64ebc9875b2aa143b52a6dac2590cbe569
src/zcash/Zcash.h
src/zcash/Zcash.h
#ifndef _ZCCONSTANTS_H_ #define _ZCCONSTANTS_H_ #define ZC_NUM_JS_INPUTS 2 #define ZC_NUM_JS_OUTPUTS 2 #define INCREMENTAL_MERKLE_TREE_DEPTH 29 #define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4 #define ZC_NOTEPLAINTEXT_LEADING 1 #define ZC_V_SIZE 8 #define ZC_RHO_SIZE 32 #define ZC_R_SIZE 32 #define ZC_MEMO_SIZE 512 #define ZC_NOTEPLAINTEXT_SIZE ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE #define ZKSNARK_PROOF_SIZE 584 #endif // _ZCCONSTANTS_H_
#ifndef _ZCCONSTANTS_H_ #define _ZCCONSTANTS_H_ #define ZC_NUM_JS_INPUTS 2 #define ZC_NUM_JS_OUTPUTS 2 #define INCREMENTAL_MERKLE_TREE_DEPTH 29 #define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4 #define ZC_NOTEPLAINTEXT_LEADING 1 #define ZC_V_SIZE 8 #define ZC_RHO_SIZE 32 #define ZC_R_SIZE 32 #define ZC_MEMO_SIZE 512 #define ZC_NOTEPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE) #define ZKSNARK_PROOF_SIZE 584 #endif // _ZCCONSTANTS_H_
Add parenthesis around macro value definition
Add parenthesis around macro value definition
C
mit
bitcoinsSG/zcash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash
9d91e7e87b791e281f07d5a19117b1ebc7a6ec73
compat/compat.h
compat/compat.h
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_PLEDGE #include "pledge.h" #endif #ifndef timespecsub #define timespecsub(tsp, usp, vsp) \ do { \ (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ if ((vsp)->tv_nsec < 0) { \ (vsp)->tv_sec--; \ (vsp)->tv_nsec += 1000000000L; \ } \ } while (0) #endif #endif /* COMPAT_H */
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_PLEDGE #include "pledge.h" #endif /* Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available */ #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC CLOCK_REALTIME #endif #ifndef timespecsub #define timespecsub(tsp, usp, vsp) \ do { \ (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ if ((vsp)->tv_nsec < 0) { \ (vsp)->tv_sec--; \ (vsp)->tv_nsec += 1000000000L; \ } \ } while (0) #endif #endif /* COMPAT_H */
Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available.
Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available.
C
bsd-2-clause
fcambus/statzone
008450bab039ce5b287155faddf118bfe8e71a27
tests/divide/in.c
tests/divide/in.c
#include <assert.h> int main() { int x = 285; int y = 23; assert(x / y == 12); return 0; }
Add forgotten test for /
Add forgotten test for /
C
mit
orodley/naive,orodley/naive,orodley/naive,orodley/naive
495efcbb59a71a305b9036da895b4651f6b3d72c
cpp/EXGL.h
cpp/EXGL.h
#ifndef __EXGL_H__ #define __EXGL_H__ #include <OpenGLES/ES2/gl.h> #include <JavaScriptCore/JSBase.h> #ifdef __cplusplus extern "C" { #endif // Identifies an EXGL context. No EXGL context has the id 0, so that can be // used as a 'null' value. typedef unsigned int EXGLContextId; // [JS thread] Create an EXGL context and return its id number. Saves the // JavaScript interface object (has a WebGLRenderingContext-style API) at // `global.__EXGLContexts[id]` in JavaScript. EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx); // [Any thread] Release the resources for an EXGL context. The same id is never // reused. void EXGLContextDestroy(EXGLContextId exglCtxId); // [GL thread] Perform one frame's worth of queued up GL work void EXGLContextFlush(EXGLContextId exglCtxId); // [GL thread] Set the default framebuffer (used when binding 0) void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer); #ifdef __cplusplus } #endif #endif
#ifndef __EXGL_H__ #define __EXGL_H__ #include <OpenGLES/ES2/gl.h> #include <JavaScriptCore/JSBase.h> #ifdef __cplusplus extern "C" { #endif // Identifies an EXGL context. No EXGL context has the id 0, so that can be // used as a 'null' value. typedef unsigned int EXGLContextId; // [JS thread] Create an EXGL context and return its id number. Saves the // JavaScript interface object (has a WebGLRenderingContext-style API) at // `global.__EXGLContexts[id]` in JavaScript. EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx); // [Any thread] Release the resources for an EXGL context. The same id is never // reused. void EXGLContextDestroy(EXGLContextId exglCtxId); // [GL thread] Perform one frame's worth of queued up GL work void EXGLContextFlush(EXGLContextId exglCtxId); // [GL thread] Set the default framebuffer (used when binding 0). Allows using // platform-specific extensions on the default framebuffer, such as MSAA. void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer); #ifdef __cplusplus } #endif #endif
Clarify need for custom default framebuffer
Clarify need for custom default framebuffer fbshipit-source-id: 40e157b
C
bsd-3-clause
exponentjs/exponent,exponentjs/exponent,exponent/exponent,jolicloud/exponent,jolicloud/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,jolicloud/exponent,jolicloud/exponent,exponentjs/exponent,exponentjs/exponent,jolicloud/exponent,exponent/exponent,jolicloud/exponent,jolicloud/exponent,exponent/exponent,exponentjs/exponent,jolicloud/exponent,exponentjs/exponent,jolicloud/exponent,exponent/exponent,exponent/exponent,exponent/exponent
2d35923e4e043c2d5a001e1e11b36adec9e495a4
gmond/core_metrics.c
gmond/core_metrics.c
#include <metric.h> #include <gm_mmn.h> #include <libmetrics.h> mmodule core_metrics; /* ** A helper function to determine the number of cpustates in /proc/stat (MKN) */ static int core_metrics_init ( apr_pool_t *p ) { int i; for (i = 0; core_metrics.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(core_metrics.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(core_metrics.metrics_info[i]),MGROUP,"core"); } return 0; } static void core_metrics_cleanup ( void ) { } static g_val_t core_metrics_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return gexec_func(); case 1: return heartbeat_func(); case 2: return location_func(); } /* default case */ val.int32 = 0; return val; } static Ganglia_25metric core_metrics_info[] = { {0, "gexec", 300, GANGLIA_VALUE_STRING, "", "zero", "%s", UDP_HEADER_SIZE+32, "gexec available"}, {0, "heartbeat", 20, GANGLIA_VALUE_UNSIGNED_INT, "", "", "%u", UDP_HEADER_SIZE+8, "Last heartbeat"}, {0, "location", 1200, GANGLIA_VALUE_STRING, "(x,y,z)", "", "%s", UDP_HEADER_SIZE+12, "Location of the machine"}, {0, NULL} }; mmodule core_metrics = { STD_MMODULE_STUFF, core_metrics_init, core_metrics_cleanup, core_metrics_info, core_metrics_handler, };
Move heartbeat, location and gexec metrics to a core module that will always be statically linked
Move heartbeat, location and gexec metrics to a core module that will always be statically linked git-svn-id: 27e0aca8c7a52a9ae65dfba2e16879604119af8c@913 93a4e39c-3214-0410-bb16-828d8e3bcd0f
C
bsd-3-clause
fastly/ganglia,fastly/ganglia,fastly/ganglia,fastly/ganglia,fastly/ganglia
51f20f3dfcb48b12e1b20737e40ef035076f9461
WordPerfectIndexer/stdafx.h
WordPerfectIndexer/stdafx.h
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, // but are changed infrequently #pragma once #ifndef STRICT #define STRICT #endif #include "targetver.h" #define _CRT_SECURE_NO_WARNINGS #define _ATL_APARTMENT_THREADED #define _ATL_NO_AUTOMATIC_NAMESPACE #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit #define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW #include "resource.h" #include <atlbase.h> #include <atlcom.h> #include <atlctl.h>
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, // but are changed infrequently #pragma once #ifndef STRICT #define STRICT #endif #include "targetver.h" #define _CRT_SECURE_NO_WARNINGS #define _ATL_APARTMENT_THREADED #define _ATL_NO_AUTOMATIC_NAMESPACE #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit #define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW #include "resource.h" #include <atlbase.h> #include <atlcom.h> #include <atlstr.h>
Swap out header in precompiled header file
Swap out header in precompiled header file
C
mpl-2.0
SunburstApps/WordPerfectIndexer,SunburstApps/WordPerfectIndexer
1798b679e24088f17763729158cfd103e0270a06
lib/libgnumalloc/cfree.c
lib/libgnumalloc/cfree.c
void cfree(void *foo) { free(foo); }
/* * cfree.c */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); void cfree(void *foo) { free(foo); }
Add __FBSDID()s to internal libgnumalloc()
Add __FBSDID()s to internal libgnumalloc()
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
274289167ac12e6213fa502c2c1e956f4bbd1d61
src/x86/is_fpreg-x86.c
src/x86/is_fpreg-x86.c
/* libunwind - a platform-independent unwind library Copyright (c) 2004 Hewlett-Packard Development Company, L.P. Contributed by David Mosberger-Tang <[email protected]> This file is part of libunwind. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "tdep.h" PROTECTED int unw_is_fpreg (int regnum) { return ((regnum >= UNW_X86_ST0 && regnum <= UNW_X86_ST7) || (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi)); }
Declare as returning an "int" and fix typo.
(unw_is_fpreg): Declare as returning an "int" and fix typo. (Logical change 1.158)
C
mit
cms-externals/libunwind,mpercy/libunwind,tronical/libunwind,atanasyan/libunwind-android,android-ia/platform_external_libunwind,mpercy/libunwind,geekboxzone/mmallow_external_libunwind,maltek/platform_external_libunwind,wdv4758h/libunwind,CyanogenMod/android_external_libunwind,dropbox/libunwind,evaautomation/libunwind,libunwind/libunwind,martyone/libunwind,Chilledheart/libunwind,android-ia/platform_external_libunwind,zliu2014/libunwind-tilegx,fdoray/libunwind,frida/libunwind,vegard/libunwind,rogwfu/libunwind,Keno/libunwind,zeldin/platform_external_libunwind,fillexen/libunwind,frida/libunwind,atanasyan/libunwind-android,zeldin/platform_external_libunwind,djwatson/libunwind,adsharma/libunwind,rantala/libunwind,yuyichao/libunwind,ehsan/libunwind,jrmuizel/libunwind,zliu2014/libunwind-tilegx,DroidSim/platform_external_libunwind,geekboxzone/lollipop_external_libunwind,Keno/libunwind,adsharma/libunwind,lat/libunwind,tony/libunwind,fdoray/libunwind,rntz/libunwind,geekboxzone/lollipop_external_libunwind,vtjnash/libunwind,rantala/libunwind,maltek/platform_external_libunwind,wdv4758h/libunwind,wdv4758h/libunwind,project-zerus/libunwind,androidarmv6/android_external_libunwind,evaautomation/libunwind,bo-on-software/libunwind,atanasyan/libunwind-android,jrmuizel/libunwind,libunwind/libunwind,androidarmv6/android_external_libunwind,pathscale/libunwind,geekboxzone/mmallow_external_libunwind,cloudius-systems/libunwind,unkadoug/libunwind,joyent/libunwind,CyanogenMod/android_external_libunwind,Keno/libunwind,dropbox/libunwind,dreal-deps/libunwind,dagar/libunwind,yuyichao/libunwind,pathscale/libunwind,cms-externals/libunwind,SyndicateRogue/libunwind,dropbox/libunwind,igprof/libunwind,unkadoug/libunwind,lat/libunwind,rogwfu/libunwind,0xlab/0xdroid-external_libunwind,rntz/libunwind,joyent/libunwind,project-zerus/libunwind,rantala/libunwind,tkelman/libunwind,olibc/libunwind,mpercy/libunwind,joyent/libunwind,olibc/libunwind,tkelman/libunwind,bo-on-software/libunwind,Chilledheart/libunwind,fillexen/libunwind,vtjnash/libunwind,ehsan/libunwind,DroidSim/platform_external_libunwind,cloudius-systems/libunwind,tony/libunwind,krytarowski/libunwind,dagar/libunwind,Chilledheart/libunwind,androidarmv6/android_external_libunwind,atanasyan/libunwind,maltek/platform_external_libunwind,lat/libunwind,atanasyan/libunwind,dreal-deps/libunwind,libunwind/libunwind,martyone/libunwind,dreal-deps/libunwind,unkadoug/libunwind,tony/libunwind,rogwfu/libunwind,dagar/libunwind,bo-on-software/libunwind,tkelman/libunwind,olibc/libunwind,pathscale/libunwind,cloudius-systems/libunwind,rntz/libunwind,zeldin/platform_external_libunwind,zliu2014/libunwind-tilegx,tronical/libunwind,DroidSim/platform_external_libunwind,SyndicateRogue/libunwind,fdoray/libunwind,yuyichao/libunwind,0xlab/0xdroid-external_libunwind,cms-externals/libunwind,djwatson/libunwind,krytarowski/libunwind,geekboxzone/mmallow_external_libunwind,atanasyan/libunwind,vegard/libunwind,tronical/libunwind,fillexen/libunwind,evaautomation/libunwind,CyanogenMod/android_external_libunwind,jrmuizel/libunwind,krytarowski/libunwind,project-zerus/libunwind,adsharma/libunwind,ehsan/libunwind,vegard/libunwind,igprof/libunwind,igprof/libunwind,frida/libunwind,android-ia/platform_external_libunwind,djwatson/libunwind,0xlab/0xdroid-external_libunwind,vtjnash/libunwind,SyndicateRogue/libunwind,martyone/libunwind,geekboxzone/lollipop_external_libunwind
06e77b29734b000098ec29bf642a15bb523e180e
psimpl-c.h
psimpl-c.h
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* psimpl-c Copyright (c) 2013 Jamie Bullock <[email protected]> Based on psimpl Copyright (c) 2010-2011 Elmar de Koning <[email protected]> */ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif double *psimpl_simplify_douglas_peucker( uint8_t dimensions, double tolerance, double *original_points, double *simplified_points ); #ifdef __cplusplus } #endif
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* psimpl-c Copyright (c) 2013 Jamie Bullock <[email protected]> Based on psimpl Copyright (c) 2010-2011 Elmar de Koning <[email protected]> */ #ifndef PSIMPL_C #include <stdint.h> typedef enum psimpl_LineDimension_ { psimpl_LineDimension_1D = 1, psimpl_LineDimension_2D, psimpl_LineDimension_3D } psimpl_LineDimension; #ifdef __cplusplus extern "C" { #endif double *psimpl_simplify_douglas_peucker( psimpl_LineDimension dimensions, uint64_t points, double tolerance, double *original_points, double *simplified_points ); #ifdef __cplusplus } #endif #endif // #ifdef PSIMPL_C
Update API to only support 1, 2 or 3 dimensional lines
Update API to only support 1, 2 or 3 dimensional lines
C
mpl-2.0
jamiebullock/psimpl-c,jamiebullock/psimpl-c,jamiebullock/psimpl-c,jamiebullock/psimpl-c
a59afbf3fb2b0392f19f5be8f4fac05e962fd7c4
tests/polylog-bug.c
tests/polylog-bug.c
/* gmp3.c -- Test calc of Dilogarithm. */ /* Last change: 27-Mar-2012. Ken Roberts */ /* Calc Li_2(u+iv) * then Li_2(u+iv) * again. Expect consistent results. * Looking for possible bug re caching * of info within cpx_polylog logic. */ #include <math.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <db_185.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <gmp.h> #include "anant/src/mp-complex.h" #include "anant/anant.h" ulong gprec; ulong aprec; int main ( int argc, char * argv[]) { double u, v; cpx_t s, z, pl1b, pl1e; int res; gprec = 1000; mpf_set_default_prec (gprec); aprec = 50; cpx_init (s); cpx_init (z); cpx_set_ui (s, 2, 0); u = 0.000005; v = 1.377128; cpx_set_d (z, u, v); printf ("\n"); gmp_printf ("s = %10Ff + i %10Ff\n", s[0].re, s[0].im); gmp_printf ("z = %10Ff + i %10Ff\n", z[0].re, z[0].im); cpx_init (pl1b); cpx_init (pl1e); res = cpx_polylog (pl1b, s, z, aprec); gmp_printf ("Rtn %d, Li_2(z) = %10Ff + i %10Ff\n", res, pl1b[0].re, pl1b[0].im); res = cpx_polylog (pl1e, s, z, aprec); gmp_printf ("Rtn %d, Li_2(z) = %10Ff + i %10Ff\n", res, pl1e[0].re, pl1e[0].im); printf ("\n"); exit (0); };
Add a polylog bug report
Add a polylog bug report
C
lgpl-2.1
linas/anant
5e35dc73b64ddcb393f291139a394007f6ebb166
include/ATM.h
include/ATM.h
#pragma once /* Customer Structure */ typedef struct customer { char name[25]; // Customer's name long int accnum; // Customer's Account Number long int balance; // Customer's Balance long long int ccn; // Customer's CCN short int pin; // Customer's PIN } customer; /* Current Logged In Customer */ long int currentUserLoggedIn = 0L; bool Login_Menu(); int CCN_VALIDATE(long long CCN); int CCNLength(long long cardNumber); bool CCNCheckLuhn(long long cardNumber, int digits); int getDigit(long long cardNumber, int location); void Show_Stats(long currentUserLoggedIn); bool CCN_OwnerExists(long long CCN); bool PIN_Validate(long long CCN, short int PIN); void LoginUser(long long CCN, short PIN); string GetAccNum(long long CCN); string CCN_GetOwner(long long CCN); void ATMMenu(long accnum); void cash_withdraw(long accnum); void pay_utilitybill(long accnum); void credit_transfer(long accnum); void acc_update(long accnum); void add_funds(long accnum); customer customers[5]; char char* welcome_message = "********************************\ *-->Welcome to Bahria Bank!<---*\ ********************************\n";
#pragma once /* Customer Structure */ typedef struct customer { char name[25]; // Customer's name long int accnum; // Customer's Account Number long int balance; // Customer's Balance long long int ccn; // Customer's CCN short int pin; // Customer's PIN } customer; /* Current Logged In Customer */ long int currentUserLoggedIn = 0L; bool Login_Menu(); int CCN_VALIDATE(long long CCN); int CCNLength(long long cardNumber); bool CCNCheckLuhn(long long cardNumber, int digits); int getDigit(long long cardNumber, int location); void Show_Stats(long currentUserLoggedIn); bool CCN_OwnerExists(long long CCN); bool PIN_Validate(long long CCN, short int PIN); void LoginUser(long long CCN, short PIN); string GetAccNum(long long CCN); string CCN_GetOwner(long long CCN); void ATMMenu(long accnum); void cash_withdraw(long accnum); void pay_utilitybill(long accnum); void credit_transfer(long accnum); void acc_update(long accnum); void add_funds(long accnum); customer customers[5]; const char* welcome_message = "********************************\ *-->Welcome to Bahria Bank!<---*\ ********************************\n";
Fix declaration of welcome message!
Fix declaration of welcome message!
C
mit
saifali96/ATM-Simulator,saifali96/ATM-Simulator
3038605c0256d43291a0f1ac1cebd54d5bcb4876
ch1/uniqueChars.c
ch1/uniqueChars.c
#include <stdio.h> int main(int argc, char** argv) { if (argc < 2) { return 1; // No word given - error } char* word = argv[1]; int index = 0; short seen[256] = {0}; char c; while (c = word[index]) { printf("%c\n", c); if (seen[c]) { printf("Not unique - saw two of '%c'.\n", c); return 0; } seen[c] = 1; index += 1; } printf("Word has no duplicate chars.\n"); return 0; }
Determine if a string has all unique chars
Determine if a string has all unique chars
C
mit
WalrusCow/ctci
d7bcc60432296b0b573194926f8a7d4164517b02
imageprocessingstrategy.h
imageprocessingstrategy.h
#ifndef IMAGEPROCESSINGSTRATEGY_H #define IMAGEPROCESSINGSTRATEGY_H #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/ocl/ocl.hpp" #include "constants.h" #include "qdebug.h" using namespace std; using namespace cv; class ImageProcessingStrategy { public: ImageProcessingStrategy(); Mat applyBlur(Mat src); Mat applyLaplacian(Mat src); Mat applyEdge(Mat src); Mat applySubs(Mat raw_src, Mat ref_src); Mat applyContourns(Mat src); int processBlur(); int processLaplacian(); int processEdge(); int processSubs(); int processContourns(); }; #endif // IMAGEPROCESSINGSTRATEGY_H
#ifndef IMAGEPROCESSINGSTRATEGY_H #define IMAGEPROCESSINGSTRATEGY_H #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/gpu/gpu.hpp" #include "constants.h" #include "qdebug.h" using namespace std; using namespace cv; class ImageProcessingStrategy { public: ImageProcessingStrategy(); Mat applyBlur(Mat src); Mat applyLaplacian(Mat src); Mat applyEdge(Mat src); Mat applySubs(Mat raw_src, Mat ref_src); Mat applyContourns(Mat src); int processBlur(); int processLaplacian(); int processEdge(); int processSubs(); int processContourns(); }; #endif // IMAGEPROCESSINGSTRATEGY_H
Fix cuda incomplete type issue
Fix cuda incomplete type issue
C
mit
emmamm05/parkeye,emmamm05/parkeye,emmamm05/parkeye
2ddb08c1f7f69a3d7da1820d40fd32910a37c617
include/timers.h
include/timers.h
/************************************************* * Timestamp Functions Header File * * (C) 1999-2007 Jack Lloyd * *************************************************/ #ifndef BOTAN_TIMERS_H__ #define BOTAN_TIMERS_H__ #include <botan/base.h> namespace Botan { /************************************************* * Timer Interface * *************************************************/ class Timer : public EntropySource { public: virtual u64bit clock() const; u32bit slow_poll(byte[], u32bit); virtual ~Timer() {} protected: static u64bit combine_timers(u32bit, u32bit, u32bit); }; } #endif
/************************************************* * Timestamp Functions Header File * * (C) 1999-2007 Jack Lloyd * *************************************************/ #ifndef BOTAN_TIMERS_H__ #define BOTAN_TIMERS_H__ #include <botan/base.h> namespace Botan { /************************************************* * Timer Interface * *************************************************/ class BOTAN_DLL Timer : public EntropySource { public: virtual u64bit clock() const; u32bit slow_poll(byte[], u32bit); virtual ~Timer() {} protected: static u64bit combine_timers(u32bit, u32bit, u32bit); }; } #endif
Add BOTAN_DLL to Timer class declaration
Add BOTAN_DLL to Timer class declaration
C
bsd-2-clause
Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,webmaster128/botan,randombit/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan
afca1b7a6a332d667bf9f92a0402a51af1a51ff6
test/tests.c
test/tests.c
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include "../src/rootdb.h" int main(void) { MDB_env *env; MDB_dbi dbi; int status; status = rootdb_open(&env, &dbi, "./testingdb"); assert(status == 0); char key_char[] = "hello"; char value_char[] = "world"; MDB_val key; MDB_val value; key.mv_size = sizeof(key_char); key.mv_data = key_char; value.mv_size = sizeof(value_char); value.mv_data = value_char; printf("key: %p %.*s, data: %p %.*s\n", key.mv_data, (int) key.mv_size, (char *) key.mv_data, value.mv_data, (int) value.mv_size, (char *) value.mv_data); status = rootdb_put(&env, dbi, &key, &value); assert(status == 0); MDB_val rvalue; status = rootdb_get(&env, dbi, &key, &rvalue); assert(status == 0); printf("key: %p %.*s, data: %p %.*s\n", key.mv_data, (int) key.mv_size, (char *) key.mv_data, rvalue.mv_data, (int) rvalue.mv_size, (char *) rvalue.mv_data); rootdb_close(&env, dbi); return 0; }
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include <string.h> #include "../src/rootdb.h" int main(void) { MDB_env *env; MDB_dbi dbi; int status; status = rootdb_open(&env, &dbi, "./testingdb"); assert(status == 0); char key_char[] = "hello"; char value_char[] = "world"; MDB_val key; MDB_val value; key.mv_size = sizeof(key_char); key.mv_data = key_char; value.mv_size = sizeof(value_char); value.mv_data = value_char; status = rootdb_put(&env, dbi, &key, &value); assert(status == 0); MDB_val rvalue; status = rootdb_get(&env, dbi, &key, &rvalue); assert(status == 0); assert(strcmp(rvalue.mv_data, value.mv_data) == 0); rootdb_close(&env, dbi); return 0; }
Add assertion for value in get/put test
Add assertion for value in get/put test
C
mit
braydonf/rootdb,braydonf/rootdb,braydonf/rootdb
509a2f29b962ea555660743a485f97b1dacbaf1d
tmcd/decls.h
tmcd/decls.h
/* * Insert Copyright Here. */ #ifdef LBS #define MASTERNODE "206.163.153.25" #else #define MASTERNODE "boss.emulab.net" #endif #define TBSERVER_PORT 7777 #define MYBUFSIZE 1024
/* * Insert Copyright Here. */ #ifdef LBS #define MASTERNODE "192.168.1.25" #else #define MASTERNODE "boss.emulab.net" #endif #define TBSERVER_PORT 7777 #define MYBUFSIZE 1024
Change the IP of my home machine for testing.
Change the IP of my home machine for testing.
C
agpl-3.0
nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome
521c91c3b5ec34462ae0202d61ab029a86d5bca8
lib/uart.h
lib/uart.h
/** * This is used to setup the UART device on an AVR unit. */ #pragma once #include <avr/io.h> #ifndef BAUD # define BAUD 9600 # warning BAUD rate not set. Setting BAUD rate to 9600. #endif // BAUD #define BAUDRATE ((F_CPU)/(BAUD*16UL)-1) static inline void uart_enable(void) { UBRR0H = BAUDRATE >> 8; UBRR0L = BAUDRATE; // Set RX/TN enabled UCSR0B |= _BV(TXEN0) | _BV(RXEN0); // Set asynchronous USART // Set frame format: 8-bit data, 2-stop bit UCSR0C |= _BV(USBS0) | _BV(UCSZ01) | _BV(UCSZ00); } static inline void uart_transmit(unsigned char data) { while (!(UCSR0A & _BV(UDRE0))); UDR0 = data; } static inline unsigned char uart_receive(void) { while (!(UCSR0A & _BV(RXC0))); return UDR0; }
/** * This is used to setup the UART device on an AVR unit. */ #pragma once #ifdef __cplusplus extern "C" { #endif #include <avr/io.h> #ifndef BAUD # define BAUD 9600 # warning BAUD rate not set. Setting BAUD rate to 9600. #endif // BAUD #define BAUDRATE ((F_CPU)/(BAUD*16UL)-1) /** * @brief Enables the UART device for 8-bit data at * the specified {@see BAUDRATE}. */ static inline void uart_enable(void) { UBRR0H = BAUDRATE >> 8; UBRR0L = BAUDRATE; // Set RX/TN enabled UCSR0B |= _BV(TXEN0) | _BV(RXEN0); // Set asynchronous USART // Set frame format: 8-bit data, 2-stop bit UCSR0C |= _BV(USBS0) | _BV(UCSZ01) | _BV(UCSZ00); } /** * @brief Transmits a character through the UART device. * @param data The data to be sent. */ static inline void uart_transmit(unsigned char data) { while (!(UCSR0A & _BV(UDRE0))); UDR0 = data; } /** * @brief Receives a character from the UART device. * @return Received character from the UART. */ static inline unsigned char uart_receive(void) { while (!(UCSR0A & _BV(RXC0))); return UDR0; } #ifdef __cplusplus } // extern "C" #endif
Add some comments, clean up the code, and add extern "C".
Add some comments, clean up the code, and add extern "C".
C
mpl-2.0
grimwm/avr,grimwm/avr,grimwm/avr,grimwm/avr
584110ed44810e40f029e985612acdb421d504b3
LYPopView/Classes/PopView.h
LYPopView/Classes/PopView.h
// // PopView.h // LYPOPVIEW // // CREATED BY LUO YU ON 19/12/2016. // COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED. // #ifndef PopView_h #define PopView_h #import <LYPopView/LYPopView.h> #import <LYPopView/LYPopMessage.h> #import <LYPopView/LYPopTable.h> #import <LYPopView/LYPopActionView.h> #endif /* PopView_h */
// // PopView.h // LYPOPVIEW // // CREATED BY LUO YU ON 19/12/2016. // COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED. // #ifndef PopView_h #define PopView_h #import <LYPopView/LYPopView.h> #import <LYPopView/LYPopMessage.h> #import <LYPopView/LYPopTable.h> #import <LYPopView/LYPopDate.h> #import <LYPopView/LYPopActionView.h> #endif /* PopView_h */
Add : date picker pop view importer
Add : date picker pop view importer
C
mit
blodely/LYPopView,blodely/LYPopView
41e95da32afb7457e28427975e4fc07ca218ddc1
src/laco.h
src/laco.h
#ifndef __LACO_H #define __LACO_H struct lua_State; /* State of laco REPL */ struct LacoState { struct lua_State* L; const char* version; int argc; const char** argv; int status; }; /** * Initilazation of laco's state * * param pointer to LacoState * param argument count (argc) * param arguments (argv) */ void laco_initLacoState(struct LacoState*, int, const char**); /** * Destroys the internal variable, but doesn't try to free the LacoState * pointer itself. * * param pointer to LacoState * * return 1 if pointer isn't NULL */ int laco_destroyLacoState(struct LacoState*); #endif /* __LACO_H */
#ifndef __LACO_H #define __LACO_H struct lua_State; /* State of laco REPL */ struct LacoState { struct lua_State* L; const char* version; int argc; const char** argv; int status; }; typedef struct LacoState LacoState; /** * Initilazation of laco's state * * param pointer to LacoState * param argument count (argc) * param arguments (argv) */ void laco_initLacoState(struct LacoState*, int, const char**); /** * Destroys the internal variable, but doesn't try to free the LacoState * pointer itself. * * param pointer to LacoState * * return 1 if pointer isn't NULL */ int laco_destroyLacoState(struct LacoState*); #endif /* __LACO_H */
Add typedef of LacoState in header
Add typedef of LacoState in header This is so the code base isn't littered with `typedef struct LacoState LacoState`.
C
bsd-2-clause
sourrust/laco
7fc441ff876199bae81d250f10f931138f9be1bf
7segments.c
7segments.c
main(int u,char**a){for(;u<129;u*=8)for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="$ֶ<&"[*c++-48])&u/2?33:32,y&u?95:32,y&u/4?33:32,*c?32:10);}
main(int u,char**a){for(char*c,y;y=u;u*=8)for(c=a[1];*c;)printf("%c%c%c%c",(y="$ֶ<&"[*c++-48])&u/2?33:32,y&u?95:32,y&u/4?33:32,*c?32:10);}
Save one more byte by casting loop counter u to a char
Save one more byte by casting loop counter u to a char
C
mit
McZonk/7segements,McZonk/7segements
176b88ed92daa22bd561e61a53f5a7a4866ca81e
alura/c/adivinhacao.c
alura/c/adivinhacao.c
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); if(chute == numerosecreto) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { if(chute > numerosecreto) { printf("Seu chute foi maior que o número secreto\n"); } if(chute < numerosecreto) { printf("Seu chute foi menor que o número secreto\n"); } printf("Você errou!\n"); printf("Mas não desanime, tente de novo!\n"); } }
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); int acertou = chute == numerosecreto; if(acertou) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { int maior = chute > numerosecreto; if(maior) { printf("Seu chute foi maior que o número secreto\n"); } else { printf("Seu chute foi menor que o número secreto\n"); } printf("Você errou!\n"); printf("Mas não desanime, tente de novo!\n"); } }
Update files, Alura, Introdução a C, Aula 2.3
Update files, Alura, Introdução a C, Aula 2.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
fac6dbb6292944a258dee1b726df16c78c2d0c90
src/lib/utils/rounding.h
src/lib/utils/rounding.h
/* * Integer Rounding Functions * (C) 1999-2007 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_ROUNDING_H_ #define BOTAN_ROUNDING_H_ #include <botan/types.h> namespace Botan { /** * Round up * @param n a non-negative integer * @param align_to the alignment boundary * @return n rounded up to a multiple of align_to */ inline size_t round_up(size_t n, size_t align_to) { BOTAN_ARG_CHECK(align_to != 0, "align_to must not be 0"); if(n % align_to) n += align_to - (n % align_to); return n; } /** * Round down * @param n an integer * @param align_to the alignment boundary * @return n rounded down to a multiple of align_to */ template<typename T> inline constexpr T round_down(T n, T align_to) { return (align_to == 0) ? n : (n - (n % align_to)); } /** * Clamp */ inline size_t clamp(size_t n, size_t lower_bound, size_t upper_bound) { if(n < lower_bound) return lower_bound; if(n > upper_bound) return upper_bound; return n; } } #endif
/* * Integer Rounding Functions * (C) 1999-2007 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_ROUNDING_H_ #define BOTAN_ROUNDING_H_ #include <botan/types.h> namespace Botan { /** * Round up * @param n a non-negative integer * @param align_to the alignment boundary * @return n rounded up to a multiple of align_to */ inline size_t round_up(size_t n, size_t align_to) { BOTAN_ARG_CHECK(align_to != 0, "align_to must not be 0"); if(n % align_to) n += align_to - (n % align_to); return n; } /** * Round down * @param n an integer * @param align_to the alignment boundary * @return n rounded down to a multiple of align_to */ template<typename T> inline constexpr T round_down(T n, T align_to) { return (align_to == 0) ? n : (n - (n % align_to)); } } #endif
Remove clamp, which was unused
Remove clamp, which was unused (And replaced by the std:: version in C++17 if we did need it)
C
bsd-2-clause
randombit/botan,randombit/botan,randombit/botan,randombit/botan,randombit/botan
0e3d9a4ce3640f5935e3f17b043497fdaf305c01
Braintree/3D-Secure/@Public/Braintree-3D-Secure.h
Braintree/3D-Secure/@Public/Braintree-3D-Secure.h
// All-in-one import for Braintree 3D Secure #import <Braintree/BTThreeDSecure.h>
// All-in-one import for Braintree 3D Secure #import <Braintree/BTThreeDSecure.h>
Add a new line to end of file
Add a new line to end of file
C
mit
bytemarkinc/braintree_ios,bytemarkinc/braintree_ios,Feverup/braintree_ios,apascual/braintree_ios,apascual/braintree_ios,TeachersPayTeachers/braintree_ios,TeachersPayTeachers/braintree_ios,billCTG/braintree_ios,TeachersPayTeachers/braintree_ios,EverettQuebral/braintree_ios,Feverup/braintree_ios,billCTG/braintree_ios,EverettQuebral/braintree_ios,Feverup/braintree_ios,Feverup/braintree_ios,apascual/braintree_ios,bytemarkinc/braintree_ios,braintree/braintree_ios,bytemarkinc/braintree_ios,EverettQuebral/braintree_ios,billCTG/braintree_ios,billCTG/braintree_ios,braintree/braintree_ios,braintree/braintree_ios,billCTG/braintree_ios,apascual/braintree_ios,bytemarkinc/braintree_ios,TeachersPayTeachers/braintree_ios,braintree/braintree_ios,EverettQuebral/braintree_ios,EverettQuebral/braintree_ios,TeachersPayTeachers/braintree_ios
ee5bc070ec0ce0f231cd1cf9728d83f80c076ff7
CocoaControls/CocoaControls/RSCCControlCellView.h
CocoaControls/CocoaControls/RSCCControlCellView.h
// // RSCCControlCellView.h // CocoaControls // // Created by R0CKSTAR on 14-5-5. // Copyright (c) 2014年 P.D.Q. All rights reserved. // #import <Cocoa/Cocoa.h> extern int const RSCCControlCellViewImageButtonTagBase; extern int const RSCCControlCellViewCocoaPodsButtonTagBase; extern int const RSCCControlCellViewCloneButtonTagBase; @class RSCCControlCellViewBackgroundView; @interface RSCCControlCellView : NSTableCellView @property (nonatomic, weak) IBOutlet RSCCControlCellViewBackgroundView *backgroundView; @property (nonatomic, weak) IBOutlet NSButton *imageButton; @property (nonatomic, weak) IBOutlet NSTextField *titleField; @property (nonatomic, weak) IBOutlet NSTextField *dateField; @property (nonatomic, weak) IBOutlet NSTextField *licenseField; @property (nonatomic, weak) IBOutlet NSButton *cocoaPodsButton; @property (nonatomic, weak) IBOutlet NSButton *cloneButton; @property (nonatomic, weak) IBOutlet NSImageView *star0; @property (nonatomic, weak) IBOutlet NSImageView *star1; @property (nonatomic, weak) IBOutlet NSImageView *star2; @property (nonatomic, weak) IBOutlet NSImageView *star3; @property (nonatomic, weak) IBOutlet NSImageView *star4; @property (nonatomic, strong) NSArray *stars; @end
// // RSCCControlCellView.h // CocoaControls // // Created by R0CKSTAR on 14-5-5. // Copyright (c) 2014年 P.D.Q. All rights reserved. // #import <Cocoa/Cocoa.h> extern int const RSCCControlCellViewImageButtonTagBase; extern int const RSCCControlCellViewCocoaPodsButtonTagBase; extern int const RSCCControlCellViewCloneButtonTagBase; @class RSCCControlCellViewBackgroundView; @interface RSCCControlCellView : NSTableCellView @property (assign) IBOutlet RSCCControlCellViewBackgroundView *backgroundView; @property (assign) IBOutlet NSButton *imageButton; @property (assign) IBOutlet NSTextField *titleField; @property (assign) IBOutlet NSTextField *dateField; @property (assign) IBOutlet NSTextField *licenseField; @property (assign) IBOutlet NSButton *cocoaPodsButton; @property (assign) IBOutlet NSButton *cloneButton; @property (assign) IBOutlet NSImageView *star0; @property (assign) IBOutlet NSImageView *star1; @property (assign) IBOutlet NSImageView *star2; @property (assign) IBOutlet NSImageView *star3; @property (assign) IBOutlet NSImageView *star4; @property (nonatomic, strong) NSArray *stars; @end
Change nonatomic, weak to assign for all IBOutlets
Change nonatomic, weak to assign for all IBOutlets
C
mit
yeahdongcn/CocoaControlsPlugin
fef701f7b0975c523cbe5a2e8e9730328a9f071a
core/base/inc/TThreadSlots.h
core/base/inc/TThreadSlots.h
// @(#)root/thread:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TThreadSlots #define ROOT_TThreadSlots namespace ROOT { enum EThreadSlotReservation { // Describe the system wide slot pre-allocation in the TThread // 'special data' storage array ; meant to be used as thread local // storage. (See TThread::Tsd) // // Slot 0 through 19 can be used for user application // Slot 20 and above are reserved for the global system kMaxUserThreadSlot = 20, // Slot reserved by ROOT's packages. kPadThreadSlot = 20, kClassThreadSlot = 21, kDirectoryThreadSlot = 22, kFileThreadSlot = 23, kMaxThreadSlot = 24 // Size of the array of thread local slots in TThread }; } #ifndef __CINT__ R__EXTERN void **(*gThreadTsd)(void*,Int_t); #endif #endif // ROOT_TThreadSlots
// @(#)root/base:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TThreadSlots #define ROOT_TThreadSlots namespace ROOT { enum EThreadSlotReservation { // Describe the system wide slot pre-allocation in the TThread // 'special data' storage array ; meant to be used as thread local // storage. (See TThread::Tsd) // // Slot 0 through 19 can be used for user application // Slot 20 and above are reserved for the global system kMaxUserThreadSlot = 20, // Slot reserved by ROOT's packages. kPadThreadSlot = 20, kClassThreadSlot = 21, kDirectoryThreadSlot = 22, kFileThreadSlot = 23, kMaxThreadSlot = 24 // Size of the array of thread local slots in TThread }; } #ifndef __CINT__ R__EXTERN void **(*gThreadTsd)(void*,Int_t); #endif #endif // ROOT_TThreadSlots
Fix module loc. Add missing final newline.
Fix module loc. Add missing final newline. git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41534 27541ba8-7e3a-0410-8455-c3a389f83636
C
lgpl-2.1
esakellari/my_root_for_test,krafczyk/root,buuck/root,sbinet/cxx-root,vukasinmilosevic/root,esakellari/my_root_for_test,sawenzel/root,Duraznos/root,gganis/root,sawenzel/root,CristinaCristescu/root,agarciamontoro/root,esakellari/my_root_for_test,dfunke/root,arch1tect0r/root,davidlt/root,abhinavmoudgil95/root,krafczyk/root,satyarth934/root,zzxuanyuan/root,lgiommi/root,olifre/root,tc3t/qoot,arch1tect0r/root,omazapa/root,gbitzes/root,cxx-hep/root-cern,CristinaCristescu/root,zzxuanyuan/root,Y--/root,Dr15Jones/root,gganis/root,vukasinmilosevic/root,vukasinmilosevic/root,Duraznos/root,zzxuanyuan/root,sbinet/cxx-root,karies/root,sawenzel/root,dfunke/root,sawenzel/root,georgtroska/root,BerserkerTroll/root,Duraznos/root,abhinavmoudgil95/root,buuck/root,abhinavmoudgil95/root,cxx-hep/root-cern,davidlt/root,bbockelm/root,thomaskeck/root,lgiommi/root,cxx-hep/root-cern,Duraznos/root,sirinath/root,cxx-hep/root-cern,ffurano/root5,mattkretz/root,cxx-hep/root-cern,omazapa/root-old,lgiommi/root,pspe/root,arch1tect0r/root,alexschlueter/cern-root,dfunke/root,karies/root,omazapa/root,georgtroska/root,veprbl/root,georgtroska/root,olifre/root,root-mirror/root,esakellari/my_root_for_test,gbitzes/root,mattkretz/root,Dr15Jones/root,mkret2/root,sirinath/root,zzxuanyuan/root-compressor-dummy,perovic/root,pspe/root,pspe/root,kirbyherm/root-r-tools,karies/root,strykejern/TTreeReader,olifre/root,kirbyherm/root-r-tools,esakellari/root,0x0all/ROOT,tc3t/qoot,abhinavmoudgil95/root,esakellari/root,BerserkerTroll/root,nilqed/root,esakellari/my_root_for_test,dfunke/root,alexschlueter/cern-root,strykejern/TTreeReader,sirinath/root,mattkretz/root,Y--/root,Y--/root,pspe/root,davidlt/root,smarinac/root,abhinavmoudgil95/root,root-mirror/root,krafczyk/root,buuck/root,thomaskeck/root,agarciamontoro/root,abhinavmoudgil95/root,mkret2/root,simonpf/root,thomaskeck/root,buuck/root,zzxuanyuan/root-compressor-dummy,mkret2/root,thomaskeck/root,jrtomps/root,pspe/root,lgiommi/root,agarciamontoro/root,jrtomps/root,jrtomps/root,veprbl/root,abhinavmoudgil95/root,thomaskeck/root,mhuwiler/rootauto,perovic/root,cxx-hep/root-cern,jrtomps/root,esakellari/root,jrtomps/root,satyarth934/root,omazapa/root,arch1tect0r/root,tc3t/qoot,georgtroska/root,veprbl/root,omazapa/root,veprbl/root,gbitzes/root,zzxuanyuan/root,sawenzel/root,arch1tect0r/root,zzxuanyuan/root,vukasinmilosevic/root,nilqed/root,olifre/root,bbockelm/root,Y--/root,mattkretz/root,karies/root,omazapa/root-old,abhinavmoudgil95/root,agarciamontoro/root,evgeny-boger/root,mkret2/root,karies/root,dfunke/root,strykejern/TTreeReader,mkret2/root,kirbyherm/root-r-tools,sawenzel/root,sbinet/cxx-root,BerserkerTroll/root,perovic/root,mhuwiler/rootauto,mkret2/root,perovic/root,BerserkerTroll/root,agarciamontoro/root,vukasinmilosevic/root,bbockelm/root,satyarth934/root,mattkretz/root,vukasinmilosevic/root,perovic/root,evgeny-boger/root,satyarth934/root,evgeny-boger/root,vukasinmilosevic/root,Duraznos/root,sirinath/root,krafczyk/root,cxx-hep/root-cern,sirinath/root,thomaskeck/root,kirbyherm/root-r-tools,satyarth934/root,mkret2/root,buuck/root,georgtroska/root,satyarth934/root,simonpf/root,pspe/root,zzxuanyuan/root,davidlt/root,karies/root,veprbl/root,0x0all/ROOT,davidlt/root,mhuwiler/rootauto,mkret2/root,mattkretz/root,davidlt/root,agarciamontoro/root,esakellari/root,davidlt/root,evgeny-boger/root,omazapa/root,georgtroska/root,pspe/root,omazapa/root,nilqed/root,agarciamontoro/root,mhuwiler/rootauto,abhinavmoudgil95/root,zzxuanyuan/root,sirinath/root,omazapa/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,Y--/root,vukasinmilosevic/root,buuck/root,omazapa/root,thomaskeck/root,perovic/root,simonpf/root,beniz/root,simonpf/root,tc3t/qoot,olifre/root,esakellari/root,omazapa/root-old,tc3t/qoot,mattkretz/root,root-mirror/root,gbitzes/root,gganis/root,Duraznos/root,kirbyherm/root-r-tools,mattkretz/root,beniz/root,agarciamontoro/root,tc3t/qoot,esakellari/my_root_for_test,BerserkerTroll/root,lgiommi/root,ffurano/root5,thomaskeck/root,satyarth934/root,nilqed/root,smarinac/root,smarinac/root,zzxuanyuan/root,thomaskeck/root,smarinac/root,pspe/root,ffurano/root5,gbitzes/root,georgtroska/root,esakellari/my_root_for_test,gbitzes/root,bbockelm/root,georgtroska/root,arch1tect0r/root,BerserkerTroll/root,beniz/root,smarinac/root,Duraznos/root,dfunke/root,arch1tect0r/root,esakellari/my_root_for_test,zzxuanyuan/root,CristinaCristescu/root,simonpf/root,sirinath/root,nilqed/root,smarinac/root,veprbl/root,satyarth934/root,sbinet/cxx-root,krafczyk/root,sirinath/root,omazapa/root-old,evgeny-boger/root,BerserkerTroll/root,smarinac/root,evgeny-boger/root,mhuwiler/rootauto,bbockelm/root,omazapa/root-old,olifre/root,Y--/root,Dr15Jones/root,Duraznos/root,veprbl/root,root-mirror/root,sawenzel/root,CristinaCristescu/root,perovic/root,pspe/root,davidlt/root,esakellari/root,root-mirror/root,gbitzes/root,root-mirror/root,sbinet/cxx-root,zzxuanyuan/root-compressor-dummy,simonpf/root,karies/root,smarinac/root,lgiommi/root,esakellari/root,olifre/root,lgiommi/root,0x0all/ROOT,Dr15Jones/root,esakellari/my_root_for_test,beniz/root,beniz/root,dfunke/root,sbinet/cxx-root,0x0all/ROOT,CristinaCristescu/root,Dr15Jones/root,evgeny-boger/root,simonpf/root,veprbl/root,bbockelm/root,veprbl/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,gganis/root,sirinath/root,mhuwiler/rootauto,Y--/root,omazapa/root-old,satyarth934/root,alexschlueter/cern-root,CristinaCristescu/root,esakellari/root,gbitzes/root,jrtomps/root,omazapa/root-old,nilqed/root,0x0all/ROOT,buuck/root,simonpf/root,strykejern/TTreeReader,Dr15Jones/root,gbitzes/root,root-mirror/root,beniz/root,BerserkerTroll/root,beniz/root,vukasinmilosevic/root,sawenzel/root,karies/root,jrtomps/root,strykejern/TTreeReader,gbitzes/root,nilqed/root,Y--/root,Duraznos/root,krafczyk/root,ffurano/root5,simonpf/root,CristinaCristescu/root,gganis/root,veprbl/root,davidlt/root,gganis/root,arch1tect0r/root,zzxuanyuan/root,dfunke/root,sawenzel/root,sbinet/cxx-root,0x0all/ROOT,pspe/root,omazapa/root-old,tc3t/qoot,omazapa/root-old,smarinac/root,cxx-hep/root-cern,sirinath/root,root-mirror/root,root-mirror/root,mhuwiler/rootauto,ffurano/root5,alexschlueter/cern-root,esakellari/root,mhuwiler/rootauto,root-mirror/root,krafczyk/root,zzxuanyuan/root,Duraznos/root,mkret2/root,karies/root,olifre/root,buuck/root,0x0all/ROOT,kirbyherm/root-r-tools,lgiommi/root,sbinet/cxx-root,gbitzes/root,arch1tect0r/root,sbinet/cxx-root,omazapa/root,mattkretz/root,ffurano/root5,arch1tect0r/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,olifre/root,buuck/root,alexschlueter/cern-root,jrtomps/root,karies/root,esakellari/my_root_for_test,Y--/root,mattkretz/root,georgtroska/root,nilqed/root,agarciamontoro/root,abhinavmoudgil95/root,nilqed/root,mattkretz/root,alexschlueter/cern-root,strykejern/TTreeReader,satyarth934/root,georgtroska/root,krafczyk/root,karies/root,CristinaCristescu/root,vukasinmilosevic/root,davidlt/root,tc3t/qoot,smarinac/root,mhuwiler/rootauto,olifre/root,perovic/root,satyarth934/root,strykejern/TTreeReader,simonpf/root,zzxuanyuan/root-compressor-dummy,jrtomps/root,gganis/root,beniz/root,perovic/root,Y--/root,lgiommi/root,krafczyk/root,gganis/root,Dr15Jones/root,buuck/root,esakellari/root,dfunke/root,alexschlueter/cern-root,bbockelm/root,vukasinmilosevic/root,dfunke/root,omazapa/root-old,omazapa/root,agarciamontoro/root,evgeny-boger/root,CristinaCristescu/root,zzxuanyuan/root-compressor-dummy,krafczyk/root,pspe/root,Duraznos/root,bbockelm/root,mhuwiler/rootauto,sbinet/cxx-root,beniz/root,CristinaCristescu/root,esakellari/root,krafczyk/root,evgeny-boger/root,jrtomps/root,gganis/root,zzxuanyuan/root-compressor-dummy,nilqed/root,nilqed/root,dfunke/root,beniz/root,jrtomps/root,perovic/root,kirbyherm/root-r-tools,beniz/root,lgiommi/root,perovic/root,evgeny-boger/root,tc3t/qoot,abhinavmoudgil95/root,mkret2/root,bbockelm/root,BerserkerTroll/root,omazapa/root,Y--/root,zzxuanyuan/root-compressor-dummy,buuck/root,0x0all/ROOT,0x0all/ROOT,BerserkerTroll/root,gganis/root,CristinaCristescu/root,zzxuanyuan/root-compressor-dummy,davidlt/root,ffurano/root5,tc3t/qoot,mkret2/root,sbinet/cxx-root,gganis/root,lgiommi/root,sirinath/root,evgeny-boger/root,georgtroska/root,root-mirror/root,arch1tect0r/root,sawenzel/root,bbockelm/root,BerserkerTroll/root,mhuwiler/rootauto,thomaskeck/root,olifre/root,simonpf/root,omazapa/root-old,sawenzel/root,veprbl/root
37fb2148f2634989191e5770f3a2eabd93d3a3c7
lilthumb.h
lilthumb.h
#ifndef lilthumb #define lilthumb #include <ctime> #include <ostream> namespace lilthumb{ std::string timeString() { time_t rawtime; struct tm * timeinfo; char buffer[80]; time (&rawtime); timeinfo = localtime(&rawtime); strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo); std::string str(buffer); return str; } void stone( std::ostream& stream, std::string message ) { stream << timeString() << " | " << message << std::endl; } } #endif
#ifndef lilthumb #define lilthumb #include <ctime> #include <ostream> namespace lilthumb{ std::string timeString() { time_t rawtime; struct tm * timeinfo; char buffer[80]; time (&rawtime); timeinfo = localtime(&rawtime); strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo); std::string str(buffer); return str; } void stone( std::ostream& stream, double* c_array, int n_values = 0 ) { stream << timeString() << " | "; if( n_values == 0 ) { stream << c_array << std::endl; } else { for( int i = 0; i < n_values - 1; i++ ) { stream << c_array[i] << "/"; } stream << c_array[n_values - 1] << std::endl; } } void stone( std::ostream& stream, std::string message ) { stream << timeString() << " | " << message << std::endl; } } #endif
Add a n-tuple vector logging function
Add a n-tuple vector logging function
C
apache-2.0
jeromevelut/lilthumb
b5f6cbbacfbb7a24599912e77c349f4ac1101c8f
High_Temp.h
High_Temp.h
/* High_Temp.h 2014 Copyright (c) Seeed Technology Inc. All right reserved. Loovee 2013-4-14 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __HIGH_TEMP_H__ #define __HIGH_TEMP_H__ class HighTemp{ public: HighTemp(int _pinTmp, int _pinThmc); float getRoomTmp(); // float getThmc(); void begin(); private float tempRoom; // room temperature float tempThmc; // thermocouple temperature int pinRoomTmp; // pin of temperature sensor int pinThmc; // pin of thermocouple public: int getAnalog(int pin); float K_VtoT(float mV); // K type thermocouple, mv->oC float getThmcVol(); // get voltage of thmc in mV }; #endif
/* High_Temp.h 2014 Copyright (c) Seeed Technology Inc. All right reserved. Loovee 2013-4-14 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __HIGH_TEMP_H__ #define __HIGH_TEMP_H__ class HighTemp{ public: HighTemp(int _pinTmp, int _pinThmc); float getRoomTmp(); // float getThmc(); void begin(); private: float tempRoom; // room temperature float tempThmc; // thermocouple temperature int pinRoomTmp; // pin of temperature sensor int pinThmc; // pin of thermocouple public: virtual int getAnalog(int pin); float K_VtoT(float mV); // K type thermocouple, mv->oC float getThmcVol(); // get voltage of thmc in mV }; #endif
Add virtual decl to getAnalog to enable overloading
Add virtual decl to getAnalog to enable overloading
C
mit
mhaas/Grove_HighTemp_Sensor
0c15a524c532c1006a7bd36d3a680f8e8b8db9fc
src/include/pg_getopt.h
src/include/pg_getopt.h
/* * Portions Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Portions Copyright (c) 2003-2014, PostgreSQL Global Development Group * * src/include/pg_getopt.h */ #ifndef PG_GETOPT_H #define PG_GETOPT_H /* POSIX says getopt() is provided by unistd.h */ #include <unistd.h> /* rely on the system's getopt.h if present */ #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* * If we have <getopt.h>, assume it declares these variables, else do that * ourselves. (We used to just declare them unconditionally, but Cygwin * doesn't like that.) */ #ifndef HAVE_GETOPT_H extern char *optarg; extern int optind; extern int opterr; extern int optopt; #ifdef HAVE_INT_OPTRESET extern int optreset; #endif #endif /* HAVE_GETOPT_H */ #ifndef HAVE_GETOPT extern int getopt(int nargc, char *const * nargv, const char *ostr); #endif #endif /* PG_GETOPT_H */
/* * Portions Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Portions Copyright (c) 2003-2014, PostgreSQL Global Development Group * * src/include/pg_getopt.h */ #ifndef PG_GETOPT_H #define PG_GETOPT_H /* POSIX says getopt() is provided by unistd.h */ #include <unistd.h> /* rely on the system's getopt.h if present */ #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* * If we have <getopt.h>, assume it declares these variables, else do that * ourselves. (We used to just declare them unconditionally, but Cygwin * doesn't like that.) */ #ifndef HAVE_GETOPT_H extern char *optarg; extern int optind; extern int opterr; extern int optopt; #endif /* HAVE_GETOPT_H */ /* * Some platforms have optreset but not <getopt.h>. Cygwin, however, * doesn't like this either. */ #if defined(HAVE_INT_OPTRESET) && !defined(__CYGWIN__) extern int optreset; #endif #ifndef HAVE_GETOPT extern int getopt(int nargc, char *const * nargv, const char *ostr); #endif #endif /* PG_GETOPT_H */
Allow for platforms that have optreset but not <getopt.h>.
Allow for platforms that have optreset but not <getopt.h>. Reportedly, some versions of mingw are like that, and it seems plausible in general that older platforms might be that way. However, we'd determined experimentally that just doing "extern int" conflicts with the way Cygwin declares these variables, so explicitly exclude Cygwin. Michael Paquier, tweaked by me to hopefully not break Cygwin
C
mpl-2.0
Postgres-XL/Postgres-XL,yazun/postgres-xl,techdragon/Postgres-XL,50wu/gpdb,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,xinzweb/gpdb,50wu/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,50wu/gpdb,oberstet/postgres-xl,techdragon/Postgres-XL,zeroae/postgres-xl,ashwinstar/gpdb,yazun/postgres-xl,pavanvd/postgres-xl,pavanvd/postgres-xl,jmcatamney/gpdb,techdragon/Postgres-XL,pavanvd/postgres-xl,xinzweb/gpdb,adam8157/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,xinzweb/gpdb,zeroae/postgres-xl,jmcatamney/gpdb,adam8157/gpdb,adam8157/gpdb,lisakowen/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,zeroae/postgres-xl,jmcatamney/gpdb,techdragon/Postgres-XL,lisakowen/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,ovr/postgres-xl,lisakowen/gpdb,jmcatamney/gpdb,50wu/gpdb,yazun/postgres-xl,jmcatamney/gpdb,lisakowen/gpdb,lisakowen/gpdb,ashwinstar/gpdb,xinzweb/gpdb,ovr/postgres-xl,greenplum-db/gpdb,ashwinstar/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,adam8157/gpdb,lisakowen/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,ovr/postgres-xl,Postgres-XL/Postgres-XL,ashwinstar/gpdb,yazun/postgres-xl,lisakowen/gpdb,oberstet/postgres-xl,xinzweb/gpdb,ovr/postgres-xl,lisakowen/gpdb,oberstet/postgres-xl,yazun/postgres-xl,ashwinstar/gpdb,ovr/postgres-xl,50wu/gpdb,xinzweb/gpdb,zeroae/postgres-xl,50wu/gpdb,adam8157/gpdb,xinzweb/gpdb,pavanvd/postgres-xl,greenplum-db/gpdb,50wu/gpdb
a15f0d5910d660ab8cd5c9d98316115c88e16713
Classes/Core/KWMatching.h
Classes/Core/KWMatching.h
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import "KiwiConfiguration.h" @protocol KWMatching<NSObject> #pragma mark - Initializing - (id)initWithSubject:(id)anObject; #pragma mark - Getting Matcher Strings + (NSArray *)matcherStrings; #pragma mark - Getting Matcher Compatability + (BOOL)canMatchSubject:(id)anObject; #pragma mark - Matching @optional @property (nonatomic, readonly) BOOL isNilMatcher; - (BOOL)shouldBeEvaluatedAtEndOfExample; - (BOOL)willEvaluateMultipleTimes; - (void)setWillEvaluateMultipleTimes:(BOOL)shouldEvaluateMultipleTimes; @required - (BOOL)evaluate; #pragma mark - Getting Failure Messages - (NSString *)failureMessageForShould; - (NSString *)failureMessageForShouldNot; @end
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import "KiwiConfiguration.h" @protocol KWMatching<NSObject> #pragma mark - Initializing - (id)initWithSubject:(id)anObject; #pragma mark - Getting Matcher Strings + (NSArray *)matcherStrings; #pragma mark - Getting Matcher Compatability + (BOOL)canMatchSubject:(id)anObject; #pragma mark - Matching @optional - (BOOL)isNilMatcher; - (BOOL)shouldBeEvaluatedAtEndOfExample; - (BOOL)willEvaluateMultipleTimes; - (void)setWillEvaluateMultipleTimes:(BOOL)shouldEvaluateMultipleTimes; @required - (BOOL)evaluate; #pragma mark - Getting Failure Messages - (NSString *)failureMessageForShould; - (NSString *)failureMessageForShouldNot; @end
Use method declaration instead of property
Use method declaration instead of property
C
bsd-3-clause
carezone/Kiwi,tangwei6423471/Kiwi,emodeqidao/Kiwi,weslindsay/Kiwi,tcirwin/Kiwi,LiuShulong/Kiwi,weslindsay/Kiwi,JoistApp/Kiwi,tcirwin/Kiwi,howandhao/Kiwi,iosRookie/Kiwi,weslindsay/Kiwi,tonyarnold/Kiwi,iosRookie/Kiwi,allending/Kiwi,tcirwin/Kiwi,ecaselles/Kiwi,PaulTaykalo/Kiwi,ecaselles/Kiwi,ecaselles/Kiwi,indiegogo/Kiwi,JoistApp/Kiwi,tcirwin/Kiwi,depop/Kiwi,PaulTaykalo/Kiwi,tangwei6423471/Kiwi,LiuShulong/Kiwi,samkrishna/Kiwi,carezone/Kiwi,hyperoslo/Tusen,JoistApp/Kiwi,iosRookie/Kiwi,PaulTaykalo/Kiwi,samkrishna/Kiwi,cookov/Kiwi,unisontech/Kiwi,tangwei6423471/Kiwi,indiegogo/Kiwi,hyperoslo/Tusen,LiuShulong/Kiwi,depop/Kiwi,weslindsay/Kiwi,carezone/Kiwi,LiuShulong/Kiwi,allending/Kiwi,carezone/Kiwi,cookov/Kiwi,unisontech/Kiwi,TaemoonCho/Kiwi,unisontech/Kiwi,emodeqidao/Kiwi,samkrishna/Kiwi,emodeqidao/Kiwi,howandhao/Kiwi,indiegogo/Kiwi,tangwei6423471/Kiwi,hyperoslo/Tusen,PaulTaykalo/Kiwi,unisontech/Kiwi,allending/Kiwi,howandhao/Kiwi,howandhao/Kiwi,iosRookie/Kiwi,tonyarnold/Kiwi,emodeqidao/Kiwi,tonyarnold/Kiwi,tonyarnold/Kiwi,JoistApp/Kiwi,ecaselles/Kiwi,indiegogo/Kiwi,cookov/Kiwi,TaemoonCho/Kiwi,TaemoonCho/Kiwi,depop/Kiwi,depop/Kiwi,samkrishna/Kiwi,cookov/Kiwi,allending/Kiwi,TaemoonCho/Kiwi,hyperoslo/Tusen
a48ecd50079818e7a4d1444a1d14aebefb9cbb67
FringeFM/FFMSongUpdater.h
FringeFM/FFMSongUpdater.h
// // FFMSongUpdater.h // FringeFM // // Created by John Sheets on 6/10/12. // Copyright (c) 2012 John Sheets. All rights reserved. // // MIT License // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <Foundation/Foundation.h> @class FFMSong; @interface FFMSongUpdater : NSObject @property (nonatomic, strong) NSImage *icon; @property (nonatomic) NSTimeInterval updateFrequency; - (FFMSong *)fetchCurrentSong; - (BOOL)isServiceAvailable; - (BOOL)isServicePlaying; @end
// // FFMSongUpdater.h // FringeFM // // Created by John Sheets on 6/10/12. // Copyright (c) 2012 John Sheets. All rights reserved. // // MIT License // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <Foundation/Foundation.h> @class FFMSong; @interface FFMSongUpdater : NSObject @property (nonatomic, strong) NSImage *icon; @property (nonatomic) NSUInteger updateFrequency; - (FFMSong *)fetchCurrentSong; - (BOOL)isServiceAvailable; - (BOOL)isServicePlaying; @end
Switch song updater updateFrequency from NSTimeInterval (length of time) to NSUInteger (number of counter seconds to skip).
Switch song updater updateFrequency from NSTimeInterval (length of time) to NSUInteger (number of counter seconds to skip).
C
mit
jsheets/FringeFM
5e55843bb8ed1ec7d134a759c53e34beb1618952
include/asm-mn10300/ipcbuf.h
include/asm-mn10300/ipcbuf.h
#ifndef _ASM_IPCBUF_H_ #define _ASM_IPCBUF_H /* * The ipc64_perm structure for MN10300 architecture. * Note extra padding because this structure is passed back and forth * between kernel and user space. * * Pad space is left for: * - 32-bit mode_t and seq * - 2 miscellaneous 32-bit values */ struct ipc64_perm { __kernel_key_t key; __kernel_uid32_t uid; __kernel_gid32_t gid; __kernel_uid32_t cuid; __kernel_gid32_t cgid; __kernel_mode_t mode; unsigned short __pad1; unsigned short seq; unsigned short __pad2; unsigned long __unused1; unsigned long __unused2; }; #endif /* _ASM_IPCBUF_H */
#ifndef _ASM_IPCBUF_H #define _ASM_IPCBUF_H /* * The ipc64_perm structure for MN10300 architecture. * Note extra padding because this structure is passed back and forth * between kernel and user space. * * Pad space is left for: * - 32-bit mode_t and seq * - 2 miscellaneous 32-bit values */ struct ipc64_perm { __kernel_key_t key; __kernel_uid32_t uid; __kernel_gid32_t gid; __kernel_uid32_t cuid; __kernel_gid32_t cgid; __kernel_mode_t mode; unsigned short __pad1; unsigned short seq; unsigned short __pad2; unsigned long __unused1; unsigned long __unused2; }; #endif /* _ASM_IPCBUF_H */
Fix typo in header guard
MN10300: Fix typo in header guard Fix a typo in the header guard of asm/ipc.h. Signed-off-by: Vegard Nossum <[email protected]> Signed-off-by: David Howells <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
da16baebce5c500fa77b346e18a68e0e31c453f4
set/prod.c
set/prod.c
int set_empty(void) { return 0; } int set_size(int set) { int size = 0; while (set) { size += set & 1; set >>= 1; } return size; } int set_add(int set, int element) { return set | (1 << element); }
int set_empty(void) { return 0; } int set_size(int set) { /* Bit-Twiddling Hacks */ /* TODO: shall export to bits module to provide more robust solutions * based on hardware capabilities (eg. popcount instruction) */ set = set - ((set >> 1) & ~(unsigned int)0/3); set = (set & ~(unsigned int)0/15*3) + ((set >> 2) & ~(unsigned int)0/15*3); set = (set + (set >> 4)) & ~(unsigned int)0/255*15; return (set * (~(unsigned int)0/255)) >> (sizeof(int) - 1) * 8; } int set_add(int set, int element) { return set | (1 << element); }
Optimize counting size of larger sets
[SET] REFACTOR: Optimize counting size of larger sets
C
mit
w3ln4/open
78207b6e00ed9a4d296bbfce43da63b1e034a84e
spinlock.h
spinlock.h
#pragma once #define SPINLOCK_DEBUG 1 // Mutual exclusion lock. struct spinlock { u32 locked; // Is the lock held? #if SPINLOCK_DEBUG // For debugging: char *name; // Name of lock. struct cpu *cpu; // The cpu holding the lock. uptr pcs[10]; // The call stack (an array of program counters) // that locked the lock. #endif }; static inline const char *lockname(struct spinlock *s) { #if SPINLOCK_DEBUG return s->name ?: "null"; #else return "unknown"; #endif }
#pragma once #define SPINLOCK_DEBUG 1 // Mutual exclusion lock. struct spinlock { u32 locked; // Is the lock held? #if SPINLOCK_DEBUG // For debugging: char *name; // Name of lock. struct cpu *cpu; // The cpu holding the lock. uptr pcs[10]; // The call stack (an array of program counters) // that locked the lock. #endif }; #if SPINLOCK_DEBUG #define lockname(s) ((s)->name ?: "null") #else #define lockname(s) ("unknown") #endif
Make lockname(s) a macro instead of a inline.
Make lockname(s) a macro instead of a inline.
C
mit
aclements/sv6,aclements/sv6,bowlofstew/sv6,aclements/sv6,aclements/sv6,aclements/sv6,bowlofstew/sv6,bowlofstew/sv6,bowlofstew/sv6,bowlofstew/sv6
4705e8ddf88e130ce1899366e2647176ce6d9407
src/main.c
src/main.c
#include "backend.h" #include "frontend.h" #include <ncurses.h> int main() { initscr(); cbreak(); noecho(); keypad(stdscr, TRUE); // make keys work curs_set(0); // hide cursor timeout(100); int xmax; int ymax; getmaxyx(stdscr, ymax, xmax); enum Direction dir = RIGHT; Board* board = create_board(create_snake(), NULL, xmax, ymax); int i; for (i = 0; i < 6; i++) { add_new_food(board); } while(true) { erase(); display_points(board->snake, ACS_BLOCK); display_points(board->foods, ACS_DIAMOND); dir = get_next_move(dir); enum Status status = move_snake(board, dir); if (status == FAILURE) break; } endwin(); return 0; }
#include "backend.h" #include "frontend.h" #include <ncurses.h> int main() { initscr(); cbreak(); noecho(); keypad(stdscr, TRUE); // make keys work curs_set(0); // hide cursor timeout(100); int xmax; int ymax; getmaxyx(stdscr, ymax, xmax); enum Direction dir = RIGHT; Board* board = create_board(create_snake(), NULL, xmax, ymax); int i; for (i = 0; i < 6; i++) { add_new_food(board); } while(true) { clear(); display_points(board->snake, ACS_BLOCK); display_points(board->foods, ACS_DIAMOND); refresh(); dir = get_next_move(dir); enum Status status = move_snake(board, dir); if (status == FAILURE) break; } endwin(); return 0; }
Call `clear` and `refresh` to update screen
Call `clear` and `refresh` to update screen
C
mit
jvns/snake,jvns/snake
fcd34497864825e90f2c0331278142e10dec2ae0
src/main.h
src/main.h
// Copyright (c) 2016 Brian Barto // // This program is free software; you can redistribute it and/or modify it // under the terms of the MIT License. See LICENSE for more details. #ifndef MAIN_H #define MAIN_H 1 #define VERSION "0.1.0" #define DEFAULT_KEY_NAME "default" #define DEFAULT_KEY_PATH ".config/mirrorcrypt/" #define GRID_SIZE 24 #define SUPPORTED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+{}[]|\\:; \n\t\"'<>,.?/~" #endif
// Copyright (c) 2016 Brian Barto // // This program is free software; you can redistribute it and/or modify it // under the terms of the MIT License. See LICENSE for more details. #ifndef MAIN_H #define MAIN_H 1 #define VERSION "0.1.0" #define DEFAULT_KEY_NAME "default" #define DEFAULT_KEY_PATH ".config/mrrcrypt/" #define GRID_SIZE 24 #define SUPPORTED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+{}[]|\\:; \n\t\"'<>,.?/~" #endif
Change config dir name to mrrcrypt
Change config dir name to mrrcrypt modified: src/main.h
C
mit
bartobri/mirror-crypt
262e8b301b1369581e80af57508e55035cf78916
sw/device/lib/testing/test_rom/english_breakfast_fake_driver_funcs.c
sw/device/lib/testing/test_rom/english_breakfast_fake_driver_funcs.c
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include "sw/device/silicon_creator/lib/drivers/lifecycle.h" #include "sw/device/silicon_creator/lib/drivers/otp.h" #include "sw/device/silicon_creator/lib/drivers/rstmgr.h" // TODO(#12905): This file includes fake definitions for the functions that are // used by the silicon_creator bootstrap implementation but missing in the // english breakfast top level due to hardware limitations. #if !OT_IS_ENGLISH_BREAKFAST #error "This file should be compiled only for the english breakfast top level" #endif void lifecycle_hw_rev_get(lifecycle_hw_rev_t *hw_rev) { *hw_rev = (lifecycle_hw_rev_t){ .chip_gen = 0, .chip_rev = 0, }; } uint32_t otp_read32(uint32_t address) { return kHardenedBoolTrue; } void rstmgr_reset(void) { while (true) { } }
Add fake functions for hardware missing in english breakfast
[sw/test_rom] Add fake functions for hardware missing in english breakfast Signed-off-by: Alphan Ulusoy <[email protected]>
C
apache-2.0
lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan
0272010e05ecc508be41317eb8f392a78a707eab
src/util.c
src/util.c
/** * @file util.c * @author Bryce Davis * @date 19 November 2015 * @brief Header file for internal libbad declarations * @copyright Copyright (c) 2015, Bryce Davis. Released under the MIT License. * See LICENSE.txt for details. */ #include <stdio.h> #include "libbad_base.h" /** * @brief A nicer function to print an integer from a DATA * * @param d A pointer to a DATA */ #define data_print_int(d) data_fprint_int(stdin, (d)) /** * @brief Print an integer from a DATA * * @param out a pointer to the output file * @param data a pointer to a DATA */ void data_fprint_int(FILE* out, DATA data) { fprintf(out, "%lld", data.data_int); }
Implement function to print an integer from a DATA
Implement function to print an integer from a DATA
C
mit
mahimahi42/libbad
d257a1c2e1d577e7902d47696b9f98ece299e7dd
src/dnscap_common.h
src/dnscap_common.h
/* * setup MY_BPFTIMEVAL as the timeval structure that bpf packets * will be assoicated with packets from libpcap */ #ifdef __OpenBSD__ # define MY_BPFTIMEVAL bpf_timeval #endif #ifndef MY_BPFTIMEVAL # define MY_BPFTIMEVAL timeval #endif typedef struct MY_BPFTIMEVAL my_bpftimeval; /* * Structure to contain IP addresses */ typedef struct { int af; union { struct in_addr a4; struct in6_addr a6; } u; } iaddr; /* * plugins can call the logerr() function in the main dnscap * process. */ typedef int logerr_t(const char *fmt, ...); /* * Prototype for the plugin "output" function */ typedef void output_t(const char *descr, iaddr from, iaddr to, uint8_t proto, int isfrag, unsigned sport, unsigned dport, my_bpftimeval ts, const u_char *pkt_copy, unsigned olen, const u_char *dnspkt, unsigned dnslen); #define DIR_INITIATE 0x0001 #define DIR_RESPONSE 0x0002
#include <netinet/in.h> /* * setup MY_BPFTIMEVAL as the timeval structure that bpf packets * will be assoicated with packets from libpcap */ #ifndef MY_BPFTIMEVAL # define MY_BPFTIMEVAL timeval #endif typedef struct MY_BPFTIMEVAL my_bpftimeval; /* * Structure to contain IP addresses */ typedef struct { int af; union { struct in_addr a4; struct in6_addr a6; } u; } iaddr; /* * plugins can call the logerr() function in the main dnscap * process. */ typedef int logerr_t(const char *fmt, ...); /* * Prototype for the plugin "output" function */ typedef void output_t(const char *descr, iaddr from, iaddr to, uint8_t proto, int isfrag, unsigned sport, unsigned dport, my_bpftimeval ts, const u_char *pkt_copy, unsigned olen, const u_char *dnspkt, unsigned dnslen); #define DIR_INITIATE 0x0001 #define DIR_RESPONSE 0x0002
Fix compilation on FreeBSD and OpenBSD
Fix compilation on FreeBSD and OpenBSD
C
isc
verisign/dnscap,verisign/dnscap
39878a58e58dfa4029c0ddfc2f3c45098fe06466
libgdi/gdi_shape.h
libgdi/gdi_shape.h
/* FreeRDP: A Remote Desktop Protocol client. GDI Shape Functions Copyright 2010-2011 Marc-Andre Moreau <[email protected]> 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 __GDI_SHAPE_H #define __GDI_SHAPE_H #include "gdi.h" int Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); int Polygon(HDC hdc, POINT *lpPoints, int nCount); int FillRect(HDC hdc, HRECT rect, HBRUSH hbr); #endif /* __GDI_SHAPE_H */
/* FreeRDP: A Remote Desktop Protocol client. GDI Shape Functions Copyright 2010-2011 Marc-Andre Moreau <[email protected]> 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 __GDI_SHAPE_H #define __GDI_SHAPE_H #include "gdi.h" void ShapeInit(); int Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); int Polygon(HDC hdc, POINT *lpPoints, int nCount); int FillRect(HDC hdc, HRECT rect, HBRUSH hbr); #endif /* __GDI_SHAPE_H */
Fix missing declaration for ShapeInit()
Fix missing declaration for ShapeInit()
C
apache-2.0
FreeRDP/FreeRDP-old,FreeRDP/FreeRDP-old,FreeRDP/FreeRDP-old
cb14a9aaa5fa50b22982f14aeab7d9f2f634ea3d
tests/vio_tests/check_vio_file_stat.c
tests/vio_tests/check_vio_file_stat.c
#include "support.h" #include "vio/csync_vio_file_stat.h" START_TEST (check_csync_vio_file_stat_new) { csync_vio_file_stat_t *stat = NULL; stat = csync_vio_file_stat_new(); fail_if(stat == NULL, NULL); csync_vio_file_stat_destroy(stat); } END_TEST static Suite *csync_vio_suite(void) { Suite *s = suite_create("csync_vio_file_stat"); create_case(s, "check_csync_vio_file_stat_new", check_csync_vio_file_stat_new); return s; } int main(void) { int nf; Suite *s = csync_vio_suite(); SRunner *sr; sr = srunner_create(s); #if 0 srunner_set_fork_status(sr, CK_NOFORK); #endif srunner_run_all(sr, CK_VERBOSE); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
#include "support.h" #include "vio/csync_vio_file_stat.h" START_TEST (check_csync_vio_file_stat_new) { csync_vio_file_stat_t *tstat = NULL; tstat = csync_vio_file_stat_new(); fail_if(tstat == NULL, NULL); csync_vio_file_stat_destroy(tstat); } END_TEST static Suite *csync_vio_suite(void) { Suite *s = suite_create("csync_vio_file_stat"); create_case(s, "check_csync_vio_file_stat_new", check_csync_vio_file_stat_new); return s; } int main(void) { int nf; Suite *s = csync_vio_suite(); SRunner *sr; sr = srunner_create(s); #if 0 srunner_set_fork_status(sr, CK_NOFORK); #endif srunner_run_all(sr, CK_VERBOSE); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
Fix build warning for shadowed variable.
Fix build warning for shadowed variable.
C
lgpl-2.1
meeh420/csync,gco/csync,meeh420/csync,gco/csync,meeh420/csync,gco/csync,gco/csync
bef527848955070cab42bcc1f42799656e8da0a6
src/hostnet/stubs_utils.c
src/hostnet/stubs_utils.c
#include <caml/mlvalues.h> #include <caml/memory.h> #include <caml/custom.h> #include <caml/callback.h> #include <caml/alloc.h> #include <stdio.h> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <ws2tcpip.h> #else #include <sys/socket.h> #endif CAMLprim value stub_get_SOMAXCONN(){ fprintf(stderr, "SOMAXCONN = %d\n", SOMAXCONN); return (Val_int (SOMAXCONN)); }
#include <caml/mlvalues.h> #include <caml/memory.h> #include <caml/custom.h> #include <caml/callback.h> #include <caml/alloc.h> #include <stdio.h> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <ws2tcpip.h> #else #include <sys/socket.h> #endif CAMLprim value stub_get_SOMAXCONN(value unit){ fprintf(stderr, "SOMAXCONN = %d\n", SOMAXCONN); return (Val_int (SOMAXCONN)); }
Add `value` parameter to SOMAXCONN binding
Add `value` parameter to SOMAXCONN binding Problem spotted by yallop in https://github.com/moby/vpnkit/commit/8d718125a66fbe746ba17ad3e85b7924ac0ed9a4#commitcomment-21930309 Signed-off-by: David Scott <[email protected]>
C
apache-2.0
djs55/vpnkit,djs55/vpnkit,djs55/vpnkit
c03dcdf5e249ac87c917f3b57f2f532be7fa3aa1
iOS/AIBHTMLWebView.h
iOS/AIBHTMLWebView.h
// // AIBHTMLWebView.h // AIBHTMLWebView // // Created by Thomas Parslow on 05/04/2015. // Copyright (c) 2015 Thomas Parslow. MIT License. // #import "RCTView.h" @class RCTEventDispatcher; @interface AIBHTMLWebView : RCTView @property (nonatomic, strong) NSString *HTML; - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; @end
// // AIBHTMLWebView.h // AIBHTMLWebView // // Created by Thomas Parslow on 05/04/2015. // Copyright (c) 2015 Thomas Parslow. MIT License. // #import "RCTView.h" @class RCTEventDispatcher; @interface AIBHTMLWebView : RCTView @property (nonatomic, strong) NSString *HTML; - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; @end
Remove designated initializer compiler warnings
Remove designated initializer compiler warnings
C
mit
almost/react-native-html-webview
aa470966fb84e16c92c210236cc5348a3e4c7bb7
Settings/Controls/Label.h
Settings/Controls/Label.h
#pragma once #include "Control.h" #include "../../3RVX/Logger.h" class Label : public Control { public: Label() { } Label(int id, HWND parent) : Control(id, parent) { } virtual bool Text(std::wstring text) { bool result = Control::Text(text); if (result == false) { return false; } /* Determine the width of the text */ HDC dc = GetDC(_hWnd); SIZE sz = { 0 }; GetTextExtentPoint32(dc, &text[0], text.size(), &sz); /* Update the window size based on the text size */ RECT r = Control::ScreenDimensions(); POINT pt = { r.left, r.top }; ScreenToClient(_parent, &pt); MoveWindow(_hWnd, pt.x, pt.y, sz.cx, sz.cy, TRUE); return true; } };
#pragma once #include "Control.h" #include "../../3RVX/Logger.h" class Label : public Control { public: Label() { } Label(int id, HWND parent) : Control(id, parent) { } virtual bool Text(std::wstring text) { bool result = Control::Text(text); if (result == false) { return false; } Width(TextDimensions().cx); // /* Determine the width of the text */ // HDC dc = GetDC(_hWnd); // SIZE sz = { 0 }; // GetTextExtentPoint32(dc, &text[0], text.size(), &sz); // /* Update the window size based on the text size */ // RECT r = Control::ScreenDimensions(); // POINT pt = { r.left, r.top }; // ScreenToClient(_parent, &pt); // MoveWindow(_hWnd, pt.x, pt.y, sz.cx, sz.cy, TRUE); return true; } };
Test the new width functionality
Test the new width functionality
C
bsd-2-clause
Soulflare3/3RVX,malensek/3RVX,malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX
b4948876ed0bd3cec6a9ac6e74fa9d1b266b6c37
ccnd/include/ccn/keystore.h
ccnd/include/ccn/keystore.h
/* * ccn/keystore.h * * KEYSTORE interface * * This is a veneer so that the ccn code can avoid exposure to the * underlying keystore implementation types */ #ifndef CCN_KEYSTORE_DEFINED #define CCN_KEYSTORE_DEFINED #include <stddef.h> struct ccn_keystore; struct ccn_keystore *ccn_keystore_create(); void ccn_keystore_destroy(struct ccn_keystore **p); int ccn_keystore_init(struct ccn_keystore *p, char *name, char *password); const void *ccn_keystore_private_key(struct ccn_keystore *p); const void *ccn_keystore_public_key(struct ccn_keystore *p); const void *ccn_keystore_certificate(struct ccn_keystore *p); #endif
/* * ccn/keystore.h * * KEYSTORE interface * * This is a veneer so that the ccn code can avoid exposure to the * underlying keystore implementation types */ #ifndef CCN_KEYSTORE_DEFINED #define CCN_KEYSTORE_DEFINED #include <stddef.h> struct ccn_keystore; struct ccn_keystore *ccn_keystore_create(void); void ccn_keystore_destroy(struct ccn_keystore **p); int ccn_keystore_init(struct ccn_keystore *p, char *name, char *password); const void *ccn_keystore_private_key(struct ccn_keystore *p); const void *ccn_keystore_public_key(struct ccn_keystore *p); const void *ccn_keystore_certificate(struct ccn_keystore *p); #endif
Fix missing void in parameterless call prototype
Fix missing void in parameterless call prototype
C
lgpl-2.1
svartika/ccnx,svartika/ccnx,ebollens/ccnmp,svartika/ccnx,cawka/ndnx,svartika/ccnx,ebollens/ccnmp,cawka/ndnx,svartika/ccnx,ebollens/ccnmp,cawka/ndnx,cawka/ndnx,svartika/ccnx,cawka/ndnx,svartika/ccnx,ebollens/ccnmp
d0817bdc0e8416ce62f49dcd63191aac870cc3e0
src/sota_tools/ostree_hash.h
src/sota_tools/ostree_hash.h
#ifndef SOTA_CLIENT_TOOLS_OSTREE_HASH_H_ #define SOTA_CLIENT_TOOLS_OSTREE_HASH_H_ #include <cstdint> #include <cstring> // memcmp, memcpy #include <iostream> #include <string> class OSTreeHash { public: /** * Parse an OSTree hash from a string. This will normally be a root commit. * @throws OSTreeCommitParseError on invalid input * TODO test cases */ static OSTreeHash Parse(const std::string& hash); explicit OSTreeHash(const uint8_t[32]); std::string string() const; bool operator<(const OSTreeHash& other) const; friend std::ostream& operator<<(std::ostream& os, const OSTreeHash& hash); private: uint8_t hash_[32]; }; class OSTreeCommitParseError : std::exception { public: OSTreeCommitParseError(const std::string bad_hash) : bad_hash_(bad_hash) {} virtual const char* what() const noexcept { return "Could not parse OSTree commit"; } std::string bad_hash() const { return bad_hash_; } private: std::string bad_hash_; }; #endif // SOTA_CLIENT_TOOLS_OSTREE_HASH_H_
#ifndef SOTA_CLIENT_TOOLS_OSTREE_HASH_H_ #define SOTA_CLIENT_TOOLS_OSTREE_HASH_H_ #include <cstdint> #include <cstring> // memcmp, memcpy #include <iostream> #include <string> class OSTreeHash { public: /** * Parse an OSTree hash from a string. This will normally be a root commit. * @throws OSTreeCommitParseError on invalid input */ static OSTreeHash Parse(const std::string& hash); explicit OSTreeHash(const uint8_t[32]); std::string string() const; bool operator<(const OSTreeHash& other) const; friend std::ostream& operator<<(std::ostream& os, const OSTreeHash& hash); private: uint8_t hash_[32]; }; class OSTreeCommitParseError : std::exception { public: OSTreeCommitParseError(const std::string bad_hash) : bad_hash_(bad_hash) {} virtual const char* what() const noexcept { return "Could not parse OSTree commit"; } std::string bad_hash() const { return bad_hash_; } private: std::string bad_hash_; }; #endif // SOTA_CLIENT_TOOLS_OSTREE_HASH_H_
Remove TODO test comment about OSTreeHash::Parse
Remove TODO test comment about OSTreeHash::Parse PRO-4592
C
mpl-2.0
advancedtelematic/sota_client_cpp,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/sota_client_cpp
d5b46a21c209a5f05b5bc96b06fa205d9e333ec5
tests/hwloc_insert_misc.c
tests/hwloc_insert_misc.c
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA * Copyright © 2009-2010 Université Bordeaux 1 * See COPYING in top-level directory. */ #include <private/config.h> #include <hwloc.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <assert.h> int main(void) { hwloc_topology_t topology; hwloc_bitmap_t cpuset; hwloc_obj_t obj; hwloc_topology_init(&topology); hwloc_topology_load(topology); hwloc_topology_check(topology); cpuset = hwloc_bitmap_alloc(); hwloc_bitmap_set(cpuset, 0); obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test"); hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2"); hwloc_topology_check(topology); hwloc_topology_destroy(topology); return 0; }
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA * Copyright © 2009-2010 Université Bordeaux 1 * See COPYING in top-level directory. */ #include <private/config.h> #include <hwloc.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <assert.h> int main(void) { hwloc_topology_t topology; hwloc_bitmap_t cpuset; hwloc_obj_t obj; hwloc_topology_init(&topology); hwloc_topology_load(topology); hwloc_topology_check(topology); cpuset = hwloc_bitmap_alloc(); hwloc_bitmap_set(cpuset, 0); obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test"); hwloc_bitmap_free(cpuset); hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2"); hwloc_topology_check(topology); hwloc_topology_destroy(topology); return 0; }
Fix a memory leak in tests
Fix a memory leak in tests This commit was SVN r2903.
C
bsd-3-clause
ggouaillardet/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc
a888bc12a58e8fc2abf53e97c2ff838e68fbe955
cman/qdisk/gettid.c
cman/qdisk/gettid.c
#include <sys/types.h> #include <linux/unistd.h> #include <gettid.h> #include <errno.h> /* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */ #ifdef __NR_gettid pid_t gettid (void) { return syscall(__NR_gettid); } #else #warn "gettid not available -- substituting with pthread_self()" #include <pthread.h> pid_t gettid (void) { return (pid_t)pthread_self(); } #endif
#include <sys/types.h> #include <linux/unistd.h> #include <gettid.h> #include <unistd.h> #include <errno.h> /* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */ #ifdef __NR_gettid pid_t gettid (void) { return syscall(__NR_gettid); } #else #warn "gettid not available -- substituting with pthread_self()" #include <pthread.h> pid_t gettid (void) { return (pid_t)pthread_self(); } #endif
Add include so we get a prototype for syscall()
Add include so we get a prototype for syscall()
C
lgpl-2.1
stevenraspudic/resource-agents,asp24/resource-agents,stevenraspudic/resource-agents,asp24/resource-agents,asp24/resource-agents,stevenraspudic/resource-agents
0cf104dc47a64079e522b9b3025a8371c09402e4
src/python/helpers/python_convert_any.h
src/python/helpers/python_convert_any.h
/*ckwg +5 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H #define VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H #include <boost/any.hpp> #include <Python.h> /** * \file python_convert_any.h * * \brief Helpers for working with boost::any in Python. */ namespace boost { namespace python { namespace converter { struct rvalue_from_python_stage1_data; } } } struct boost_any_to_object { boost_any_to_object(); ~boost_any_to_object(); static void* convertible(PyObject* obj); static PyObject* convert(boost::any const& any); static void construct(PyObject* obj, boost::python::converter::rvalue_from_python_stage1_data* data); }; #endif // VISTK_PYTHON_PIPELINE_PYTHON_CONVERT_ANY_H
/*ckwg +5 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H #define VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H #include <boost/any.hpp> #include <Python.h> /** * \file python_convert_any.h * * \brief Helpers for working with boost::any in Python. */ namespace boost { namespace python { namespace converter { struct rvalue_from_python_stage1_data; } } } class boost_any_to_object { public: boost_any_to_object(); ~boost_any_to_object(); static void* convertible(PyObject* obj); static PyObject* convert(boost::any const& any); static void construct(PyObject* obj, boost::python::converter::rvalue_from_python_stage1_data* data); }; #endif // VISTK_PYTHON_PIPELINE_PYTHON_CONVERT_ANY_H
Use a class instead of a struct
Use a class instead of a struct
C
bsd-3-clause
mathstuf/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,Kitware/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,Kitware/sprokit,mathstuf/sprokit,Kitware/sprokit,linus-sherrill/sprokit,Kitware/sprokit
53b94d9190d66c1fbf910fd65d9d3a4dfef3a238
shims/graphics.h
shims/graphics.h
/* BLACK color, which I presume was defined in graphics.h */ #define BLACK 0
/* BLACK color, which I presume was defined in the original graphics.h */ #define BLACK 0 /* All my original cpp files create constant ints named true and false. This worked with the Borland C++ compiler, but not gcc. I'll redefine them with a preprocessor macro to be a non-reserved name, but first I need to include all the system libraries because they may refer to the actual true/false variables. */ #include <alloc.h> #include <assert.h> #include <conio.h> #include <ctype.h> #include <dos.h> #include <fstream.h> #include <stdlib.h> #include <time.h> /* Now redefine true/false with non-reserved names */ #define true local_true #define false local_false
Handle reserved true/false variable names
Handle reserved true/false variable names
C
mit
sortelli/tankbeta,sortelli/tankbeta,sortelli/tankbeta,sortelli/tankbeta
4f76d799edab526b1de4ac24b61c909336b86bb9
gba/devkitarm/source/main.c
gba/devkitarm/source/main.c
// GBT Player v3.0.9 // // SPDX-License-Identifier: MIT // // Copyright (c) 2022, Antonio Niño Díaz <[email protected]> #include <gba.h> #include <stdio.h> #include "gbt_player.h" extern const uint8_t *template_data[]; int main(int argc, char *argv[]) { irqInit(); irqEnable(IRQ_VBLANK); consoleDemoInit(); iprintf("GBT Player v3.0.9"); gbt_play(template_data, 5); while (1) { VBlankIntrWait(); gbt_update(); } }
// GBT Player v3.0.9 // // SPDX-License-Identifier: MIT // // Copyright (c) 2022, Antonio Niño Díaz <[email protected]> #include <gba.h> #include "gbt_player.h" extern const uint8_t *template_data[]; int main(int argc, char *argv[]) { irqInit(); irqEnable(IRQ_VBLANK); gbt_play(template_data, 5); while (1) { VBlankIntrWait(); gbt_update(); } }
Stop using console in demo ROM
gba: Stop using console in demo ROM This makes it easier to analyse the elf map file to look for changes after modifications to GBT Player.
C
mit
AntonioND/gbt-player,AntonioND/gbt-player,AntonioND/gbt-player
b8b83dbd95aa051017ef442b311e3867cf71bf77
src/ifdwrapper.h
src/ifdwrapper.h
/* * This wraps the dynamic ifdhandler functions. The abstraction will * eventually allow multiple card slots in the same terminal. * * MUSCLE SmartCard Development ( http://www.linuxnet.com ) * * Copyright (C) 1999 * David Corcoran <[email protected]> * * $Id$ */ #ifndef __ifdwrapper_h__ #define __ifdwrapper_h__ #ifdef __cplusplus extern "C" { #endif LONG IFDOpenIFD(PREADER_CONTEXT, DWORD); LONG IFDCloseIFD(PREADER_CONTEXT); LONG IFDPowerICC(PREADER_CONTEXT, DWORD, PUCHAR, PDWORD); LONG IFDStatusICC(PREADER_CONTEXT, PDWORD, PDWORD, PUCHAR, PDWORD); LONG IFDControl(PREADER_CONTEXT, PUCHAR, DWORD, PUCHAR, PDWORD); LONG IFDTransmit(PREADER_CONTEXT, SCARD_IO_HEADER, PUCHAR, DWORD, PUCHAR, PDWORD, PSCARD_IO_HEADER); LONG IFDSetPTS(PREADER_CONTEXT, DWORD, UCHAR, UCHAR, UCHAR, UCHAR); LONG IFDSetCapabilities(PREADER_CONTEXT, DWORD, DWORD, PUCHAR); LONG IFDGetCapabilities(PREADER_CONTEXT, DWORD, PDWORD, PUCHAR); #ifdef __cplusplus } #endif #endif /* __ifdwrapper_h__ */
/* * This wraps the dynamic ifdhandler functions. The abstraction will * eventually allow multiple card slots in the same terminal. * * MUSCLE SmartCard Development ( http://www.linuxnet.com ) * * Copyright (C) 1999 * David Corcoran <[email protected]> * * $Id$ */ #ifndef __ifdwrapper_h__ #define __ifdwrapper_h__ #ifdef __cplusplus extern "C" { #endif LONG IFDOpenIFD(PREADER_CONTEXT); LONG IFDCloseIFD(PREADER_CONTEXT); LONG IFDPowerICC(PREADER_CONTEXT, DWORD, PUCHAR, PDWORD); LONG IFDStatusICC(PREADER_CONTEXT, PDWORD, PDWORD, PUCHAR, PDWORD); LONG IFDControl(PREADER_CONTEXT, PUCHAR, DWORD, PUCHAR, PDWORD); LONG IFDTransmit(PREADER_CONTEXT, SCARD_IO_HEADER, PUCHAR, DWORD, PUCHAR, PDWORD, PSCARD_IO_HEADER); LONG IFDSetPTS(PREADER_CONTEXT, DWORD, UCHAR, UCHAR, UCHAR, UCHAR); LONG IFDSetCapabilities(PREADER_CONTEXT, DWORD, DWORD, PUCHAR); LONG IFDGetCapabilities(PREADER_CONTEXT, DWORD, PDWORD, PUCHAR); #ifdef __cplusplus } #endif #endif /* __ifdwrapper_h__ */
Modify the prototype of IFDOpenIFD.
Modify the prototype of IFDOpenIFD. git-svn-id: f2d781e409b7e36a714fc884bb9b2fc5091ddd28@603 0ce88b0d-b2fd-0310-8134-9614164e65ea
C
bsd-3-clause
vicamo/pcsc-lite-android,vicamo/pcsc-lite-android,vicamo/pcsc-lite-android,vicamo/pcsc-lite-android,vicamo/pcsc-lite-android
87004dbc4eab7de47be325ac4211d2ce0c43e938
src/imap/cmd-close.c
src/imap/cmd-close.c
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); else if (mailbox_sync(mailbox, 0, 0, NULL) < 0) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
Synchronize the mailbox after expunging messages to actually get them expunged.
CLOSE: Synchronize the mailbox after expunging messages to actually get them expunged. --HG-- branch : HEAD
C
mit
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
e2aa329f967e3ceb9e789dbc8cf636d5fb373a3b
src/cpu/cpu.c
src/cpu/cpu.c
#define _GNU_SOURCE #include <stdio.h> #include <sched.h> #include <errno.h> #include <stdint.h> #include <sys/resource.h> #include "cpu.h" #include "../util/taskstats.h" #include "../util/file_utils.h" int current_cpus(int pid) { cpu_set_t proc_cpus; size_t mask_size = sizeof proc_cpus; int ret = sched_getaffinity(pid, mask_size, &proc_cpus); if (ret == -1) return errno; int cpu_affinity = CPU_COUNT(&proc_cpus); return cpu_affinity; } int nice(int pid) { return getpriority(PRIO_PROCESS, pid); } uint64_t get_process_ctxt_switches(int pid) { return task_req(pid, 's'); }
#define _GNU_SOURCE #include <stdio.h> #include <sched.h> #include <errno.h> #include <stdint.h> #include <sys/resource.h> #include "cpu.h" #include "../util/taskstats.h" #include "../util/file_utils.h" int current_cpus(int pid) { cpu_set_t proc_cpus; size_t mask_size = sizeof proc_cpus; int ret = sched_getaffinity(pid, mask_size, &proc_cpus); if (ret == -1) return errno; int cpu_affinity = CPU_COUNT(&proc_cpus); return cpu_affinity; } int nice(int pid) { return getpriority(PRIO_PROCESS, pid); } uint64_t get_process_ctxt_switches(int pid) { return task_req(pid, 's'); } char *get_user_ps_ctxt_switches(char *pid) { char path[MAXPATH]; snprintf(path, MAXPATH, STATUS, pid); return parse_proc(path, SWITCHES); }
Use parse_proc for context switches if lower perms
Use parse_proc for context switches if lower perms
C
mit
tijko/dashboard
0e9372ac7a77505d62deb9a09c700b67b083b09a
include/SafeQueue.h
include/SafeQueue.h
#pragma once #include <mutex> #include <queue> // Thread safe implementation of a Queue using a std::queue template <typename T> class SafeQueue { private: std::queue<T> m_queue; std::mutex m_mutex; public: SafeQueue() { } SafeQueue(SafeQueue& other) { //TODO: } ~SafeQueue() { } bool empty() { std::unique_lock<std::mutex> lock(m_mutex); return m_queue.empty(); } int size() { std::unique_lock<std::mutex> lock(m_mutex); return m_queue.size(); } void enqueue(T& t) { std::unique_lock<std::mutex> lock(m_mutex); m_queue.push(t); } bool dequeue(T& t) { std::unique_lock<std::mutex> lock(m_mutex); if (m_queue.empty()) { return false; } t = std::move(m_queue.front()); m_queue.pop(); } };
#pragma once #include <mutex> #include <queue> // Thread safe implementation of a Queue using a std::queue template <typename T> class SafeQueue { private: std::queue<T> m_queue; std::mutex m_mutex; public: SafeQueue() { } SafeQueue(SafeQueue& other) { //TODO: } ~SafeQueue() { } bool empty() { std::unique_lock<std::mutex> lock(m_mutex); return m_queue.empty(); } int size() { std::unique_lock<std::mutex> lock(m_mutex); return m_queue.size(); } void enqueue(T& t) { std::unique_lock<std::mutex> lock(m_mutex); m_queue.push(t); } bool dequeue(T& t) { std::unique_lock<std::mutex> lock(m_mutex); if (m_queue.empty()) { return false; } t = std::move(m_queue.front()); m_queue.pop(); return true; } };
Fix bug in dequeue that caused to return always false
Fix bug in dequeue that caused to return always false
C
mit
mtrebi/thread-pool
83760d3323bb88e46761382cb17f0ea3e62ebc63
quic/core/crypto/server_proof_verifier.h
quic/core/crypto/server_proof_verifier.h
// Copyright (c) 2020 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 QUICHE_QUIC_CORE_CRYPTO_SERVER_PROOF_VERIFIER_H_ #define QUICHE_QUIC_CORE_CRYPTO_SERVER_PROOF_VERIFIER_H_ #include <memory> #include <string> #include <vector> #include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h" #include "net/third_party/quiche/src/quic/core/quic_types.h" namespace quic { // A ServerProofVerifier checks the certificate chain presented by a client. class QUIC_EXPORT_PRIVATE ServerProofVerifier { public: virtual ~ServerProofVerifier() {} // VerifyCertChain checks that |certs| is a valid chain. On success, it // returns QUIC_SUCCESS. On failure, it returns QUIC_FAILURE and sets // |*error_details| to a description of the problem. In either case it may set // |*details|, which the caller takes ownership of. // // |context| specifies an implementation specific struct (which may be nullptr // for some implementations) that provides useful information for the // verifier, e.g. logging handles. // // This function may also return QUIC_PENDING, in which case the // ServerProofVerifier will call back, on the original thread, via |callback| // when complete. In this case, the ServerProofVerifier will take ownership of // |callback|. virtual QuicAsyncStatus VerifyCertChain( const std::vector<std::string>& certs, std::string* error_details, std::unique_ptr<ProofVerifierCallback> callback) = 0; }; } // namespace quic #endif // QUICHE_QUIC_CORE_CRYPTO_SERVER_PROOF_VERIFIER_H_
Add a ServerProofVerifier interface to QUIC.
Add a ServerProofVerifier interface to QUIC. This is a server-side equivalent of ProofVerifier. It is used to verify a client's certificate chain. It will only be used when the server needs to request client certificates. ServerProofVerifier drops the VerifyProof() function (not used in TLS 1.3) and the |hostname|, |ocsp_response|, and |cert_sct| parameters of VerifyCertChain() (those aren't really meaningful to a server). See go/quic-tls-client-certificates for the full design doc and context. gfe-relnote: no functional changes (only adds an interface). PiperOrigin-RevId: 291429810 Change-Id: Ifd7deb6e72294b2626572b6555e3b5e2976b286e
C
bsd-3-clause
google/quiche,google/quiche,google/quiche,google/quiche
de10afff330e862d976436c702ce77165888a1f2
gdk-pixbuf/gdk-pixbuf.h
gdk-pixbuf/gdk-pixbuf.h
#ifndef _GDK_PIXBUF_H_ #define _GDK_PIXBUF_H_ #include <libart_lgpl/art_misc.h> #include <libart_lgpl/art_pixbuf.h> typedef struct { int ref_count; ArtPixBuf *art_pixbuf; void (*unref_func)(void *gdkpixbuf); } GdkPixBuf; GdkPixBuf *gdk_pixbuf_load_image (const char *file); void gdk_pixbuf_save_image (const char *format_id, const char *file, ...); void gdk_pixbuf_ref (GdkPixBuf *pixbuf); void gdk_pixbuf_unref (GdkPixBuf *pixbuf); GdkPixBuf *gdk_pixbuf_duplicate (GdkPixBuf *pixbuf); GdkPixBuf *gdk_pixbuf_scale (GdkPixBuf *pixbuf, gint w, gint h); GdkPixBuf *gdk_pixbuf_rotate (GdkPixBuf *pixbuf, gdouble angle); void gdk_pixbuf_destroy (GdkPixBuf *pixbuf); #endif /* _GDK_PIXBUF_H_ */
#ifndef _GDK_PIXBUF_H_ #define _GDK_PIXBUF_H_ #include <libart_lgpl/art_misc.h> #include <libart_lgpl/art_pixbuf.h> #include <glib.h> typedef struct { int ref_count; ArtPixBuf *art_pixbuf; void (*unref_func)(void *gdkpixbuf); } GdkPixBuf; GdkPixBuf *gdk_pixbuf_load_image (const char *file); void gdk_pixbuf_save_image (const char *format_id, const char *file, ...); void gdk_pixbuf_ref (GdkPixBuf *pixbuf); void gdk_pixbuf_unref (GdkPixBuf *pixbuf); GdkPixBuf *gdk_pixbuf_duplicate (GdkPixBuf *pixbuf); GdkPixBuf *gdk_pixbuf_scale (GdkPixBuf *pixbuf, gint w, gint h); GdkPixBuf *gdk_pixbuf_rotate (GdkPixBuf *pixbuf, gdouble angle); void gdk_pixbuf_destroy (GdkPixBuf *pixbuf); #endif /* _GDK_PIXBUF_H_ */
Include glib.h as it uses g* datatypes Added for gnome-config
Include glib.h as it uses g* datatypes Added for gnome-config 1999-07-23 Richard Hestilow <[email protected]> * src/gdk-pixbuf.h: Include glib.h as it uses g* datatypes * gdk_pixbufConf.sh.in: Added for gnome-config * Makefile.am: * configure.in: Modified to generate gdk_pixbufConf.sh
C
lgpl-2.1
GNOME/gdk-pixbuf,GNOME/gdk-pixbuf,YueLinHo/MB3Gdk-pixbuf,YueLinHo/MB3Gdk-pixbuf,Distrotech/gdk-pixbuf,YueLinHo/MB3Gdk-pixbuf,Distrotech/gdk-pixbuf,Distrotech/gdk-pixbuf,GNOME/gdk-pixbuf,GNOME/gdk-pixbuf,djdeath/gdk-pixbuf,YueLinHo/MB3Gdk-pixbuf,YueLinHo/MB3Gdk-pixbuf,Distrotech/gdk-pixbuf,djdeath/gdk-pixbuf,Distrotech/gdk-pixbuf,djdeath/gdk-pixbuf,djdeath/gdk-pixbuf
0ef3023b55fd36cace3db6e95dfa650485e54569
src/OrbitBase/include/OrbitBase/Result.h
src/OrbitBase/include/OrbitBase/Result.h
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ORBIT_BASE_RESULT_H_ #define ORBIT_BASE_RESULT_H_ #include <string> #include <type_traits> #include "outcome.hpp" class ErrorMessage final { public: ErrorMessage() = default; explicit ErrorMessage(std::string message) : message_(std::move(message)) {} [[nodiscard]] const std::string& message() const { return message_; } private: std::string message_; }; template <typename T, typename E> using Result = outcome::result<T, E, outcome::policy::terminate>; template <typename T> class ErrorMessageOr : public Result<T, ErrorMessage> { public: using Result<T, ErrorMessage>::Result; operator bool() = delete; operator bool() const = delete; }; template <typename T> struct IsErrorMessageOr : std::false_type {}; template <typename T> struct IsErrorMessageOr<ErrorMessageOr<T>> : std::true_type {}; #endif // ORBIT_BASE_RESULT_H_
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ORBIT_BASE_RESULT_H_ #define ORBIT_BASE_RESULT_H_ #include <string> #include <type_traits> #include "outcome.hpp" class [[nodiscard]] ErrorMessage final { public: ErrorMessage() = default; explicit ErrorMessage(std::string message) : message_(std::move(message)) {} [[nodiscard]] const std::string& message() const { return message_; } private: std::string message_; }; template <typename T, typename E> using Result = outcome::result<T, E, outcome::policy::terminate>; template <typename T> class [[nodiscard]] ErrorMessageOr : public Result<T, ErrorMessage> { public: using Result<T, ErrorMessage>::Result; operator bool() = delete; operator bool() const = delete; }; template <typename T> struct IsErrorMessageOr : std::false_type {}; template <typename T> struct IsErrorMessageOr<ErrorMessageOr<T>> : std::true_type {}; #endif // ORBIT_BASE_RESULT_H_
Add nodiscard to ErrorMessage and ErrorMessageOr
Add nodiscard to ErrorMessage and ErrorMessageOr Test: builds
C
bsd-2-clause
google/orbit,google/orbit,google/orbit,google/orbit
70917f5a1ab1b56e80daf1f2056d73ccb925c19e
src/hello.c
src/hello.c
/* * Challenger 1P Hello World Program for cc65. */ #include <conio.h> int main(void) { static const char hello_world[] = "Hello world!\r\ncc65 for Challenger 1P"; unsigned int i; clrscr(); gotoxy(0, 0); cputs(hello_world); gotoxy(0, 4); for (i = 0; i < 256; i += 1) { if (i != '\n' && i != '\r') { cputc((unsigned char ) i); } } cputsxy(0, 14, "cputsxy\r\n"); cprintf("cprintf '%s' %d %d\r\n", "string", (int) wherex(), (int) wherey()); cputs("now type something:\r\n"); while (1) { char c = cgetc(); cputc(c); } return 0; }
/* * Challenger 1P Hello World Program for cc65. */ #include <conio.h> int main(void) { static const char hello_world[] = "Hello world!\r\ncc65 for Challenger 1P"; unsigned int i; clrscr(); /* TODO this should be implicitly done in clrscr() */ gotoxy(0, 0); cputs(hello_world); gotoxy(0, 4); for (i = 0; i < 0x20; i += 1) { if (i != '\n' && i != '\r') { cputc((unsigned char ) i); } } cputsxy(0, 8, "cputsxy\r\n"); cprintf("cprintf '%s' %d %d\r\n", "string", (int) wherex(), (int) wherey()); cputs("now type something (vi keys for positioning, " "'A' cursor on, 'B' cursor off):\r\n"); /* cursor on */ cursor(1); while (1) { unsigned char const xpos = wherex(); unsigned char const ypos = wherey(); char const c = cgetc(); /* Test cursor on/off and cursor positioning */ switch (c) { case 'A': cursor(1); break; case 'B': cursor(0); break; case 'H': if (xpos > 0) { gotox(xpos - 1); } break; case 'L': if (xpos < 24) { gotox(xpos + 1); } break; case 'K': if (ypos > 0) { gotoy(ypos - 1); } break; case 'J': if (ypos < 24) { gotoy(ypos + 1); } break; default: cputc(c); break; } } return 0; }
Test new cursor functionality now implemented in the c1p runtime library.
Test new cursor functionality now implemented in the c1p runtime library.
C
mit
smuehlst/c1pctest,smuehlst/c1pctest
cc49d646230696b642a1d94a372c38bd3105c25d
include/TextureHandle.h
include/TextureHandle.h
/*! \file TextureHandle.h * \author Jared Hoberock * \brief Defines the interface to an opaque * pointer type for Textures. */ #pragma once #include <string> typedef unsigned int TextureHandle; struct TextureParameter { inline TextureParameter(void) :mHandle(0),mAlias(""){} inline TextureParameter(const std::string &alias) :mHandle(0),mAlias(alias){} inline TextureParameter(const TextureHandle &h) :mHandle(h),mAlias(""){} operator TextureHandle (void) const {return mHandle;} TextureHandle mHandle; // filename or other alias for a Texture to use during shading // if this is not '' during preprocess, the texture referred to // by this alias will be loaded and bound std::string mAlias; }; // end TextureParameter
/*! \file TextureHandle.h * \author Jared Hoberock * \brief Defines the interface to an opaque * pointer type for Textures. */ #pragma once #include <string> typedef unsigned int TextureHandle; struct TextureParameter { inline TextureParameter(void) :mHandle(0),mAlias(""){} inline TextureParameter(const std::string &alias) :mHandle(0),mAlias(alias){} inline TextureParameter(const TextureHandle &h) :mHandle(h),mAlias(""){} inline operator TextureHandle (void) const {return mHandle;} TextureHandle mHandle; // filename or other alias for a Texture to use during shading // if this is not '' during preprocess, the texture referred to // by this alias will be loaded and bound std::string mAlias; }; // end TextureParameter
Make the cast operator inline for use with CUDA
Make the cast operator inline for use with CUDA git-svn-id: eeeef91d721e48f02083ec31b1220ddf564a51e4@1671 3bb10773-34f4-0310-b88c-ec9d511ba0d9
C
apache-2.0
jaredhoberock/gotham,jaredhoberock/gotham,jaredhoberock/gotham,jaredhoberock/gotham,jaredhoberock/gotham
32a03501ea2030314b9b610ea0181f1f60bce11e
src/a_samp.c
src/a_samp.c
/* Copyright (C) 2011-2012 Zeex * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <sampgdk/config.h> #include <sampgdk/a_samp.h> #include <sampgdk/export.h> #include "fakeamx.h" #include "native.h" #include "timer.h" #include "generated/a_samp-impl.c" SAMPGDK_NATIVE(int, SetTimer(int interval, bool repeat, TimerCallback callback, void *param)) { int timerid; if (timer_set(&timerid, interval, repeat, (timer_callback)callback, param) >= 0) { return timerid; } return -1; } SAMPGDK_NATIVE(bool, KillTimer(int timerid)) { return timer_kill(timerid) >= 0; }
/* Copyright (C) 2011-2012 Zeex * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <sampgdk/config.h> #include <sampgdk/a_samp.h> #include <sampgdk/export.h> #include "fakeamx.h" #include "native.h" #include "timer.h" #include "generated/a_samp-impl.c" SAMPGDK_NATIVE(int, SetTimer(int interval, bool repeat, TimerCallback callback, void *param)) { int timerid; if (timer_set(&timerid, interval, repeat, (timer_callback)callback, param) >= 0) { return timerid + 1; } return 0; } SAMPGDK_NATIVE(bool, KillTimer(int timerid)) { return timer_kill(timerid - 1) >= 0; }
Make timer ID's start with 1
Make timer ID's start with 1
C
apache-2.0
Zeex/sampgdk,WopsS/sampgdk,Zeex/sampgdk,WopsS/sampgdk,WopsS/sampgdk,Zeex/sampgdk
3073b5fabe5af86afa9bae6e644f6cc515e6c438
src/animator/SkDump.h
src/animator/SkDump.h
/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkDump_DEFINED #define SkDump_DEFINED #include "SkDisplayable.h" #include "SkMemberInfo.h" class SkAnimateMaker; class SkString; class SkDump : public SkDisplayable { DECLARE_MEMBER_INFO(Dump); #ifdef SK_DUMP_ENABLED SkDump(); bool enable(SkAnimateMaker & ) override; bool evaluate(SkAnimateMaker &); bool hasEnable() const override; static void GetEnumString(SkDisplayTypes , int index, SkString* result); SkBool displayList; SkBool eventList; SkBool events; SkString name; SkBool groups; SkBool posts; SkString script; #else virtual bool enable(SkAnimateMaker & ); virtual bool hasEnable() const; virtual bool setProperty(int index, SkScriptValue& ); #endif }; #endif // SkDump_DEFINED
/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkDump_DEFINED #define SkDump_DEFINED #include "SkDisplayable.h" #include "SkMemberInfo.h" class SkAnimateMaker; class SkString; class SkDump : public SkDisplayable { DECLARE_MEMBER_INFO(Dump); #ifdef SK_DUMP_ENABLED SkDump(); bool enable(SkAnimateMaker & ) override; bool evaluate(SkAnimateMaker &); bool hasEnable() const override; static void GetEnumString(SkDisplayTypes , int index, SkString* result); SkBool displayList; SkBool eventList; SkBool events; SkString name; SkBool groups; SkBool posts; SkString script; #else bool enable(SkAnimateMaker & ) override; bool hasEnable() const override; bool setProperty(int index, SkScriptValue& ) override; #endif }; #endif // SkDump_DEFINED
Fix a stray -Winconsistent-missing-override warning.
Fix a stray -Winconsistent-missing-override warning. TBR= BUG=skia: Review URL: https://codereview.chromium.org/1261043002
C
bsd-3-clause
vanish87/skia,ominux/skia,todotodoo/skia,noselhq/skia,Hikari-no-Tenshi/android_external_skia,nvoron23/skia,tmpvar/skia.cc,qrealka/skia-hc,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,tmpvar/skia.cc,HalCanary/skia-hc,ominux/skia,nvoron23/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,vanish87/skia,vanish87/skia,rubenvb/skia,google/skia,tmpvar/skia.cc,todotodoo/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,todotodoo/skia,nvoron23/skia,ominux/skia,noselhq/skia,todotodoo/skia,google/skia,shahrzadmn/skia,shahrzadmn/skia,tmpvar/skia.cc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,shahrzadmn/skia,HalCanary/skia-hc,tmpvar/skia.cc,tmpvar/skia.cc,shahrzadmn/skia,aosp-mirror/platform_external_skia,shahrzadmn/skia,rubenvb/skia,qrealka/skia-hc,shahrzadmn/skia,ominux/skia,HalCanary/skia-hc,todotodoo/skia,vanish87/skia,google/skia,ominux/skia,ominux/skia,google/skia,aosp-mirror/platform_external_skia,noselhq/skia,qrealka/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,qrealka/skia-hc,nvoron23/skia,rubenvb/skia,tmpvar/skia.cc,nvoron23/skia,ominux/skia,todotodoo/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,noselhq/skia,qrealka/skia-hc,HalCanary/skia-hc,rubenvb/skia,nvoron23/skia,todotodoo/skia,qrealka/skia-hc,nvoron23/skia,shahrzadmn/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,ominux/skia,HalCanary/skia-hc,todotodoo/skia,nvoron23/skia,noselhq/skia,google/skia,ominux/skia,tmpvar/skia.cc,google/skia,vanish87/skia,rubenvb/skia,aosp-mirror/platform_external_skia,vanish87/skia,shahrzadmn/skia,google/skia,tmpvar/skia.cc,aosp-mirror/platform_external_skia,noselhq/skia,vanish87/skia,qrealka/skia-hc,nvoron23/skia,shahrzadmn/skia,google/skia,noselhq/skia,aosp-mirror/platform_external_skia,noselhq/skia,Hikari-no-Tenshi/android_external_skia,google/skia,google/skia,vanish87/skia,qrealka/skia-hc,noselhq/skia,vanish87/skia,aosp-mirror/platform_external_skia,todotodoo/skia
0bf4ae3f34ae754e770c7a46bb81a70c855c2795
include/msvc_hacks.h
include/msvc_hacks.h
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // // Copyright (C) 2012-2016, Ryan P. Wilson // // Authority FX, Inc. // www.authorityfx.com #ifndef AFX_MSVC_HACKS_H_ #define AFX_MSVC_HACKS_H_ // MSVC10 does not have C99 support. fmin and fmax functions are not available #ifdef _WIN32 float fminf(float a, float b) { return std::min(a, b); } float fmaxf(float a, float b) { return std::max(a, b); } #endif #endif // AFX_MSVC_HACKS_H_
Add file for msvc compile
Add file for msvc compile
C
mpl-2.0
AuthorityFX/afx-nuke-plugins,AuthorityFX/afx-nuke-plugins
e45e60c78fbffded0fb138ee7d60832132d53342
src/scanner/scanner.h
src/scanner/scanner.h
#ifndef OCELOT2_SCANNER_H #define OCELOT2_SCANNER_H void get_symbol(); #endif // OCELOT2_SCANNER_H
#ifndef OCELOT2_SCANNER_H #define OCELOT2_SCANNER_H /** * Tokens */ int T_EOF; int current_symbol; void scanner_init(); void scanner_token_init(); void scanner_get_symbol(); #endif // OCELOT2_SCANNER_H
Add first token, current_symbol and function prototypes
Add first token, current_symbol and function prototypes
C
mit
danielkocher/ocelot2
5bfca9b16992084c279022c1086e555476131987
src/debug.h
src/debug.h
#ifndef __DEBUG_H #define __DEBUG_H #ifdef DEBUG extern bool debug; extern bool debug_z; #define DBG if (debug) #define MSG(x) DBG msg x #define PRECONDITION(x) if (x); else precondition( #x , __FILE__, __LINE__) #else #define DBG if (0) #define MSG(x) #define PRECONDITION(x) // nothing #endif #endif
#ifndef __DEBUG_H #define __DEBUG_H #ifdef DEBUG extern bool debug; extern bool debug_z; #define DBG if (debug) #define MSG(x) DBG msg x #else #define DBG if (0) #define MSG(x) #endif #if defined(DEBUG) || defined(PRECON) #define PRECONDITION(x) if (x); else precondition( #x , __FILE__, __LINE__) #else #define PRECONDITION(x) // nothing #endif #endif
Make PRECONDITION usable in isolation by compile time define PRECON.
Make PRECONDITION usable in isolation by compile time define PRECON.
C
lgpl-2.1
dicej/icewm,dicej/icewm,dicej/icewm,dicej/icewm
6dad07a76fce27591b93f1a9d39b86abe19efb0c
src/marks.c
src/marks.c
#include <stdio.h> #include <stdlib.h> #define MARK_SIZE 8 int read_marks(float marks[]) { char mark[MARK_SIZE]; int c = 0; for (int i = 0; i < 4; i++) { c += 1; printf("mark[%d]: ", i+1); fgets(mark, sizeof(mark), stdin); marks[i] = strtol(mark, NULL, 0); } return c; } float calculate_average(float marks[], int size) { float sum = 0; for (int i = 0; i < 4; i++) sum += marks[i]; return sum / size; }
#include <stdio.h> #include <stdlib.h> #define MARK_SIZE 8 int read_marks(float marks[]) { char mark[MARK_SIZE]; int c = 0; for (int i = 0; i < 4; i++) { c += 1; printf("mark[%d]: ", i+1); fgets(mark, sizeof(mark), stdin); marks[i] = strtol(mark, NULL, 0); } return c; } float calculate_average(float marks[], int size) { float sum = 0; for (int i = 0; i < size; i++) sum += marks[i]; return sum / size; }
Use the size of the array passed in
Use the size of the array passed in * It'll work for any size array
C
mit
azbshiri/student
992ed68ed65b99fd76213cb355404f9a18e26da1
src/mesa/main/api_loopback.h
src/mesa/main/api_loopback.h
/* * Mesa 3-D graphics library * Version: 3.5 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * 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 * BRIAN PAUL 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 API_LOOPBACK_H #define API_LOOPBACK_H #include "main/compiler.h" #include "main/mfeatures.h" struct _glapi_table; extern void _mesa_loopback_init_api_table(const struct gl_context *ctx, struct _glapi_table *dest); #endif /* API_LOOPBACK_H */
/* * Mesa 3-D graphics library * Version: 3.5 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * 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 * BRIAN PAUL 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 API_LOOPBACK_H #define API_LOOPBACK_H #include "main/compiler.h" #include "main/mfeatures.h" struct _glapi_table; struct gl_context; extern void _mesa_loopback_init_api_table(const struct gl_context *ctx, struct _glapi_table *dest); #endif /* API_LOOPBACK_H */
Fix warning ('struct gl_context' declared inside parameter list).
main: Fix warning ('struct gl_context' declared inside parameter list). This eliminates a warning in GCC 4.7.1. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
C
mit
metora/MesaGLSLCompiler,mapbox/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,djreep81/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer
cf20031f60f3a242f0cf4e0a42e115762e2948e4
test/FrontendC/2009-07-15-pad-wchar_t-array.c
test/FrontendC/2009-07-15-pad-wchar_t-array.c
// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null typedef int __darwin_wchar_t; typedef __darwin_wchar_t wchar_t; typedef signed short SQLSMALLINT; typedef SQLSMALLINT SQLRETURN; typedef enum { en_sqlstat_total } sqlerrmsg_t; SQLRETURN _iodbcdm_sqlerror( ) { wchar_t _sqlState[6] = { L"\0" }; }
// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null #include <stddef.h> signed short _iodbcdm_sqlerror( ) { wchar_t _sqlState[6] = { L"\0" }; }
Fix test so it works on systems where wchar_t != int.
Fix test so it works on systems where wchar_t != int. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@75827 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm
394a095665a5ac4f465d194b46da6bf77a340958
ReQL.h
ReQL.h
/** * @author Adam Grandquist */ #include "ReQL-ast.h" #ifndef _REQL_H #define _REQL_H struct _ReQL_Conn_s { int socket; int error; char *buf; }; typedef struct _ReQL_Conn_s _ReQL_Conn_t; struct _ReQL_Cur_s { }; typedef struct _ReQL_Cur_s _ReQL_Cur_t; int _reql_connect(_ReQL_Conn_t *conn, unsigned char host_len, char *host, unsigned char port); int _reql_close_conn(_ReQL_Conn_t *conn); _ReQL_Cur_t *_reql_run(_ReQL_Op_t *query, _ReQL_Conn_t *conn, _ReQL_Op_t *kwargs); void _reql_next(_ReQL_Cur_t *cur); void _reql_close_cur(_ReQL_Cur_t *cur); #endif
/** * @author Adam Grandquist */ #include "ReQL-ast.h" #ifndef _REQL_H #define _REQL_H struct _ReQL_Conn_s { int socket; int error; char *buf; unsigned int max_token; struct _ReQL_Cur_s **cursor; }; typedef struct _ReQL_Conn_s _ReQL_Conn_t; struct _ReQL_Cur_s { }; typedef struct _ReQL_Cur_s _ReQL_Cur_t; int _reql_connect(_ReQL_Conn_t *conn, unsigned char host_len, char *host, unsigned char port); int _reql_close_conn(_ReQL_Conn_t *conn); _ReQL_Cur_t *_reql_run(_ReQL_Op_t *query, _ReQL_Conn_t *conn, _ReQL_Op_t *kwargs); void _reql_next(_ReQL_Cur_t *cur); void _reql_close_cur(_ReQL_Cur_t *cur); #endif
Add token counter and cursor array to connections.
Add token counter and cursor array to connections.
C
apache-2.0
grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core
88877290116f8da110404ff96a3df8f508bc60a2
src/calculator/fourier/fourier_transform_fftw.h
src/calculator/fourier/fourier_transform_fftw.h
#ifndef BART_SRC_CALCULATOR_FOURIER_FOURIER_TRANSFORM_FFTW_H_ #define BART_SRC_CALCULATOR_FOURIER_FOURIER_TRANSFORM_FFTW_H_ #include "calculator/fourier/fourier_transform_i.h" namespace bart { namespace calculator { namespace fourier { class FourierTransformFFTW : public FourierTransformI { public: FourierTransformFFTW(const int n_samples) : n_samples_(n_samples) {}; int n_samples() const { return n_samples_; } private: const int n_samples_{0}; }; } // namespace fourier } // namespace calculator } // namespace bart #endif //BART_SRC_CALCULATOR_FOURIER_FOURIER_TRANSFORM_FFTW_H_
#ifndef BART_SRC_CALCULATOR_FOURIER_FOURIER_TRANSFORM_FFTW_H_ #define BART_SRC_CALCULATOR_FOURIER_FOURIER_TRANSFORM_FFTW_H_ #include "calculator/fourier/fourier_transform_i.h" namespace bart { namespace calculator { namespace fourier { class FourierTransformFFTW : public FourierTransformI { public: FourierTransformFFTW(const int n_samples); int n_samples() const { return n_samples_; } private: const int n_samples_; }; } // namespace fourier } // namespace calculator } // namespace bart #endif //BART_SRC_CALCULATOR_FOURIER_FOURIER_TRANSFORM_FFTW_H_
Put constructor for FourierTransformFFTW in cc file.
Put constructor for FourierTransformFFTW in cc file.
C
mit
jsrehak/BART,jsrehak/BART
b1e795e9014c091b2dc9d997b8a292afe9780597
libcpu/timings.h
libcpu/timings.h
#ifndef __libcpu_timings_h #define __libcpu_timings_h #ifdef __MACH__ #include <mach/mach_time.h> #define abs_time() mach_absolute_time() #endif #ifdef sun #include <sys/time.h> #define abs_time() gethrtime() #endif #ifdef linux #warning High precission timing currently n/a on Linux // HACK #define abs_time() 0 #endif #endif /* !__libcpu_timings_h */
#ifndef __libcpu_timings_h #define __libcpu_timings_h #ifdef __MACH__ #include <mach/mach_time.h> #define abs_time() mach_absolute_time() #endif #ifdef sun #include <sys/time.h> #define abs_time() gethrtime() #endif #ifdef linux #warning High precission timing currently n/a on Linux // HACK #define abs_time() 0 #endif #ifdef _WIN32 typedef unsigned long DWORD; #define WINAPI __stdcall extern "C" DWORD WINAPI GetTickCount(void); #define abs_time() GetTickCount() #endif #endif /* !__libcpu_timings_h */
Make abs_time() use GetTickCount() on Windows
Make abs_time() use GetTickCount() on Windows
C
bsd-2-clause
ukatemi/libcpu,monocasa/libcpu,ukatemi/libcpu,curtiszimmerman/libcpu,curtiszimmerman/libcpu,monocasa/libcpu,monocasa/libcpu,libcpu/libcpu,libcpu/libcpu,libcpu/libcpu,ukatemi/libcpu,glguida/libcpu,libcpu/libcpu,ukatemi/libcpu,curtiszimmerman/libcpu,curtiszimmerman/libcpu,glguida/libcpu,glguida/libcpu,monocasa/libcpu,glguida/libcpu
31c42798c74f5ae31a996ea17c96ec1301876a26
PWG3/PWG3baseLinkDef.h
PWG3/PWG3baseLinkDef.h
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliQuarkoniaAcceptance+; #pragma link C++ class AliQuarkoniaEfficiency+; #pragma link C++ class AliD0toKpi+; #pragma link C++ class AliD0toKpiAnalysis+; #pragma link C++ class AliBtoJPSItoEle+; #pragma link C++ class AliBtoJPSItoEleAnalysis+; #pragma link C++ class AliAODRecoDecayHF+; #pragma link C++ class AliAODRecoDecayHF2Prong+; #pragma link C++ class AliAODRecoDecayHF3Prong+; #pragma link C++ class AliAODRecoDecayHF4Prong+; #pragma link C++ class AliAnalysisVertexingHF+; #pragma link C++ class AliAnalysisTaskVertexingHF+; #pragma link C++ class AliAODDimuon+; #pragma link C++ class AliAODEventInfo+; #pragma link C++ class AliAnalysisTaskMuonAODfromGeneral+; #pragma link C++ class AliAnalysisTaskSingleMu+; #endif
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliQuarkoniaAcceptance+; #pragma link C++ class AliQuarkoniaEfficiency+; #pragma link C++ class AliAODRecoDecayHF+; #pragma link C++ class AliAODRecoDecayHF2Prong+; #pragma link C++ class AliAODRecoDecayHF3Prong+; #pragma link C++ class AliAODRecoDecayHF4Prong+; #pragma link C++ class AliAnalysisVertexingHF+; #pragma link C++ class AliAnalysisTaskVertexingHF+; #pragma link C++ class AliAODDimuon+; #pragma link C++ class AliAODEventInfo+; #pragma link C++ class AliAnalysisTaskMuonAODfromGeneral+; #pragma link C++ class AliAnalysisTaskSingleMu+; #endif
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
C
bsd-3-clause
yowatana/AliPhysics,akubera/AliPhysics,rderradi/AliPhysics,rbailhac/AliPhysics,AMechler/AliPhysics,adriansev/AliPhysics,ppribeli/AliPhysics,hcab14/AliPhysics,pbatzing/AliPhysics,dlodato/AliPhysics,ALICEHLT/AliPhysics,pbuehler/AliPhysics,alisw/AliPhysics,SHornung1/AliPhysics,dstocco/AliPhysics,hzanoli/AliPhysics,rihanphys/AliPhysics,mpuccio/AliPhysics,pbuehler/AliPhysics,sebaleh/AliPhysics,lfeldkam/AliPhysics,rihanphys/AliPhysics,preghenella/AliPhysics,alisw/AliPhysics,mazimm/AliPhysics,amaringarcia/AliPhysics,pchrista/AliPhysics,fcolamar/AliPhysics,kreisl/AliPhysics,pbuehler/AliPhysics,hcab14/AliPhysics,jgronefe/AliPhysics,AudreyFrancisco/AliPhysics,hcab14/AliPhysics,dstocco/AliPhysics,preghenella/AliPhysics,dmuhlhei/AliPhysics,fbellini/AliPhysics,mbjadhav/AliPhysics,jmargutt/AliPhysics,fbellini/AliPhysics,mkrzewic/AliPhysics,mvala/AliPhysics,hcab14/AliPhysics,ALICEHLT/AliPhysics,fbellini/AliPhysics,pchrista/AliPhysics,dlodato/AliPhysics,victor-gonzalez/AliPhysics,jmargutt/AliPhysics,mpuccio/AliPhysics,AudreyFrancisco/AliPhysics,fbellini/AliPhysics,fcolamar/AliPhysics,mbjadhav/AliPhysics,btrzecia/AliPhysics,carstooon/AliPhysics,jgronefe/AliPhysics,dmuhlhei/AliPhysics,mvala/AliPhysics,hzanoli/AliPhysics,AMechler/AliPhysics,rbailhac/AliPhysics,nschmidtALICE/AliPhysics,pbatzing/AliPhysics,mkrzewic/AliPhysics,akubera/AliPhysics,kreisl/AliPhysics,aaniin/AliPhysics,lfeldkam/AliPhysics,pchrista/AliPhysics,mazimm/AliPhysics,victor-gonzalez/AliPhysics,btrzecia/AliPhysics,akubera/AliPhysics,sebaleh/AliPhysics,AMechler/AliPhysics,SHornung1/AliPhysics,mkrzewic/AliPhysics,ppribeli/AliPhysics,lcunquei/AliPhysics,dmuhlhei/AliPhysics,lfeldkam/AliPhysics,rihanphys/AliPhysics,alisw/AliPhysics,amatyja/AliPhysics,lcunquei/AliPhysics,fbellini/AliPhysics,AudreyFrancisco/AliPhysics,pbatzing/AliPhysics,pbuehler/AliPhysics,mkrzewic/AliPhysics,lfeldkam/AliPhysics,mbjadhav/AliPhysics,dstocco/AliPhysics,dmuhlhei/AliPhysics,kreisl/AliPhysics,carstooon/AliPhysics,pbatzing/AliPhysics,mkrzewic/AliPhysics,dlodato/AliPhysics,preghenella/AliPhysics,kreisl/AliPhysics,mbjadhav/AliPhysics,rderradi/AliPhysics,dstocco/AliPhysics,dlodato/AliPhysics,AudreyFrancisco/AliPhysics,dmuhlhei/AliPhysics,rbailhac/AliPhysics,ppribeli/AliPhysics,akubera/AliPhysics,adriansev/AliPhysics,jmargutt/AliPhysics,mvala/AliPhysics,nschmidtALICE/AliPhysics,fcolamar/AliPhysics,rderradi/AliPhysics,rderradi/AliPhysics,ppribeli/AliPhysics,carstooon/AliPhysics,lcunquei/AliPhysics,mpuccio/AliPhysics,ALICEHLT/AliPhysics,mvala/AliPhysics,aaniin/AliPhysics,mbjadhav/AliPhysics,victor-gonzalez/AliPhysics,kreisl/AliPhysics,AMechler/AliPhysics,hzanoli/AliPhysics,hzanoli/AliPhysics,hcab14/AliPhysics,rderradi/AliPhysics,aaniin/AliPhysics,dstocco/AliPhysics,akubera/AliPhysics,mazimm/AliPhysics,carstooon/AliPhysics,rihanphys/AliPhysics,amatyja/AliPhysics,sebaleh/AliPhysics,pchrista/AliPhysics,akubera/AliPhysics,adriansev/AliPhysics,amatyja/AliPhysics,alisw/AliPhysics,pbatzing/AliPhysics,yowatana/AliPhysics,mvala/AliPhysics,aaniin/AliPhysics,AudreyFrancisco/AliPhysics,sebaleh/AliPhysics,AMechler/AliPhysics,hcab14/AliPhysics,aaniin/AliPhysics,hzanoli/AliPhysics,pbuehler/AliPhysics,carstooon/AliPhysics,yowatana/AliPhysics,mkrzewic/AliPhysics,nschmidtALICE/AliPhysics,btrzecia/AliPhysics,AMechler/AliPhysics,SHornung1/AliPhysics,lcunquei/AliPhysics,mpuccio/AliPhysics,nschmidtALICE/AliPhysics,rbailhac/AliPhysics,amaringarcia/AliPhysics,SHornung1/AliPhysics,aaniin/AliPhysics,fcolamar/AliPhysics,lfeldkam/AliPhysics,adriansev/AliPhysics,mkrzewic/AliPhysics,btrzecia/AliPhysics,jgronefe/AliPhysics,fcolamar/AliPhysics,pbatzing/AliPhysics,lfeldkam/AliPhysics,yowatana/AliPhysics,mazimm/AliPhysics,pchrista/AliPhysics,rderradi/AliPhysics,SHornung1/AliPhysics,fbellini/AliPhysics,mvala/AliPhysics,aaniin/AliPhysics,yowatana/AliPhysics,ALICEHLT/AliPhysics,mpuccio/AliPhysics,fcolamar/AliPhysics,rihanphys/AliPhysics,carstooon/AliPhysics,mvala/AliPhysics,pbuehler/AliPhysics,lcunquei/AliPhysics,dlodato/AliPhysics,hzanoli/AliPhysics,amatyja/AliPhysics,amatyja/AliPhysics,dlodato/AliPhysics,adriansev/AliPhysics,jmargutt/AliPhysics,ALICEHLT/AliPhysics,mpuccio/AliPhysics,AudreyFrancisco/AliPhysics,mazimm/AliPhysics,alisw/AliPhysics,kreisl/AliPhysics,SHornung1/AliPhysics,lcunquei/AliPhysics,rbailhac/AliPhysics,nschmidtALICE/AliPhysics,yowatana/AliPhysics,amaringarcia/AliPhysics,jmargutt/AliPhysics,preghenella/AliPhysics,pbatzing/AliPhysics,dmuhlhei/AliPhysics,adriansev/AliPhysics,preghenella/AliPhysics,sebaleh/AliPhysics,victor-gonzalez/AliPhysics,dstocco/AliPhysics,preghenella/AliPhysics,lfeldkam/AliPhysics,ppribeli/AliPhysics,nschmidtALICE/AliPhysics,akubera/AliPhysics,mbjadhav/AliPhysics,SHornung1/AliPhysics,amatyja/AliPhysics,amaringarcia/AliPhysics,ppribeli/AliPhysics,mazimm/AliPhysics,mbjadhav/AliPhysics,alisw/AliPhysics,jmargutt/AliPhysics,AudreyFrancisco/AliPhysics,rihanphys/AliPhysics,victor-gonzalez/AliPhysics,jgronefe/AliPhysics,nschmidtALICE/AliPhysics,ALICEHLT/AliPhysics,fcolamar/AliPhysics,AMechler/AliPhysics,rderradi/AliPhysics,mpuccio/AliPhysics,dstocco/AliPhysics,ALICEHLT/AliPhysics,pbuehler/AliPhysics,lcunquei/AliPhysics,hcab14/AliPhysics,alisw/AliPhysics,sebaleh/AliPhysics,hzanoli/AliPhysics,amatyja/AliPhysics,sebaleh/AliPhysics,carstooon/AliPhysics,pchrista/AliPhysics,rbailhac/AliPhysics,amaringarcia/AliPhysics,preghenella/AliPhysics,btrzecia/AliPhysics,btrzecia/AliPhysics,fbellini/AliPhysics,jgronefe/AliPhysics,dlodato/AliPhysics,yowatana/AliPhysics,ppribeli/AliPhysics,victor-gonzalez/AliPhysics,jgronefe/AliPhysics,mazimm/AliPhysics,amaringarcia/AliPhysics,rihanphys/AliPhysics,jmargutt/AliPhysics,jgronefe/AliPhysics,kreisl/AliPhysics,adriansev/AliPhysics,dmuhlhei/AliPhysics,amaringarcia/AliPhysics,rbailhac/AliPhysics,pchrista/AliPhysics,victor-gonzalez/AliPhysics,btrzecia/AliPhysics
9796e4cc76c93344578a8fbed88feb6c552d7ba4
thcrap/src/global.c
thcrap/src/global.c
/** * Touhou Community Reliant Automatic Patcher * Main DLL * * ---- * * Globals, compile-time constants and runconfig abstractions. */ #include "thcrap.h" CRITICAL_SECTION cs_file_access; json_t* run_cfg = NULL; const char* PROJECT_NAME(void) { return "Touhou Community Reliant Automatic Patcher"; } const char* PROJECT_NAME_SHORT(void) { return "thcrap"; } const DWORD PROJECT_VERSION(void) { return 0x20131025; } const char* PROJECT_VERSION_STRING(void) { static char ver_str[11] = {0}; if(!ver_str[0]) { str_hexdate_format(ver_str, PROJECT_VERSION()); } return ver_str; } json_t* runconfig_get(void) { return run_cfg; } void runconfig_set(json_t *new_run_cfg) { run_cfg = new_run_cfg; } void* runconfig_func_get(const char *name) { json_t *funcs = json_object_get(run_cfg, "funcs"); return (void*)json_object_get_hex(funcs, name); }
/** * Touhou Community Reliant Automatic Patcher * Main DLL * * ---- * * Globals, compile-time constants and runconfig abstractions. */ #include "thcrap.h" CRITICAL_SECTION cs_file_access; json_t* run_cfg = NULL; const char* PROJECT_NAME(void) { return "Touhou Community Reliant Automatic Patcher"; } const char* PROJECT_NAME_SHORT(void) { return "thcrap"; } const DWORD PROJECT_VERSION(void) { return 0x20131025; } const char* PROJECT_VERSION_STRING(void) { static char ver_str[11] = {0}; if(!ver_str[0]) { str_hexdate_format(ver_str, PROJECT_VERSION()); } return ver_str; } json_t* runconfig_get(void) { return run_cfg; } void runconfig_set(json_t *new_run_cfg) { run_cfg = new_run_cfg; json_incref(run_cfg); } void* runconfig_func_get(const char *name) { json_t *funcs = json_object_get(run_cfg, "funcs"); return (void*)json_object_get_hex(funcs, name); }
Increment the run configuration's reference counter.
runconfig_set(): Increment the run configuration's reference counter. Fixes bug #41 (https://bitbucket.org/nmlgc/thpatch-bugs/issue/41).
C
unlicense
thpatch/thcrap,VBChunguk/thcrap,thpatch/thcrap,thpatch/thcrap,VBChunguk/thcrap,thpatch/thcrap,VBChunguk/thcrap,thpatch/thcrap
04743587bbbf4330680ca61ef7ab4392df3529de
leafnode-version.c
leafnode-version.c
/* * (C) 2001 by Matthias Andree */ /* * This file (leafnode-version.c) is public domain. It comes without and * express or implied warranties. Do with this file whatever you wish, but * don't remove the disclaimer. */ #include <stdio.h> #include "leafnode.h" #ifdef WITH_DMALLOC #include <dmalloc.h> #endif #include "config.h" int main(void) { static char env_path[] = "PATH=/bin:/usr/bin"; /* ------------------------------------------------ */ /* *** IMPORTANT *** * * external tools depend on the first line of this output, which is * in the fixed format * version: leafnode-2.3.4... */ fputs("version: leafnode-", stdout); puts(version); /* changable parts below :-) */ fputs("current machine: ", stdout); fflush(stdout); putenv(env_path); if (system("uname -a")) puts(" (error)"); fputs("bindir: ", stdout); puts(bindir); fputs("sysconfdir: ", stdout); puts(sysconfdir); fputs("spooldir: ", stdout); puts(spooldir); fputs("lockfile: ", stdout); puts(lockfile); #ifdef HAVE_IPV6 puts("IPv6: yes"); #else puts("IPv6: no"); #endif fputs("default MTA: ", stdout); puts(DEFAULTMTA); exit(0); }
/* * (C) 2001 by Matthias Andree */ /* * This file (leafnode-version.c) is public domain. It comes without and * express or implied warranties. Do with this file whatever you wish, but * don't remove the disclaimer. */ #include <stdio.h> #include "leafnode.h" #ifdef WITH_DMALLOC #include <dmalloc.h> #endif #include "config.h" int main(void) { static char env_path[] = "PATH=/bin:/usr/bin"; /* ------------------------------------------------ */ /* *** IMPORTANT *** * * external tools depend on the first line of this output, which is * in the fixed format * version: leafnode-2.3.4... */ fputs("version: leafnode-", stdout); puts(version); /* changable parts below :-) */ fputs("current machine: ", stdout); fflush(stdout); putenv(env_path); if (system("uname -a")) puts(" (error)"); fputs("bindir: ", stdout); puts(bindir); fputs("sysconfdir: ", stdout); puts(sysconfdir); fputs("default spooldir: ", stdout); puts(def_spooldir); #ifdef HAVE_IPV6 puts("IPv6: yes"); #else puts("IPv6: no"); #endif fputs("default MTA: ", stdout); puts(DEFAULTMTA); exit(0); }
Fix up the spooldir/lockfile changes that caused a segfault.
Fix up the spooldir/lockfile changes that caused a segfault.
C
lgpl-2.1
BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode