Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix a JSON sequence encode bug
#ifndef JSON_H_H4Q7QTC4 #define JSON_H_H4Q7QTC4 #include "mfast_json_export.h" #include "mfast.h" #include <iostream> namespace mfast { namespace json { MFAST_JSON_EXPORT bool encode(std::ostream& os, const ::mfast::aggregate_cref& msg, ...
#ifndef JSON_H_H4Q7QTC4 #define JSON_H_H4Q7QTC4 #include "mfast_json_export.h" #include "mfast.h" #include <iostream> namespace mfast { namespace json { MFAST_JSON_EXPORT bool encode(std::ostream& os, const ::mfast::aggregate_cref& msg, ...
Add newline at end of file.
//===-- PPCMachineFunctionInfo.h - Private data used for PowerPC --*- C++ -*-=// // // The LLVM Compiler Infrastructure // // This file was developed by James M. Laskey and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===------------------...
//===-- PPCMachineFunctionInfo.h - Private data used for PowerPC --*- C++ -*-=// // // The LLVM Compiler Infrastructure // // This file was developed by James M. Laskey and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===------------------...
Fix type conflict with min/max in shared.
/* * Rubygame -- Ruby code and bindings to SDL to facilitate game creation * Copyright (C) 2004-2007 John Croisant * * 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 * versi...
/* * Rubygame -- Ruby code and bindings to SDL to facilitate game creation * Copyright (C) 2004-2007 John Croisant * * 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 * versi...
Remove a cast again, after it was shown to worsen Windows perf.
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contribut...
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contribut...
Add helper class for serializing the data
#ifndef SERIALIZER_H #define SERIALIZER_H #include <vector> #include <cstdint> #include <string> #include <algorithm> class Serializer { public: /** \brief Serialization of standard integer values */ void serialize( std::uint32_t value ) { serializeInteger( value ); } ...
Write hello message to console
#include <rose/interrupts.h> #include <rose/screen.h> #include <rose/serial.h> #include <rose/memory.h> extern void protected_mode_start(void); extern char end[]; void kmain(void) { interrupts_disable(); screen_clear(); memory_init_gdt(); interrupts_init(); protected_mode_start(); serial_init...
#include <rose/console.h> #include <rose/interrupts.h> #include <rose/screen.h> #include <rose/serial.h> #include <rose/memory.h> extern void protected_mode_start(void); extern char end[]; void kmain(void) { interrupts_disable(); screen_clear(); memory_init_gdt(); interrupts_init(); protected_mod...
Use memmove instead of memcpy due to the fact that the strings will be overlapping.
/* str/lstrip.c - Strip whitespace from the left of a string * Copyright (C) 2001 Bruce Guenter <bruceg@em.ca> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the Lic...
/* str/lstrip.c - Strip whitespace from the left of a string * Copyright (C) 2001 Bruce Guenter <bruceg@em.ca> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the Lic...
Add link to comment for api proxy method.
#import <Foundation/Foundation.h> @interface WMFProxyServer : NSObject @property (nonatomic, readonly, getter=isRunning) BOOL running; - (void)start; + (WMFProxyServer *)sharedProxyServer; - (NSString *)localFilePathForRelativeFilePath:(NSString *)relativeFilePath; //path for writing files to the file proxy's serv...
#import <Foundation/Foundation.h> @interface WMFProxyServer : NSObject @property (nonatomic, readonly, getter=isRunning) BOOL running; - (void)start; + (WMFProxyServer *)sharedProxyServer; - (NSString *)localFilePathForRelativeFilePath:(NSString *)relativeFilePath; //path for writing files to the file proxy's serv...
Add illegal member access and undefined function name error.
int global_a; struct foo { // redefinition in struct declaration int a; int a; float b; }; // redefinition of foo struct foo { float a; int b; }; // redefinition in function arguments int a_func(int a, int a) { return 1; } int func(int c, int d, float f) { int b = 1; float test_arr...
int global_a; struct foo { // redefinition in struct declaration int a; int a; float b; }; // redefinition of foo struct foo { float a; int b; }; // redefinition in function arguments int a_func(int a, int a) { return 1; } int func(int c, int d, float f) { int b = 1; float test_arr...
Update requested GVRET version to 343 which is where stable support for M2 and CANDue2.2 are found.
#ifndef CONFIG #define CONFIG #define VERSION 179 //try to keep this in sync. //SavvyCAN will complain if you connect a GVRET board with a revision //less than this number. #define CURRENT_GVRET_VER 334 #endif // CONFIG
#ifndef CONFIG #define CONFIG #define VERSION 180 //try to keep this in sync. //SavvyCAN will complain if you connect a GVRET board with a revision //less than this number. #define CURRENT_GVRET_VER 343 #endif // CONFIG
Add a simple tool to print the window ID of a currently running compositor.
#include <X11/X.h> #include <X11/Xatom.h> #include <X11/Xlib.h> #include <stdio.h> int main() { Display *display = XOpenDisplay(NULL); if (display == NULL) { fprintf(stderr, "Could not connect to $DISPLAY.\n"); return 1; } char buf[32]; snprintf(buf, sizeof(buf), "_NET_WM_CM_S%d", (int)DefaultScreen(...
Add another case to qualifier-removal test
// RUN: %check %s struct A { int i; }; int f(const void *p) { struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const) struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/ (void)a; (void)b; }
// RUN: %check %s struct A { int i; }; void take(void *); int f(const void *p) { struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const) struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/ (void)a; (void)b; const char c = 5; take(&c); // CHECK: warning: implicit ...
Add <mutex> to the list of includes
#pragma once #include <unistd.h> #include <algorithm> #include <cstdarg> #include <exception> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <string> #include <thread> #include <tuple> #include <unordered_map> #incl...
#pragma once #include <unistd.h> #include <algorithm> #include <cstdarg> #include <exception> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <mutex> #include <queue> #include <set> #include <sstream> #include <string> #include <thread> #include <tuple> #include <uno...
Add test coverage for .bc input in the frontend
// Test that we can consume LLVM IR/bitcode in the frontend and produce // identical output to a standard compilation. // Reference output: // RUN: %clang_cc1 -S -o %t.s %s // LLVM bitcode: // RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s // RUN: %clang_cc1 -S -o - %t.bc > %t.bc.s // RUN: diff %t.s %t.bc.s // LLVM IR so...
Set version for upcoming bugfix release
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 2 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 1 #define CLIENT_VERSION_BUILD 0 // Convert...
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 2 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 2 #define CLIENT_VERSION_BUILD 0 // Convert...
Add test strlen so for hijacking apache's strlen
#include <stdio.h> #include <dlfcn.h> #include <unistd.h> #include <sys/types.h> #include <dirent.h> static void *dl; size_t (*orig_strlen)(const char *); __attribute__((constructor)) void stub(void) { dl = dlopen("/lib/libc.so.6", RTLD_LAZY | RTLD_GLOBAL); orig_strlen = dlsym(dl, "strlen"); } size_t strlen(con...
Use strncpy() instead of sprintf() in calculate_path().
#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 {...
#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...
Add handlers to the common list
#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"; ...
#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"; ...
Add enum to distinct pattern
#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; } FakeLock...
#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; } FakeLock...
Fix an obsolete file path mentioned in a comment.
/* 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 *);
Print CPU time in splash screen
#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" " _.'`. ....
#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" " _.'`. ....
Fix linking problem with IPC::MessageT
// 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" #i...
// 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" #i...
Fix logic loop in script
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...
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...
Fix this test to actually check something and be able to be compiled.
// 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; }
Read data from Static File
#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"); // sva...
Add solution to Exercise 1-15.
/* 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"); flo...
Fix crash when hardware acceleration is disabled.
/* 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...
/* 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...
Remove nasty character at end of file that prevents compiles
#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...
#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...
Extend UIThemeProtocol with padding/inset sizes
// // Created by Michael Kuck on 8/20/14. // Copyright (c) 2014 Michael Kuck. All rights reserved. // #import <Foundation/Foundation.h> //============================================================ //== MKUITheme protocol //============================================================ @protocol MKUIThemeProtocol<NSOb...
// // Created by Michael Kuck on 8/20/14. // Copyright (c) 2014 Michael Kuck. All rights reserved. // #import <Foundation/Foundation.h> //============================================================ //== MKUITheme protocol //============================================================ @protocol MKUIThemeProtocol<NSOb...
Add a topological sort utility file
#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 alway...
Change flag separation from `|` to `,`
#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) {...
#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) {...
Use %S, not `pwd`, and enable a line that *does* work. - Doug, please check.
// 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}} in...
// 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{{redefiniti...
Add a file to contain test cases for non-phonetic IM's.
/** * 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 HA...
Add string function to test suite
#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 mai...
Update Chrome version to 63.0.3239.84
// 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_VE...
// 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_VE...
Print a message to terminal screen
/* * screenmsg - Print a message to terminal * * Written in 2012 by Prashant P Shah <pshah.mumbai@gmail.com> * * 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 * wit...
Fix name of the paramenter for requesting plugin reload
#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 */
Delete non-const reference operator pure virtual function
#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...
#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...
Test Program that accomodates space now returns the time spent
#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*) mal...
#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 (r...
Fix type: jmp_buf -> sigjmp_buf.
#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, ...
#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 * ...
Make the buffer a little larger
#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(c...
#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(c...
Add parenthesis around macro value definition
#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 #...
#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 #...
Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available.
#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--; ...
#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_s...
Add forgotten test for /
#include <assert.h> int main() { int x = 285; int y = 23; assert(x / y == 12); return 0; }
Clarify need for custom default framebuffer
#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 cont...
#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 cont...
Move heartbeat, location and gexec metrics to a core module that will always be statically linked
#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++) { /* Initial...
Swap out header in precompiled header file
// 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_AUTOM...
// 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_AUTOM...
Add __FBSDID()s to internal libgnumalloc()
void cfree(void *foo) { free(foo); }
/* * cfree.c */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); void cfree(void *foo) { free(foo); }
Declare as returning an "int" and fix typo.
/* libunwind - a platform-independent unwind library Copyright (c) 2004 Hewlett-Packard Development Company, L.P. Contributed by David Mosberger-Tang <davidm@hpl.hp.com> This file is part of libunwind. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated doc...
Update API to only support 1, 2 or 3 dimensional lines
/* 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 <jamie@jamiebullock.com> Based on psimpl Copyright ...
/* 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 <jamie@jamiebullock.com> Based on psimpl Copyright ...
Add a polylog bug report
/* 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...
Fix declaration of welcome message!
#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 Custom...
#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 Custom...
Determine if a string has all unique chars
#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 ...
Fix cuda incomplete type issue
#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: ImageProcess...
#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: ImageProcess...
Add BOTAN_DLL to Timer class declaration
/************************************************* * Timestamp Functions Header File * * (C) 1999-2007 Jack Lloyd * *************************************************/ #ifndef BOTAN_TIMERS_H__ #define BOTAN_TIMERS_H__ #include <botan/base.h> namespace Botan { /*******************...
/************************************************* * Timestamp Functions Header File * * (C) 1999-2007 Jack Lloyd * *************************************************/ #ifndef BOTAN_TIMERS_H__ #define BOTAN_TIMERS_H__ #include <botan/base.h> namespace Botan { /*******************...
Add assertion for value in get/put test
#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; ...
#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; ...
Change the IP of my home machine for testing.
/* * 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
Add some comments, clean up the code, and add extern "C".
/** * 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; UBR...
/** * 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...
Add : date picker pop view importer
// // 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/LYPopAc...
Add typedef of LacoState in header
#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) * p...
#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 * para...
Save one more byte by casting loop counter u to a char
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);}
Update files, Alura, Introdução a C, Aula 2.3
#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? "...
#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? "...
Remove clamp, which was unused
/* * 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 bound...
/* * 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 bound...
Add a new line to end of file
// All-in-one import for Braintree 3D Secure #import <Braintree/BTThreeDSecure.h>
// All-in-one import for Braintree 3D Secure #import <Braintree/BTThreeDSecure.h>
Change nonatomic, weak to assign for all IBOutlets
// // 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 RSCCControlCellViewCl...
// // 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 RSCCControlCellViewCl...
Fix module loc. Add missing final newline.
// @(#)root/thread:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
// @(#)root/base:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
Add virtual decl to getAnalog to enable overloading
/* 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 Lice...
/* 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 Lice...
Allow for platforms that have optreset but not <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 */ #in...
/* * 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 */ #in...
Switch song updater updateFrequency from NSTimeInterval (length of time) to NSUInteger (number of counter seconds to skip).
// // 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 //...
// // 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 //...
Fix typo in header guard
#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...
#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 ...
Optimize counting size of larger sets
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...
Make lockname(s) a macro instead of a inline.
#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 counte...
#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 counte...
Call `clear` and `refresh` to update screen
#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...
#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...
Change config dir name to mrrcrypt
// 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/mir...
// 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/mrr...
Add fake functions for hardware missing in english breakfast
// 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/rstmg...
Fix compilation on FreeBSD and OpenBSD
/* * 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 add...
#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 { ...
Fix missing declaration for ShapeInit()
/* FreeRDP: A Remote Desktop Protocol client. GDI Shape Functions Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com> 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 a...
/* FreeRDP: A Remote Desktop Protocol client. GDI Shape Functions Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com> 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 a...
Fix build warning for shadowed variable.
#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_c...
#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 = sui...
Add `value` parameter to SOMAXCONN binding
#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(s...
#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){ ...
Remove designated initializer compiler warnings
// // 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:...
// // 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)fr...
Test the new width functionality
#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) { ...
#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) { ...
Fix missing void in parameterless call prototype
/* * 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_k...
/* * 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 c...
Remove TODO test comment about OSTreeHash::Parse
#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 OSTreeCommitPar...
#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 OSTreeCommitPar...
Fix a memory leak in tests
/* * 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 topolo...
/* * 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 topolo...
Add include so we get a prototype for syscall()
#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>...
#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()" ...
Use a class instead of a struct
/*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...
/*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...
Handle reserved true/false variable names
/* 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 i...
Stop using console in demo ROM
// GBT Player v3.0.9 // // SPDX-License-Identifier: MIT // // Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com> #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); consoleDe...
// GBT Player v3.0.9 // // SPDX-License-Identifier: MIT // // Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com> #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); ...
Modify the prototype of IFDOpenIFD.
/* * 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 <corcoran@linuxnet.com> * * $Id$ */ #ifndef __ifdwrapper_h__ #define __ifdw...
/* * 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 <corcoran@linuxnet.com> * * $Id$ */ #ifndef __ifdwrapper_h__ #define __ifdw...
Synchronize the mailbox after expunging messages to actually get them expunged.
/* 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 (!...
/* 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 (!...
Fix bug in dequeue that caused to return always false
#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...
#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...
Add a ServerProofVerifier interface to QUIC.
// 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 glib.h as it uses g* datatypes Added for gnome-config
#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 ...
#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_...
Add nodiscard to ErrorMessage and ErrorMessageOr
// 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 { ...
// 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]] ErrorMes...
Test new cursor functionality now implemented in the c1p runtime library.
/* * 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;...
/* * 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); ...
Make the cast operator inline for use with CUDA
/*! \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 TexturePara...
/*! \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 TexturePara...
Make timer ID's start with 1
/* 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 i...
/* 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 i...
Fix a stray -Winconsistent-missing-override warning.
/* * 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 ...
/* * 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 ...
Add first token, current_symbol and function prototypes
#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
Make PRECONDITION usable in isolation by compile time define PRECON.
#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 PRECO...