after stringlengths 72 2.11k | before stringlengths 21 1.55k | diff stringlengths 85 2.31k | instruction stringlengths 20 1.71k | license stringclasses 13
values | repos stringlengths 7 82.6k | commit stringlengths 40 40 |
|---|---|---|---|---|---|---|
#include "gameboy.h"
#include "memory.h"
u8 select_rom_bank(u8 value)
{
u8 ret = value & 0x1F;
switch (mode) {
case ROM:
break;
case MBC1:
switch (ret) {
case 0:
case 0x20:
case 0x40:
case 0x60:
break;
default:
ret -= 1;
}
}
return ret;
}
u8 select_ram_bank(u8 value)
{
return (value & 0x... | #include "gameboy.h"
#include "memory.h"
u8 select_rom_bank(u8 value)
{
u8 ret = value & 0x1F;
switch (mode) {
case ROM:
break;
case MBC1:
switch (ret) {
case 0:
case 0x20:
case 0x40:
case 0x60:
break;
default:
ret -= 1;
}
}
return ret;
}
u8 select_ram_bank(u8 value)
{
return (value & 0x... | ---
+++
@@ -29,9 +29,5 @@
u8 enable_ram(u8 value)
{
- u8 ram_enable;
-
- ram_enable = ((value & 0x0A) != 0x0A) ? 0 : 1;
-
- return ram_enable;
+ return ((value & 0x0A) != 0x0A) ? 0 : 1;
} | Simplify return of ram_enable value
| mit | hoferm/tmpgb,hoferm/tmpgb | a9437115ceb0307d8481cbc36ed8dc66d2ebc38b |
/**
* @file BlynkSimpleTinyGSM.h
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Nov 2016
* @brief
*
*/
#ifndef BlynkSimpleTinyGSM_h
#define BlynkSimpleTinyGSM_h
#include <Adapters/B... | /**
* @file BlynkSimpleTinyGSM.h
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Nov 2016
* @brief
*
*/
#ifndef BlynkSimpleTinyGSM_h
#define BlynkSimpleTinyGSM_h
#ifndef BLYNK_INFO_C... | ---
+++
@@ -11,10 +11,6 @@
#ifndef BlynkSimpleTinyGSM_h
#define BlynkSimpleTinyGSM_h
-#ifndef BLYNK_INFO_CONNECTION
-#define BLYNK_INFO_CONNECTION "TinyGSM"
-#endif
-
#include <Adapters/BlynkGsmClient.h>
static BlynkArduinoClient _blynkTransport; | Move conn. type detection to Adataper
| mit | blynkkk/blynk-library,blynkkk/blynk-library,blynkkk/blynk-library,blynkkk/blynk-library,blynkkk/blynk-library | 41a35717e8ad8900b72dfc4d711954cb73096b50 |
typedef NS_ENUM(NSInteger, StatsSection) {
StatsSectionGraph,
StatsSectionPeriodHeader,
StatsSectionEvents,
StatsSectionPosts,
StatsSectionReferrers,
StatsSectionClicks,
StatsSectionCountry,
StatsSectionVideos,
StatsSectionAuthors,
StatsSectionSearchTerms,
StatsSectionComment... | typedef NS_ENUM(NSInteger, StatsSection) {
StatsSectionGraph,
StatsSectionPeriodHeader,
StatsSectionEvents,
StatsSectionPosts,
StatsSectionReferrers,
StatsSectionClicks,
StatsSectionCountry,
StatsSectionVideos,
StatsSectionAuthors,
StatsSectionSearchTerms,
StatsSectionComment... | ---
+++
@@ -13,7 +13,11 @@
StatsSectionTagsCategories,
StatsSectionFollowers,
StatsSectionPublicize,
- StatsSectionWebVersion
+ StatsSectionWebVersion,
+ StatsSectionPostDetailsGraph,
+ StatsSectionPostDetailsMonthsYears,
+ StatsSectionPostDetailsAveragePerDay,
+ StatsSectionPostDetai... | Add new sections for post details
| mit | wordpress-mobile/WordPressCom-Stats-iOS,wordpress-mobile/WordPressCom-Stats-iOS | d84323ce8cd37c5b88a84e8a8ca2e80dc2b51acc |
#define MICROPY_HW_BOARD_NAME "Arduino MKR1300"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
#define DEFAULT_I2C_BUS_SCL (&... | #define MICROPY_HW_BOARD_NAME "Arduino MKR1300"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#include "internal_flash.h"
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
#define BOARD_FLASH_SIZE (0x00040000 - 0... | ---
+++
@@ -1,11 +1,9 @@
#define MICROPY_HW_BOARD_NAME "Arduino MKR1300"
#define MICROPY_HW_MCU_NAME "samd21g18"
-#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25)
+#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
-
-#include "internal_flash.h"
#define... | Update MKR1300 board definition too
| mit | adafruit/micropython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython | 688f0e388bbb0ae4420c8e3145e83cb15d9b3829 |
// main.c
// Main Program for HWP Media Center
//
// Author : Weipeng He <heweipeng@gmail.com>
// Copyright (c) 2014, All rights reserved.
#include "utils.h"
#include <stdio.h>
#include <curl/curl.h>
size_t write_data(void *buffer, size_t size, size_t nmemb, void *dstr) {
d_string* str = (d_string*) dstr;
dstr_n... | // main.c
// Main Program for HWP Media Center
//
// Author : Weipeng He <heweipeng@gmail.com>
// Copyright (c) 2014, All rights reserved.
#include "utils.h"
#include <stdio.h>
#include <curl/curl.h>
size_t write_data(void *buffer, size_t size, size_t nmemb, void *dstr) {
d_string* str = (d_string*) dstr;
dstr_n... | ---
+++
@@ -23,6 +23,7 @@
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "hwp");
d_string* content = dstr_alloc();
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
@@ -30,7 +31,7 @@
res = curl_easy_perform(curl);
if... | Add User-Agent to prevent from blocked by Douban.fm
| mit | hwp/hmc,hwp/hmc | 06c3836a83cf2a0e4bdedde721f29489f9523e56 |
/*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#elif defined(CONFIG_FAT_FILESYSTEM_E... | /*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#else /* FAT_FS */
#define MAX_FILE_N... | ---
+++
@@ -13,9 +13,16 @@
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
-#else /* FAT_FS */
+#elif defined(CONFIG_FAT_FILESYSTEM_ELM)
+#if defined(CONFIG_FS_FATFS_LFN)
+#define MAX_FILE_NAME CONFIG_FS_FATFS_MAX_LFN
+#else /* CONFIG_FS_FATFS_LFN */
#define MAX_FILE_NAME 12 /* Uses 8.3 SFN */... | fs: Set MAX_FILE_NAME appropiately with LFN and FATFS
Try to define MAX_FILE_NAME to the appropriate max length based on the
selected filesystm. Otherwise fallback to a standard filename of 12
(made up of 8.3 : <filename>.<extension>)
Signed-off-by: Roman Vaughan <1620c2a00a7840d4515361aacd4b41348f2a8a7d@gmail.com>
| apache-2.0 | galak/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,nashif/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/z... | 42ee2e0938c7adec8da26ac544204d32f3af709b |
#include <sqlite3.h>
#include <stdio.h>
static sqlite3 *db;
int _mqtt_db_create_tables(void);
int mqtt_db_open(const char *filename)
{
if(sqlite3_open(filename, &db) != SQLITE_OK){
fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db));
return 1;
}
return _mqtt_db_create_tables();
}
int mqtt_db_close(void)
{
s... | #include <sqlite3.h>
#include <stdio.h>
static sqlite3 *db;
int _mqtt_db_create_tables(void);
int mqtt_db_open(const char *filename)
{
if(sqlite3_open(filename, &db) != SQLITE_OK){
fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db));
return 1;
}
return _mqtt_db_create_tables();
}
int mqtt_db_close(void)
{
s... | ---
+++
@@ -25,23 +25,32 @@
int _mqtt_db_create_tables(void)
{
- int rc;
+ int rc = 0;
char *errmsg = NULL;
- rc = sqlite3_exec(db,
+ if(sqlite3_exec(db,
"CREATE TABLE IF NOT EXISTS clients("
"id TEXT, "
"will INTEGER, will_retain INTEGER, will_qos "
"will_topic TEXT, will_message TEXT)",
- NULL,... | Create db table for subscriptions.
| bsd-3-clause | zlargon/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto | 228e64096902f6bcd14aca8be5333fc69cbc80bc |
#ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*
For some reason the stdio.h on OSF1 fails to provide prototypes
for popen() and pclose() if _POSIX_SOURCE is defined.
*/
#if defined(OSF1)
#if defined(__STDC__) || defined(__cplusplus)
FILE *popen( char ... | #ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
/*
For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype
for pclose() if _POSIX_SOURCE is defined - even though it does
provide a prototype for popen().
*/
#if defined(ULTRIX43)
#if defined(__cplusplus)
extern "C" {
#endif
#if define... | ---
+++
@@ -3,6 +3,25 @@
#include <stdio.h>
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ For some reason the stdio.h on OSF1 fails to provide prototypes
+ for popen() and pclose() if _POSIX_SOURCE is defined.
+*/
+#if defined(OSF1)
+#if defined(__STDC__) || defined(__cplusplus)
+ FILE *popen( ch... | Add prototypes for popen()/pclose() for OSF1 machines.
| apache-2.0 | djw8605/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,htcondor/htcondor,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,djw8605/condor,htcondor/htcondor,clalancette/condor-dcloud,... | 3059f29d3aca2555583bd8c15e94a5840eaba11b |
/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */
/* $FreeBSD$ */
#ifndef SSH_VERSION
#define SSH_VERSION (ssh_version_get())
#define SSH_VERSION_BASE "OpenSSH_3.6.1p1"
#define SSH_VERSION_ADDENDUM "FreeBSD-20030916"
const char *ssh_version_get(void);
void ssh_version_set_addend... | /* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */
/* $FreeBSD$ */
#ifndef SSH_VERSION
#define SSH_VERSION (ssh_version_get())
#define SSH_VERSION_BASE "OpenSSH_3.6.1p1"
#define SSH_VERSION_ADDENDUM "FreeBSD-20030423"
const char *ssh_version_get(void);
void ssh_version_set_addend... | ---
+++
@@ -5,7 +5,7 @@
#define SSH_VERSION (ssh_version_get())
#define SSH_VERSION_BASE "OpenSSH_3.6.1p1"
-#define SSH_VERSION_ADDENDUM "FreeBSD-20030423"
+#define SSH_VERSION_ADDENDUM "FreeBSD-20030916"
const char *ssh_version_get(void);
void ssh_version_set_addendum(const char *add... | Update the OpenSSH addendum string for the buffer handling fix.
| 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 | 359ce984aa895a88248856bb338f7c5484da1443 |
/* This file is currently empty; I'm going to add new code here soon.
Oct 27 1998. Martin
*/
| #ifndef GNOME_PROPERTIES_H
#define GNOME_PROPERTIES_H
#include <libgnome/gnome-defs.h>
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif
| ---
+++
@@ -1,9 +1,3 @@
-#ifndef GNOME_PROPERTIES_H
-#define GNOME_PROPERTIES_H
-#include <libgnome/gnome-defs.h>
-
-BEGIN_GNOME_DECLS
-
-END_GNOME_DECLS
-
-#endif
+/* This file is currently empty; I'm going to add new code here soon.
+ Oct 27 1998. Martin
+ */ | Make this an empty file just with a comment in it.
| lgpl-2.1 | Distrotech/libgnomeui,Distrotech/libgnomeui,Distrotech/libgnomeui | f8ff178831e639a2d91e0eb03840ee60f3dda1d3 |
#ifndef CJET_PEER_TESTING_H
#define CJET_PEER_TESTING_H
#ifdef TESTING
#ifdef __cplusplus
extern "C" {
#endif
ssize_t fake_read(int fd, void *buf, size_t count);
#ifdef __cplusplus
}
#endif
#define READ \
fake_read
#else
#define READ \
read
#endif
#endif
| #ifndef CJET_PEER_TESTING_H
#define CJET_PEER_TESTING_H
#ifdef TESTING
#define READ \
fake_read
#else
#define READ \
read
#endif
#endif
| ---
+++
@@ -2,9 +2,21 @@
#define CJET_PEER_TESTING_H
#ifdef TESTING
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ssize_t fake_read(int fd, void *buf, size_t count);
+
+#ifdef __cplusplus
+}
+#endif
+
#define READ \
fake_read
+
#else
+
#define READ \
read
#endif | Add "extern C" stuff for clean compile of tests.
| mit | mloy/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet | 237c7004130c08be3ea1a06d0e5ac76b1a153e5a |
#include "sqldatabasestorage.h"
CWF_BEGIN_NAMESPACE
namespace DbStorage {
static CWF::SqlDatabaseStorage _storage;
static QString _secret;
}
CWF_END_NAMESPACE
| #include "sqldatabasestorage.h"
CWF_BEGIN_NAMESPACE
namespace DbStorage {
CPPWEBFRAMEWORKSHARED_EXPORT static CWF::SqlDatabaseStorage _storage;
CPPWEBFRAMEWORKSHARED_EXPORT static QString _secret;
}
CWF_END_NAMESPACE
| ---
+++
@@ -3,8 +3,8 @@
CWF_BEGIN_NAMESPACE
namespace DbStorage {
- CPPWEBFRAMEWORKSHARED_EXPORT static CWF::SqlDatabaseStorage _storage;
- CPPWEBFRAMEWORKSHARED_EXPORT static QString _secret;
+ static CWF::SqlDatabaseStorage _storage;
+ static QString _secret;
}
CWF_END_NAMESPACE | Remove the dll export flag
| mit | HerikLyma/CPPWebFramework,HerikLyma/CPPWebFramework | 8557aff3b74bb0bf240fcc05ae73ff05caf1ce97 |
#ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Ra... | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Ra... | ---
+++
@@ -7,8 +7,9 @@
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output);
void e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object *grid, Evas_Coord... | Add function prototype for setting current geometry.
Rename function prototype for grid virtual size set.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>
SVN revision: 84195
| bsd-2-clause | FlorentRevest/Enlightenment,rvandegrift/e,tasn/enlightenment,FlorentRevest/Enlightenment,rvandegrift/e,rvandegrift/e,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment | c0d5cbad61bdde819a3d6c04e5b174fc85384343 |
/* string_funcs.h
* Copyright (C) 2001-2003, The Perl Foundation.
* SVN Info
* $Id$
* Overview:
* This is the api header for the string subsystem
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_STRING_PRIMITIVES_H_GUARD
#define PARROT_STRING_PRIMITIVES_H_GU... | /* string_funcs.h
* Copyright (C) 2001-2003, The Perl Foundation.
* SVN Info
* $Id$
* Overview:
* This is the api header for the string subsystem
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_STRING_PRIMITIVES_H_GUARD
#define PARROT_STRING_PRIMITIVES_H_GU... | ---
+++
@@ -17,18 +17,18 @@
/* Set the directory where ICU finds its data files (encodings,
locales, etc.) */
-void string_set_data_directory(const char *dir);
+PARROT_API void string_set_data_directory(const char *dir);
/* Convert from any supported encoding, into our internal format */
-void string_fill_f... | Fix the build on Win32 by making linkage of various symbols consistent again.
git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@18778 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
| artistic-2.0 | ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot | 72727bfb04499b60ca8ed91398fbabf0d88fe4cf |
#pragma once
//------------------------------------------------------------------------------
/**
@file core/posix/precompiled.h
Standard includes for POSIX platforms.
NOTE: keep as many headers out of here as possible, at least
on compilers which don't have pre-compiled-headers turned on.
... | #pragma once
//------------------------------------------------------------------------------
/**
@file core/posix/precompiled.h
Standard includes for POSIX platforms.
NOTE: keep as many headers out of here as possible, at least
on compilers which don't have pre-compiled-headers turned on.
... | ---
+++
@@ -7,8 +7,11 @@
NOTE: keep as many headers out of here as possible, at least
on compilers which don't have pre-compiled-headers turned on.
*/
-#ifdef __STRICT_ANSI__
-#undef __STRICT_ANSI__
+
+// this is a workaround when using clang with the GNU std lib,
+// this fails without __STRICT_ANSI__ bec... | Fix for compile error on Linux when using clang with GNU std c++ lib (__STRICT_ANSI__ is required)
| mit | aonorin/oryol,floooh/oryol,aonorin/oryol,aonorin/oryol,aonorin/oryol,aonorin/oryol,aonorin/oryol,floooh/oryol,floooh/oryol,aonorin/oryol,floooh/oryol,floooh/oryol,floooh/oryol | 030b5129d7f4693d8425740c0639a007c46902a7 |
#ifdef __cplusplus
extern "C" {
#endif
typedef void* COptions;
COptions newCOptions(const char*, const char*, const char*);
#ifdef __cplusplus
}
#endif
| typedef void* COptions;
COptions newCOptions(const char*, const char*, const char*);
| ---
+++
@@ -1,2 +1,8 @@
-typedef void* COptions;
-COptions newCOptions(const char*, const char*, const char*);
+#ifdef __cplusplus
+extern "C" {
+#endif
+ typedef void* COptions;
+ COptions newCOptions(const char*, const char*, const char*);
+#ifdef __cplusplus
+}
+#endif | Add back the C++ extern
| mit | Julian/libopenzwave-cffi,Julian/libopenzwave-cffi,Julian/libopenzwave-cffi | 6d53dd07a03c4bd24b9ca75cbbfe1c9fc3d4ff1f |
#ifndef __JniHelpersCommon_h__
#define __JniHelpersCommon_h__
// Disable some annoying compiler warnings
#if WIN32
#pragma warning(disable: 4996) // "Security" warnings for vsnprintf
#endif
#if WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include <jni.h>
#define kTypeInt "I"
#define kType... | #ifndef __JniHelpersCommon_h__
#define __JniHelpersCommon_h__
// Disable some annoying compiler warnings
#if WIN32
#pragma warning(disable: 4996) // "Security" warnings for vsnprintf
#endif
#if WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include <jni.h>
#define kTypeInt "I"
#define kType... | ---
+++
@@ -24,8 +24,8 @@
// Common Java classes
#define kTypeJavaClass(x) "Ljava/lang/" #x ";"
-#define kTypeJavaException "L/java/lang/Exception"
-#define kTypeJavaString "Ljava/lang/String"
+#define kTypeJavaException "Ljava/lang/Exception;"
+#define kTypeJavaString "Ljava/lang/String;"
// Array builder mac... | Fix type signatures for some java bulit-ins
| apache-2.0 | spotify/JniHelpers,spotify/JniHelpers,spotify/JniHelpers,spotify/JniHelpers | 10491403f35d32d63537fb6409fb6282d9e480d3 |
#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# define _SODIUM_C99(X)
#else
# define _SODIUM_C99(X) X
#endif
unsigned char *_sodium_alignedcal... |
#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __cplusplus
# define _SODIUM_C99(X) X
#else
# define _SODIUM_C99(X)
#endif
unsigned char *_sodium_alignedcalloc(unsigned char ** const unaligned_p,
... | ---
+++
@@ -10,10 +10,10 @@
extern "C" {
#endif
-#ifndef __cplusplus
+#if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
+# define _SODIUM_C99(X)
+#else
# define _SODIUM_C99(X) X
-#else
-# define _SODIUM_C99(X)
#endif
unsigned char *_sodium_alignedcalloc(unsigned char ** con... | Define _SODIUM_C99 as empty on retarded compilers, not only when using C++
| isc | eburkitt/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,tml/libsodium,soumith/libsodium,eburkitt/libsodium,mvduin/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,zhuqling/libsodium,netroby/libsodium,pmienk/libsodium,eburkitt/libsodium,donpark/libsodium,GreatFruitOmsk/libsodium,optedoblivion/android... | 81321c880914cd7de46c1234d3cc73eaedd1350e |
#include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>
#include <unistd.h>
#include "choices.h"
#include "config.h"
#include "io.h"
#include "ui.h"
void usage();
void version();
int
main(int argc,char **argv)
{
int ch;
struct choices *cs;
while ((ch = getopt(argc, argv, "hv")) != -1)
switch (ch) {
case... | #include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>
#include <unistd.h>
#include "choices.h"
#include "config.h"
#include "io.h"
#include "ui.h"
void usage();
void version();
int
main(int argc,char **argv)
{
int ch;
struct choices *cs;
while ((ch = getopt(argc, argv, "hv")) != -1)
switch (ch) {
case... | ---
+++
@@ -37,7 +37,7 @@
void
usage()
{
- fprintf(stderr, "usage: pick [-h]\n");
+ fprintf(stderr, "usage: pick [-h] [-v]\n");
fprintf(stderr, " -h display this help message and exit\n");
fprintf(stderr, " -v display the version and exit\n");
exit(EX_USAGE); | Correct usage message option list.
| mit | DBOTW/pick,prahlad37/pick,prahlad37/pick,GBuella/pick,temochka/pick,DBOTW/pick,thoughtbot/pick,temochka/pick,calleerlandsson/pick,DBOTW/pick,prahlad37/pick,thoughtbot/pick,thoughtbot/pick,calleerlandsson/pick,calleerlandsson/pick,thoughtbot/pick,GBuella/pick,prahlad37/pick | f4131aca5d93830c9559440d19cf66aa1838d10b |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <arpa/inet.h>
#include "idx.h"
int main(int argc, char **argv){
if(argc<2){
printf("Usage: \n");
printf("readimages t10k-images-idx3-ubyte \n");
exit(1);
}
char *slabelfname = argv[1];
IDX3_DATA idxdata;
if(!fr... | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <arpa/inet.h>
#include "idx.h"
int main(int argc, char **argv){
if(argc<2){
printf("Usage: \n");
printf("readlabels t10k-labels-idx1-ubyte \n");
exit(1);
}
char *slabelfname = argv[1];
IDX1_DATA idxdata;
if(!fr... | ---
+++
@@ -7,22 +7,42 @@
int main(int argc, char **argv){
if(argc<2){
printf("Usage: \n");
- printf("readlabels t10k-labels-idx1-ubyte \n");
+ printf("readimages t10k-images-idx3-ubyte \n");
exit(1);
}
char *slabelfname = argv[1];
- IDX1_DATA idxdata;
- if(!fread_id... | Implement a simple ASCII text image dumper.
| mit | spytheman/MNIST-idx1-and-idx3-file-readers | 8114b3e7e5438de48b5cf1c1e2454debb6cf96cc |
/*
* Copyright (c) 2012, Nadir Sampaoli
* See the LICENSE for more information
*/
#include "memory.h"
#include <stdlib.h>
#include <stdio.h>
static uint8_t *memory_area;
void allocmemory(void)
{
while(!memory_area) {
memory_area = malloc(MEM_SIZE * sizeof(uint8_t));
}
}
inline uint8_t getmembyte(... | /*
* Copyright (c) 2012, Nadir Sampaoli
* See the LICENSE for more information
*/
#include "memory.h"
#include <stdlib.h>
#include <stdio.h>
static uint8_t *memory_area;
void allocmemory(void)
{
while(!memory_area) {
memory_area = malloc(MEM_SIZE * sizeof(uint8_t));
}
}
uint8_t getmembyte(uint16_... | ---
+++
@@ -16,12 +16,12 @@
}
}
-uint8_t getmembyte(uint16_t addr)
+inline uint8_t getmembyte(uint16_t addr)
{
return *(memory_area + addr);
}
-uint16_t getmemword(uint16_t addr)
+inline uint16_t getmemword(uint16_t addr)
{
return (getmembyte(addr+1) << 8 | getmembyte(addr));
} | Change "getmembyte" and "getmemword" to inline functions
| mit | nadirs/dmgemu,nadirs/dmgemu,nadirs/dmgemu,nadirs/dmgemu | 18ca3c88bfab828cf26f5a184cfa30ba012089e4 |
#include "e.h"
#include "e_mod_main.h"
#include "e_mod_config.h"
#include "e_kbd_int.h"
/* local variables */
static E_Kbd_Int *ki = NULL;
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" };
EAPI void *
e_modapi_init(E_Module *m)
{
if (!il_kbd_config_init(m)) return NULL;
ki = e_kbd_int... | #include "e.h"
#include "e_mod_main.h"
#include "e_mod_config.h"
#include "e_kbd_int.h"
/* local variables */
static E_Kbd_Int *ki = NULL;
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" };
EAPI void *
e_modapi_init(E_Module *m)
{
if (!il_kbd_config_init(m)) return NULL;
ki = e_kbd_int... | ---
+++
@@ -13,7 +13,8 @@
{
if (!il_kbd_config_init(m)) return NULL;
- ki = e_kbd_int_new(mod_dir, mod_dir, mod_dir);
+ ki = e_kbd_int_new(il_kbd_cfg->mod_dir,
+ il_kbd_cfg->mod_dir, il_kbd_cfg->mod_dir);
return m;
} | Use correct module directory when making keyboard.
Previous commit fixed compiler warnings also.
git-svn-id: 6ac5796aeae0cef97fb47bcc287d4ce899c6fa6e@43875 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
| bsd-2-clause | jordemort/e17,jordemort/e17,jordemort/e17 | aba2ec8c709b9bb5b2484e86d8f108b0ae0932d4 |
/*
* Copyright (C) 2008-2013 The Communi Project
*
* This example is free, and not covered by the LGPL license. There is no
* restriction applied to their modification, redistribution, using and so on.
* You can study them, modify them, use them in your own program - either
* completely or partially.
*/
#ifndef... | /*
* Copyright (C) 2008-2013 The Communi Project
*
* This example is free, and not covered by the LGPL license. There is no
* restriction applied to their modification, redistribution, using and so on.
* You can study them, modify them, use them in your own program - either
* completely or partially.
*/
#ifndef... | ---
+++
@@ -29,8 +29,8 @@
static Document* instance(IrcBuffer* buffer = 0);
public slots:
- void addBuffer(IrcBuffer* buffer);
- void removeBuffer(IrcBuffer* buffer);
+ static void addBuffer(IrcBuffer* buffer);
+ static void removeBuffer(IrcBuffer* buffer);
private slots:
void receiveMessa... | Make Document::add() and remove() static
| bsd-3-clause | jpnurmi/communi-desktop,sevanteri/communi-desktop,gdamjan/communi-desktop,communi/communi-desktop,communi/communi-desktop | 8bf1dce53748298038119b458ea86a2e6b2ad15b |
#include <stdio.h>
int c;
__thread int d;
register int R1 __asm__ ("%" "r15");
int main(void)
{
c = 3;
R1 = 5;
d = 4;
printf("C: %d\n", c);
printf("D: %d\n", d);
printf("R1: %d\n", R1);
R1 *= 2;
printf("R1: %d\n", R1);
return 0;
}
| #include <stdio.h>
int c;
__thread int d;
register int R1 __asm__ ("%" "i5");
int main(void)
{
c = 3;
R1 = 5;
d = 4;
printf("C: %d\n", c);
printf("D: %d\n", d);
printf("R1: %d\n", R1);
R1 *= 2;
printf("R1: %d\n", R1);
return 0;
}
| ---
+++
@@ -2,7 +2,7 @@
int c;
__thread int d;
-register int R1 __asm__ ("%" "i5");
+register int R1 __asm__ ("%" "r15");
int main(void)
{ | Fix gcc global reg extension test to work.
Had wrong register before.
| bsd-3-clause | dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps | 500aedded80bd387484abfe9a6d7b8b4b591015d |
#ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_
#define _NPY_ARRAY_CONVERT_DATATYPE_H_
NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);
NPY_NO_EXPORT int
PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp);
NPY_NO_EXPORT PyArray_VectorUnaryFunc *
PyArray_GetCastFunc(PyArray_De... | #ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_
#define _NPY_ARRAY_CONVERT_DATATYPE_H_
NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);
#endif
| ---
+++
@@ -4,4 +4,25 @@
NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);
+NPY_NO_EXPORT int
+PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp);
+
+NPY_NO_EXPORT PyArray_VectorUnaryFunc *
+PyArray_GetCastFunc(PyArray_Descr *descr, int type_num);
+
+NPY_NO_EXPORT ... | Add API for datatype conversion.
git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6920 94b884b6-d6fd-0310-90d3-974f1d3f35e1
| bsd-3-clause | Ademan/NumPy-GSoC,chadnetzer/numpy-gaurdro,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,teoliphant/numpy-refactor,Ademan/NumPy-GSoC,illume/numpy3k,efiring/numpy-work,efiring/numpy-work,jasonmccampbell/num... | 2d3fb89f05d62306694fb4d2a9e45de86e737b0d |
#pragma once
#include "uitypes.h"
#include <QtWidgets/QLabel>
#include <QtWidgets/QToolButton>
#include <QtCore/QParallelAnimationGroup>
#include <QtWidgets/QScrollArea>
#include <QtCore/QPropertyAnimation>
class BINARYNINJAUIAPI ExpandableGroup : public QWidget
{
Q_OBJECT
private:
QToolButton* m_button;
QLabel... | #pragma once
#include "uitypes.h"
#include <QtWidgets/QToolButton>
#include <QtCore/QParallelAnimationGroup>
#include <QtWidgets/QScrollArea>
#include <QtCore/QPropertyAnimation>
class BINARYNINJAUIAPI ExpandableGroup : public QWidget
{
Q_OBJECT
private:
QToolButton* m_button;
QParallelAnimationGroup* m_animati... | ---
+++
@@ -1,6 +1,7 @@
#pragma once
#include "uitypes.h"
+#include <QtWidgets/QLabel>
#include <QtWidgets/QToolButton>
#include <QtCore/QParallelAnimationGroup>
#include <QtWidgets/QScrollArea>
@@ -12,6 +13,7 @@
private:
QToolButton* m_button;
+ QLabel* m_title;
QParallelAnimationGroup* m_animation;
... | Fix UI arrow artifact in Cross References and Search widgets.
| mit | Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api | a5eb8bfdc1affa6d2330484800808c4d34f23103 |
#include <testharness.h>
#include <stdio.h>
void BuildWord(char * pchWord) {
int i;
char * pch = pchWord;
/* original code:
* while ((i = *pch++) != '\0') { }
*/
do {
i = *pch;
// printf("i = '%c'\n",i);
pch++;
} while (i != '\0');
printf("%s\n",pchWord);
}
... | #include <testharness.h>
#include <stdio.h>
void BuildWord(char * pchWord) {
int i;
char * pch = pchWord;
/* original code:
* while ((i = *pch++) != '\0') { }
*/
do {
i = *pch;
pch++;
} while (i != '\0');
printf("%s\n",pchWord);
}
int main() {
char *test = "foo";... | ---
+++
@@ -11,6 +11,7 @@
do {
i = *pch;
+ // printf("i = '%c'\n",i);
pch++;
} while (i != '\0');
@@ -20,6 +21,9 @@
int main() {
char *test = "foo";
+ test++;
+ test--;
+
BuildWord(test);
SUCCESS; | Switch the world over to the new 'paper' solver. Local regression tests
indicate that it shouldn't be that bad: new models and wrappers have been
added to support it. INFERBOX=infer is now the new solver, INFERBOX=old
gives the old behavior (will be removed later).
| bsd-3-clause | samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c | c49c6113ab8ca9293cad0fc766c6b4bd90e22a75 |
#include <stdlib.h>
#include <stdio.h>
#include types.c
#include <string.h>
/* We can:
Set something equal to something
Function calls
Function definitions
Returning things -- delimiter '<'
Printing things
Iffing */
struct call parseCall(char* statement);
struct function parseFunction(char* statemen... | #include <stdlib.h>
#include <stdio.h>
#include types.c
#include <string.h>
/* We can:
Set something equal to something
Function calls
Function definitions
Returning things -- delimiter '<'
Printing things
Iffing */
struct call parseCall(char* statement);
struct function parseFunction(char* statemen... | ---
+++
@@ -15,7 +15,7 @@
struct function parseFunction(char* statement);
char* fixSpacing(char* code) {
- char* fixedCode = calloc(sizeof(char), strlen(code) + 1);
+ char* fixedCode = malloc(sizeof(char) * (strlen(code) + 1));
fixedCode = strcpy(fixedCode, code);
char* doubleSpace = strstr(fixedCode, " ... | Refactor the space tokenizer to be its own function; parse() no longer exists.
| mit | aacoppa/final,aacoppa/final | 64c9fe48234cd49ae730f3d2f80a0b7eb3c6d897 |
/*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(HandlingPass)
SLTM(HandlingPipe)
SLTM(Request)
SLTM(Response)
SLTM(Stat... | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(Response)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_U... | ---
+++
@@ -12,6 +12,8 @@
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(ClientAddr)
+SLTM(HandlingPass)
+SLTM(HandlingPipe)
SLTM(Request)
SLTM(Response)
SLTM(Status) | Add shmlog tags for pipe and pass handling
git-svn-id: 7d4b18ab7d176792635d6a7a77dd8cbbea8e8daa@131 d4fa192b-c00b-0410-8231-f00ffab90ce4
| bsd-2-clause | CartoDB/Varnish-Cache,wikimedia/operations-debs-varnish,ssm/pkg-varnish,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,CartoDB/Varnish-Cache,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,ssm/pkg-varnish,ssm/pkg-varnish,ssm/pkg-varnish,CartoDB/Varnish-Cache,ssm/pkg-varnish | 396a83183195021106acb9262bd7b56242101f20 |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* testpath.c :+: :+: :+: ... | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* testpath.c :+: :+: :+: ... | ---
+++
@@ -6,20 +6,17 @@
/* By: sle-guil <sle-guil@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/03/11 16:25:34 by sle-guil #+# #+# */
-/* Updated: 2015/03/11 16:48:51 by sle-guil... | Check dir have to be done
| mit | SuliacLEGUILLOU/minishell | 00e8765b3a2db414e655021fadf86f420c11d4a5 |
/*
* Copyright (c) 2008, 2009, Wayne Meissner
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list ... |
#ifndef _POINTER_H
#define _POINTER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "AbstractMemory.h"
extern void rbffi_Pointer_Init(VALUE moduleFFI);
extern void rbffi_NullPointer_Init(VALUE moduleFFI);
extern VALUE rbffi_Pointer_NewInstance(void* addr);
extern VALUE rbffi_PointerClass;
extern VALUE rbffi_NullP... | ---
+++
@@ -1,6 +1,33 @@
+/*
+ * Copyright (c) 2008, 2009, Wayne Meissner
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the abo... | Remove some leftover null pointer vars
| bsd-3-clause | majioa/ffi,tduehr/ffi,sparkchaser/ffi,ferventcoder/ffi,majioa/ffi,mvz/ffi,yghannam/ffi,tduehr/ffi,sparkchaser/ffi,ferventcoder/ffi,tduehr/ffi,MikaelSmith/ffi,ffi/ffi,majioa/ffi,ffi/ffi,mvz/ffi,sparkchaser/ffi,sparkchaser/ffi,MikaelSmith/ffi,tduehr/ffi,mvz/ffi,yghannam/ffi,ferventcoder/ffi,MikaelSmith/ffi,mvz/ffi,yghann... | 4020b05b515c5a486de3224739e370dedfb5c005 |
/*
* Copyright 2016 Chris Marshall
*
* 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 ... | /*
* Copyright 2016 Chris Marshall
*
* 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 ... | ---
+++
@@ -26,7 +26,7 @@
#define MAX_VARINT_SIZE 10
// Initial write buffer
-#define INITIAL_BUFFER_SIZE 1024
+#define INITIAL_BUFFER_SIZE 1024 * 8
#ifdef __cplusplus | Increase initial buffer to 8192 bytes
| apache-2.0 | ChrisRx/quickavro,ChrisRx/quickavro | 7f2afc7a1926bf85cf3b990ebe4ed1fc70968251 |
/**
* @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;... | /**
* @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 hos... | ---
+++
@@ -11,6 +11,8 @@
int socket;
int error;
char *buf;
+ unsigned int max_token;
+ struct _ReQL_Cur_s **cursor;
};
typedef struct _ReQL_Conn_s _ReQL_Conn_t;
| Add token counter and cursor array to connections.
| apache-2.0 | grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core | 394a095665a5ac4f465d194b46da6bf77a340958 |
#define DUMMY 0
#define FUNC 1
#define PARAM 2
#define XFER_FUNC 3
#define ALLOC_FUNC 4
#define ACTION_PARAM 5
#define NOSUPP_FUNC 6
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_const_ptr;
int is_mapped;
i... | #define DUMMY 0
#define FUNC 1
#define PARAM 2
#define XFER_FUNC 3
#define ALLOC_FUNC 4
#define ACTION_PARAM 5
#define NOSUPP_FUNC 6
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_const_ptr;
int is_mapped;
in... | ---
+++
@@ -5,6 +5,7 @@
#define ALLOC_FUNC 4
#define ACTION_PARAM 5
#define NOSUPP_FUNC 6
+
struct token {
int tok_type;
@@ -24,6 +25,7 @@
int in_param;
int out_param;
int extract;
+ int pseudo;
struct node *next;
struct node *prev;
struct node *param_list; | Add boolean node attirbute "pseudo" to describe whether a given system
call is a "normal" one, or a "pseudo" call. This needs to be know
by the receivers where normal syscalls can be invoked directly by their
name, but pseudo calls must have hand written code to handle their
functionality.
| apache-2.0 | djw8605/htcondor,htcondor/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,neurodebian/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/condor,htcondor/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,... | 950cd3117ba5a838c2ccc29c3deed419f591ec52 |
//
// ProfileViewController.h
// PlayPlan
//
// Created by Zeacone on 15/11/8.
// Copyright © 2015年 Zeacone. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PlayPlan.h"
@class ProfileViewController;
@protocol MainDelegate <NSObject>
- (void)dismissViewController:(ProfileViewController *)mainViewControl... | //
// ProfileViewController.h
// PlayPlan
//
// Created by Zeacone on 15/11/8.
// Copyright © 2015年 Zeacone. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PlayPlan.h"
@class ProfileViewController;
@protocol MainDelegate <NSObject>
- (void)dismissViewController:(MainViewController *)mainViewController... | ---
+++
@@ -13,7 +13,7 @@
@protocol MainDelegate <NSObject>
-- (void)dismissViewController:(MainViewController *)mainViewController;
+- (void)dismissViewController:(ProfileViewController *)mainViewController;
@end
| Add delegate for profile view controller.
| mit | Zeacone/PlayPlan,Zeacone/PlayPlan | df538417a40cde965fa2d16ceab38322b17a8097 |
//
// HATransparentView.h
// HATransparentView
//
// Created by Heberti Almeida on 13/09/13.
// Copyright (c) 2013 Heberti Almeida. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HATransparentView : UIView
- (void)open;
- (void)close;
@end
| //
// HATransparentView.h
// HATransparentView
//
// Created by Heberti Almeida on 13/09/13.
// Copyright (c) 2013 Heberti Almeida. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HATransparentView : UIView
@property (strong, nonatomic) UIColor *color;
@property (nonatomic) CGFloat *alpha;
- (void)op... | ---
+++
@@ -10,9 +10,6 @@
@interface HATransparentView : UIView
-@property (strong, nonatomic) UIColor *color;
-@property (nonatomic) CGFloat *alpha;
-
- (void)open;
- (void)close;
| Fix disabled interaction on device
| mit | ernestopino/HATransparentView,hebertialmeida/HATransparentView,amannayak0007/HATransparentView | ac62d9b1e647fa02437ea49336460e32988138b0 |
#ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED
#define GR_SUPPORT_GLES2 1
// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer 0
#define GL_IMG_multisampled_render_to_texture 0
#include <GLES2/gl2.h>
#include <... | #ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED
#define GR_SUPPORT_GLES2 1
// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer 0
#define GL_IMG_multisampled_render_to_texture 0
#include <GLES2/gl2.h>
#include <... | ---
+++
@@ -21,4 +21,14 @@
// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START 0
+// Using the static vb precludes batching rect-to-rect draws
+// because there are matrix changes between each one.
+// Chrome was getting top performance on Windows with
+// batched rect-to-... | Make chrome use the static square vb when drawing rects.
Review URL: http://codereview.appspot.com/4280053/
| bsd-3-clause | csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia | c5949064707026e60dd7f370870fd76be5f2c78a |
#ifndef __MACROS_H__
#define __MACROS_H__
/**
* @file macros.h
*
* This file contains simple helper macros
*/
/**
* @addtogroup internal_util_helper_macros "(internal) helper macros"
*
* This group contains helper macros for internal use only.
*
* @{
*/
/**
* Computes the maximum value of the two passed v... | #ifndef __MACROS_H__
#define __MACROS_H__
/**
* @file macros.h
*
* This file contains simple helper macros
*/
/**
* @addtogroup internal_util_helper_macros "(internal) helper macros"
*
* This group contains helper macros for internal use only.
*
* @{
*/
/**
* Computes the maximum value of the two passed v... | ---
+++
@@ -24,10 +24,9 @@
* @note Opens own scope, so the temp variables do not show up outside of the
* macro.
*/
-#define MAX(x,y) \
- ({ __typeof__ (x) _x = (x); \
- __typeof__ (y) _y = (y); \
- _x > _y ? _x : _y; })
+#define MAX(x,y) ... | Modify MAX(x,y) to not contain a scope
| lgpl-2.1 | waysome/libreset,waysome/libreset | 0476f5a59b5285fa625089167ef3b373525060b8 |
#pragma once
#include <string>
#include "random.h"
#include "ray.h"
#include "vector.h"
namespace amber {
namespace lens {
template <typename RealType>
struct Lens {
using real_type = RealType;
using ray_type = Ray<real_type>;
using vector3_type = Vector3<real_type>;
static constexpr real_type kFoca... | #pragma once
#include <string>
#include "random.h"
#include "ray.h"
#include "vector.h"
namespace amber {
namespace lens {
template <typename RealType>
struct Lens {
using real_type = RealType;
using ray_type = Ray<real_type>;
using vector3_type = Vector3<real_type>;
static constexpr real_type kFoca... | ---
+++
@@ -19,8 +19,8 @@
virtual ~Lens() {}
- virtual std::string to_string() const;
- virtual ray_type sample_ray(const vector3_type&, Random&) const;
+ virtual std::string to_string() const = 0;
+ virtual ray_type sample_ray(const vector3_type&, Random&) const = 0;
};
} | Fix a trivial bug that causes a compilation error with clang++ -O0
| mit | etheriqa/amber | 9e4acaef861510974200e2744263409dcecda4b4 |
//
// OctoKit.h
// OctoKit
//
// Created by Piet Brauer on 25/08/15.
// Copyright (c) 2015 nerdish by nature. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for OctoKit.
FOUNDATION_EXPORT double OctoKitVersionNumber;
//! Project version string for OctoKit.
FOUNDATION_EXPORT ... | //
// OctoKit.h
// OctoKit
//
// Created by Piet Brauer on 25/08/15.
// Copyright (c) 2015 nerdish by nature. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for OctoKit.
FOUNDATION_EXPORT double OctoKitVersionNumber;
//! Project version string for OctoKit.
FOUNDATION_EXPORT const unsi... | ---
+++
@@ -6,7 +6,7 @@
// Copyright (c) 2015 nerdish by nature. All rights reserved.
//
-#import <UIKit/UIKit.h>
+#import <Foundation/Foundation.h>
//! Project version number for OctoKit.
FOUNDATION_EXPORT double OctoKitVersionNumber; | Use Foundation instead of UIKit | mit | nerdishbynature/octokit.swift,nerdishbynature/octokit.swift,nerdishbynature/octokit.swift,phatblat/octokit.swift,phatblat/octokit.swift | 11fb3304ba88fa84e2349c08f73b4ffaf0a8fd89 |
#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++ cl... | #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 AliBtoJP... | ---
+++
@@ -6,11 +6,6 @@
#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... | Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
| bsd-3-clause | mkrzewic/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,shahor02/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,alisw/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,shahor02/AliRoot,miranov25/AliRoot,alisw/AliRoot,jgrosseo... | 7bfdc0e00b77c05fe0de79da3eaa6b0009418926 |
//
// NSURL+Pinmark.h
// Pinmark
//
// Created by Kyle Stevens on 12/24/13.
// Copyright (c) 2013 kilovolt42. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSURL (Pinmark)
/**
* Creates a dictionary of the query parameters in which fields are keys for the corresponding values.
* Does not... | //
// NSURL+Pinmark.h
// Pinmark
//
// Created by Kyle Stevens on 12/24/13.
// Copyright (c) 2013 kilovolt42. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSURL (Pinmark)
- (NSDictionary *)queryParameters;
@end
| ---
+++
@@ -10,6 +10,12 @@
@interface NSURL (Pinmark)
+/**
+ * Creates a dictionary of the query parameters in which fields are keys for the corresponding values.
+ * Does not support array parameters at this time.
+ *
+ * @return A dictionary of query parameters.
+ */
- (NSDictionary *)queryParameters;
@end | Add documentation for NSURL category
| mit | kilovolt42/Pinmarker,kilovolt42/Pinmarker,kilovolt42/Pinmarker | d484ae979059e596c9fb1d4fb02008f86b0e1bd6 |
#ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_
#ifdef COBRA_RESTRICT
#define COBRA_RESTRICT_BREAK \
break; \
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
if (EXP > NUM) \
break; \
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
if ( EXP > NUM ) \
return false; \
#else
#defin... | #ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_
#ifdef COBRA_RESTRICT
#define COBRA_RESTRICT_BREAK \
break; \
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
if (EXP > NUM) \
break; \
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
if ( EXP > NUM ) \
return false; \
#else
#defin... | ---
+++
@@ -17,8 +17,8 @@
#else
#define COBRA_RESTRICT_BREAK
-#define COBRA_RESTRICT_N_BREAK( EXP, NUM )
-#define COBRA_RESTRICT_N_RETURN_FALSE( EXP, NUM )
+#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM )
+#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM )
#endif
| Fix compilation error of RestrictionMacro.h in sf1 if COBRA_RESTRICT is not defined.
| apache-2.0 | izenecloud/izenelib,izenecloud/izenelib,pombredanne/izenelib,pombredanne/izenelib,izenecloud/izenelib,izenecloud/izenelib,pombredanne/izenelib,pombredanne/izenelib | 6bf6d60fb44205bab201688d949e3937ee8dbd26 |
#ifndef CPR_TYPES_H
#define CPR_TYPES_H
#include <map>
#include <string>
namespace cpr {
class CaseInsenstiveCompare {
public:
bool operator()(const std::string& a, const std::string& b) const;
private:
static void char_to_lower(char& c);
static std::string to_lower(const std... | #ifndef CPR_TYPES_H
#define CPR_TYPES_H
#include <map>
#include <string>
namespace cpr {
class CaseInsenstiveCompare {
public:
bool operator()(const std::string& a, const std::string& b) const;
private:
static void char_to_lower(char& c);
static std::string to_lower(const std... | ---
+++
@@ -15,8 +15,8 @@
static std::string to_lower(const std::string& a);
};
- typedef std::map<std::string, std::string, CaseInsenstiveCompare> Header;
- typedef std::string Url;
+ using Header = std::map<std::string, std::string, CaseInsenstiveCompare>;
+ using Url = std::string;
}... | Use C++11 `using` instead of `typedef` | mit | skystrife/cpr,msuvajac/cpr,SuperV1234/cpr,SuperV1234/cpr,skystrife/cpr,msuvajac/cpr,whoshuu/cpr,whoshuu/cpr,msuvajac/cpr,skystrife/cpr,SuperV1234/cpr,whoshuu/cpr | 062bc13039462e6f3f9baaea835ff9b863a18daf |
#ifndef TE_OBSERVER_H
#define TE_OBSERVER_H
#include <vector>
#include <memory>
#include <cassert>
namespace te
{
template <class EventType>
class Observer
{
public:
virtual ~Observer() {}
virtual void onNotify(const EventType& evt) = 0;
};
template <class EventType>
class Notifier
{... | #ifndef TE_OBSERVER_H
#define TE_OBSERVER_H
namespace te
{
template <class EventType>
class Observer
{
public:
virtual ~Observer() {}
virtual void onNotify(const EventType& evt) = 0;
};
}
#endif
| ---
+++
@@ -1,5 +1,9 @@
#ifndef TE_OBSERVER_H
#define TE_OBSERVER_H
+
+#include <vector>
+#include <memory>
+#include <cassert>
namespace te
{
@@ -10,6 +14,29 @@
virtual ~Observer() {}
virtual void onNotify(const EventType& evt) = 0;
};
+
+ template <class EventType>
+ class Notifier
+... | Add Notifier base class, complements Observer
| mit | evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine | 60ea97b28f20e5a191cdae6ff1bde978cdcad85e |
//PARAM: --enable ana.int.enums --disable ana.int.def_exc
int main(){
int top = rand();
int x,y;
if(top){
x = 1;
} else{
x = 0;
}
assert(x < 2);
assert(x < 1); // UNKNOWN!
assert(x < 0); // FAIL
assert(x <= 2);
assert(x <= 1);
assert(x <= 0); // UNKNOWN!
... | //PARAM: --enable ana.int.enums --disable ana.int.def_exc
int main(){
int top = rand();
int x,y;
if(top){
x = 1;
} else{
x = 0;
}
assert(x<2);
return 0;
}
| ---
+++
@@ -9,6 +9,22 @@
x = 0;
}
- assert(x<2);
+ assert(x < 2);
+ assert(x < 1); // UNKNOWN!
+ assert(x < 0); // FAIL
+
+ assert(x <= 2);
+ assert(x <= 1);
+ assert(x <= 0); // UNKNOWN!
+ assert(x <= -1); //FAIL
+
+ assert(x > -1);
+ assert(x > 0); //UNKNOWN!
+ asser... | Add more assert statements to test case
| mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer | adebbe22c28891ccc25941d7679a9641972a7a25 |
/* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef CRATE_DEMO_GRAPHICS_MANAGER_H
#define CRATE_DEMO_GRAPHICS_MANAGER_H
#include "common/graphics_manager_base.h"
#include <d3d11.h>
#include "DirectXMath... | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef CRATE_DEMO_GRAPHICS_MANAGER_H
#define CRATE_DEMO_GRAPHICS_MANAGER_H
#include "common/graphics_manager_base.h"
#include <d3d11.h>
namespace CrateDemo ... | ---
+++
@@ -10,10 +10,17 @@
#include "common/graphics_manager_base.h"
#include <d3d11.h>
+#include "DirectXMath.h"
namespace CrateDemo {
class GameStateManager;
+
+struct Vertex {
+ DirectX::XMFLOAT3 pos;
+ DirectX::XMFLOAT4 color;
+};
+
class GraphicsManager : public Common::GraphicsManagerBase {
public:... | CRATE_DEMO: Create Vertex struct to hold vertex info
| apache-2.0 | RichieSams/thehalflingproject,RichieSams/thehalflingproject,RichieSams/thehalflingproject | 69da97a9d0b256a4d9448bfa5f9569ac38156c1f |
#pragma once
#define NTDDI_VERSION 0x0A000007 // NTDDI_WIN10_19H1
#define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10
#define WINVER 0x0A00
#include <ShellScalingApi.h>
#include <Shlobj.h>
#include <ShObjIdl.h>
#include <Windows.h>
#include <wrl.h>
#undef min
#undef max
#include <algorithm>
#include <unordered_map>
... | #pragma once
#define NTDDI_VERSION 0x06010000
#define WINVER 0x0601
#define _WIN32_WINNT 0x0601
#include <ShellScalingApi.h>
#include <Shlobj.h>
#include <ShObjIdl.h>
#include <Windows.h>
#include <wrl.h>
#undef min
#undef max
#include <algorithm>
#include <unordered_map>
namespace WRL
{
using namespace Microsoft... | ---
+++
@@ -1,8 +1,8 @@
#pragma once
-#define NTDDI_VERSION 0x06010000
-#define WINVER 0x0601
-#define _WIN32_WINNT 0x0601
+#define NTDDI_VERSION 0x0A000007 // NTDDI_WIN10_19H1
+#define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10
+#define WINVER 0x0A00
#include <ShellScalingApi.h>
#include <Shlobj.h> | Drop support for Windows 7.
| mit | TautvydasZilys/FileSystemSearch,TautvydasZilys/FileSystemSearch,TautvydasZilys/FileSystemSearch | 352fd8a38a7ca9bed62801969d9e0188f6b7e3ad |
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_ACCESS_SPECIFIERS_H
#define TEST_INTEROP_CXX_CLASS_INPUTS_ACCESS_SPECIFIERS_H
class PublicPrivate {
public:
int PublicMemberVar;
static int PublicStaticMemberVar;
void publicMemberFunc();
typedef int PublicTypedef;
struct PublicStruct {};
enum PublicEnum { PublicEnumV... | class PublicPrivate {
public:
int PublicMemberVar;
static int PublicStaticMemberVar;
void publicMemberFunc();
typedef int PublicTypedef;
struct PublicStruct {};
enum PublicEnum { PublicEnumValue1 };
enum { PublicAnonymousEnumValue };
enum PublicClosedEnum {
PublicClosedEnumValue1
} __attribute__(... | ---
+++
@@ -1,3 +1,6 @@
+#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_ACCESS_SPECIFIERS_H
+#define TEST_INTEROP_CXX_CLASS_INPUTS_ACCESS_SPECIFIERS_H
+
class PublicPrivate {
public:
int PublicMemberVar;
@@ -33,3 +36,5 @@
} __attribute__((enum_extensibility(open)));
enum PrivateFlagEnum {} __attribute__((flag_enum)... | Add header guards for test input headers
| apache-2.0 | harlanhaskins/swift,roambotics/swift,harlanhaskins/swift,gregomni/swift,JGiola/swift,stephentyrone/swift,allevato/swift,CodaFi/swift,rudkx/swift,gregomni/swift,JGiola/swift,jmgc/swift,apple/swift,jmgc/swift,rudkx/swift,atrick/swift,hooman/swift,tkremenek/swift,jckarter/swift,nathawes/swift,harlanhaskins/swift,roambotic... | 6c9ccbc59bb5d98785b5e45acd139704241ecebb |
/* headers */
#include <stdlib.h>
#include <time.h>
#include "lattice.h"
#include "clusters.h"
#include "io_helpers.h"
/* main body function */
int main(int argc, char ** argv)
{
int L; /* square lattice size */
double p; /* occupation probability of each lattice site */
int *lattice; /* lattice array */
... | /* headers */
#include <stdlib.h>
#include <time.h>
#include "lattice.h"
#include "clusters.h"
#include "io_helpers.h"
/* main body function */
int main(int argc, char ** argv)
{
int L; /* square lattice size */
double p; /* occupation probability of each lattice site */
int *lattice; /* lattice array */
... | ---
+++
@@ -12,18 +12,25 @@
int L; /* square lattice size */
double p; /* occupation probability of each lattice site */
int *lattice; /* lattice array */
+ unsigned int random_seed; /* random number generator seed */
/* read input arguments; if none provided fallback to default values */
- ... | [percolation] Allow passing RNG seed as program argument
| mit | cerisola/fiscomp,cerisola/fiscomp,cerisola/fiscomp | 8c47da315e5e6f11bb43c8fa66a2a66fbdaf7b9d |
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_
// This file declares common preprocessor configuration for the GPU process.
#incl... | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_
// This file declares common preprocessor configuration for the GPU process.
#incl... | ---
+++
@@ -9,7 +9,7 @@
#include "build/build_config.h"
-#if defined(OS_LINUX) && !defined(ARCH_CPU_X86)
+#if defined(OS_LINUX) && defined(ARCH_CPU_X86)
// Only define GLX support for Intel CPUs for now until we can get the
// proper dependencies and build setup for ARM. | Fix stupid error for Linux build.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/555096
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@37093 0039d316-1c4b-4281-b951-d872f2087c98
| bsd-3-clause | ropik/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,Crys... | b22391787ec21c5d40e545a59ad5780ea8f03868 |
// rdar://6533411
// RUN: %clang -MD -MF %t.d -S -x c -o %t.o %s
// RUN: grep '.*dependency-gen.*:' %t.d
// RUN: grep 'dependency-gen.c' %t.d
// RUN: %clang -S -M -x c %s -o %t.d
// RUN: grep '.*dependency-gen.*:' %t.d
// RUN: grep 'dependency-gen.c' %t.d
// PR8974
// XFAIL: win32
// RUN: rm -rf %t.dir
// RUN: mkdir ... | // rdar://6533411
// RUN: %clang -MD -MF %t.d -S -x c -o %t.o %s
// RUN: grep '.*dependency-gen.*:' %t.d
// RUN: grep 'dependency-gen.c' %t.d
// RUN: %clang -S -M -x c %s -o %t.d
// RUN: grep '.*dependency-gen.*:' %t.d
// RUN: grep 'dependency-gen.c' %t.d
// PR8974
// XFAIL: win32
// RUN: rm -rf %t.dir
// RUN: mkdir ... | ---
+++
@@ -10,8 +10,9 @@
// PR8974
// XFAIL: win32
// RUN: rm -rf %t.dir
-// RUN: mkdir %t.dir
-// RUN: echo > %t.dir/x.h
-// RUN: %clang -include %t.dir/x.h -MD -MF %t.d -S -x c -o %t.o %s
-// RUN: grep ' %t.dir/x.h' %t.d
+// RUN: mkdir -p %t.dir/a/b
+// RUN: echo > %t.dir/a/b/x.h
+// RUN: cd %t.dir
+// RUN: %cl... | Tweak this test a bit further to make it easier on grep. Who knows what
characters get dropped into the regular expression from %t.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@126361 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/cl... | 7acf4549932adde2961864023db47ebfde07440d |
// Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_POLICY_RBF_H
#define BITCOIN_POLICY_RBF_H
#include <txmempool.h>
/** The rbf state of unconfirmed transacti... | // Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_POLICY_RBF_H
#define BITCOIN_POLICY_RBF_H
#include <txmempool.h>
enum class RBFTransactionState {
UNKNO... | ---
+++
@@ -7,16 +7,27 @@
#include <txmempool.h>
+/** The rbf state of unconfirmed transactions */
enum class RBFTransactionState {
+ /** Unconfirmed tx that does not signal rbf and is not in the mempool */
UNKNOWN,
+ /** Either this tx or a mempool ancestor signals rbf */
REPLACEABLE_BIP125,
- ... | doc: Add doxygen comment to IsRBFOptIn
| mit | MarcoFalke/bitcoin,AkioNak/bitcoin,GroestlCoin/GroestlCoin,dscotese/bitcoin,ElementsProject/elements,litecoin-project/litecoin,anditto/bitcoin,jamesob/bitcoin,EthanHeilman/bitcoin,jambolo/bitcoin,ajtowns/bitcoin,pataquets/namecoin-core,tecnovert/particl-core,sstone/bitcoin,domob1812/namecore,mm-s/bitcoin,jlopp/statoshi... | fa9ee52556f493e4a896e2570ca1a3102d777d9a |
//
// MCKNetworkMock.h
// mocka
//
// Created by Markus Gasser on 26.10.2013.
// Copyright (c) 2013 konoma GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MCKNetworkMock;
@class MCKNetworkRequestMatcher;
@class MCKMockingContext;
typedef MCKNetworkRequestMatcher*(^MCKNetworkActivity)(id u... | //
// MCKNetworkMock.h
// mocka
//
// Created by Markus Gasser on 26.10.2013.
// Copyright (c) 2013 konoma GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MCKNetworkMock;
@class MCKNetworkRequestMatcher;
@class MCKMockingContext;
typedef MCKNetworkRequestMatcher*(^MCKNetworkActivity)(id u... | ---
+++
@@ -42,7 +42,7 @@
@end
-#define MCKNetwork _mck_getNetworkMock(self, __FILE__, __LINE__)
+#define MCKNetwork (id)_mck_getNetworkMock(self, __FILE__, __LINE__)
#ifndef MCK_DISABLE_NICE_SYNTAX
#define Network MCKNetwork
#endif | Make the network mock play nice with stubCall (…)
| mit | frenetisch-applaudierend/mocka,frenetisch-applaudierend/mocka | 98b8a0eb22fbc4012f9c9ac0a793a4822822f208 |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
long offset;
int expected_offset;
int error = 0;
offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
if (sizeof(void *) == 4) {
expected_offset = 8360;
} el... |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
int offset;
int expected_offset;
int error = 0;
offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
if (sizeof(void *) == 4) {
expected_offset = 8360;
} else... | ---
+++
@@ -10,11 +10,11 @@
int main (int argc, char *argv[])
{
- int offset;
+ long offset;
int expected_offset;
int error = 0;
- offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
+ offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
if (sizeof(void *) == 4) {
... | tests: Fix compilation of the ABI test on 64 bit architectures
Casting a pointer to a plain int will cause a compiler error, use long instead.
| bsd-3-clause | MOXfiles/orc,Distrotech/orc,ahmedammar/platform_external_gst_liborc,jpakkane/orc,jpakkane/orc,ahmedammar/platform_external_gst_liborc,MOXfiles/orc,ijsf/OpenWebRTC-orc,okuoku/nmosh-orc,MOXfiles/orc,Distrotech/orc,okuoku/nmosh-orc,mojaves/orc,Distrotech/orc,ijsf/OpenWebRTC-orc,mojaves/orc,ijsf/OpenWebRTC-orc,jpakkane/orc... | 42150430ce7cbcee73173c7b8302c24f2efbae76 |
#ifndef MCLISP_ALLOC_H_
#define MCLISP_ALLOC_H_
#include <array>
#include <cstddef>
#include <list>
#include "cons.h"
namespace mclisp
{
class ConsAllocator
{
public:
typedef std::size_t size_type;
ConsAllocator();
ConsCell* Allocate();
std::list<ConsCell*> Allocate(size_type n);
void Deallocate(ConsCell... | #ifndef MCLISP_ALLOC_H_
#define MCLISP_ALLOC_H_
#include <array>
#include <cstddef>
#include <list>
#include "cons.h"
namespace mclisp
{
class ConsAllocator
{
public:
typedef std::size_t size_type;
ConsAllocator();
ConsCell* Allocate();
std::list<ConsCell*> Allocate(size_type n);
void Deallocate(ConsCell... | ---
+++
@@ -25,7 +25,7 @@
static constexpr size_type max_heap_size() { return kMaxHeapSize; }
private:
- static constexpr size_type kMaxHeapSize = 1500;
+ static constexpr size_type kMaxHeapSize = 15000;
std::list<ConsCell*> free_list_;
std::array<ConsCell, kMaxHeapSize> heap_; | Increase max heap size to 15,000 ConsCells.
Unit tests were running out of heap, due to GC not being implemented
yet. Also, 15,000 is the value mentioned by McCarthy in the paper.
| mit | appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp | 6d0c9b749aad4a1801783d4a170542139792ebdd |
#ifndef __MOTORS_H_
#define __MOTORS_H_
#include <Servo.h>
#define MIDPOINT 90
class Motors {
private:
Servo port, vertical, starbord;
int port_pin, vertical_pin, starbord_pin;
public:
Motors(int p_pin, int v_pin, int s_pin);
void reset();
void go(int p, int v, int s);
void stop()... | #ifndef __MOTORS_H_
#define __MOTORS_H_
#include <Servo.h>
#define MIDPOINT 128
class Motors {
private:
Servo port, vertical, starbord;
int port_pin, vertical_pin, starbord_pin;
public:
Motors(int p_pin, int v_pin, int s_pin);
void reset();
void go(int p, int v, int s);
void stop(... | ---
+++
@@ -3,7 +3,7 @@
#include <Servo.h>
-#define MIDPOINT 128
+#define MIDPOINT 90
class Motors {
private: | Set MIDPOINT to 90 instead of 128 (servo lib goes from 0 to 180)
| mit | kavi87/openrov-cockpit,chaudhryjunaid/openrov-cockpit,chaudhryjunaid/openrov-cockpit,BrianAdams/openrov-cockpit,OpenROV/openrov-cockpit,kavi87/openrov-cockpit,BenjaminTsai/openrov-cockpit,BenjaminTsai/openrov-cockpit,spiderkeys/openrov-cockpit,BrianAdams/openrov-cockpit,spiderkeys/openrov-cockpit,BrianAdams/openrov-coc... | 6c02e1f26430e9fdc68f04c974d49b02816b40a5 |
#ifndef ENTRY_H
#define ENTRY_H
#include <string>
#include <memory>
namespace diaryengine {
class Entry
{
public:
Entry();
~Entry();
void setTitle(std::string title);
std::string title();
private:
struct Implementation;
std::unique_ptr<Implementation> _inside;
};
}... | #ifndef ENTRY_H
#define ENTRY_H
#include <string>
#include <memory>
namespace diaryengine {
class Entry
{
public:
Entry();
~Entry();
void setTitle(std::string title);
std::string title();
private:
struct Implementation;
std::unique_ptr<Implementation> inside_;
};
}... | ---
+++
@@ -16,7 +16,7 @@
private:
struct Implementation;
- std::unique_ptr<Implementation> inside_;
+ std::unique_ptr<Implementation> _inside;
};
} | Rename the implementation pointer to respect naming convention
| bsd-3-clause | Acce0ss/diary-engine | 9e8f0fbbc0448faff7072b7f8fd66b031f9abc80 |
#include <mruby.h>
#include <mruby/compile.h>
#include <windows.h>
#include <stdlib.h>
#include <stdlib.h>
#ifdef _WIN32
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
#else
int
main(int argc, char **argv)
#endif
{
mrb_state *mrb;
mrbc_context *c;
... | #include <mruby.h>
#include <mruby/compile.h>
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
mrb_state *mrb;
mrbc_context *c;
mrb_value v;
FILE *fp;
fp = fopen("init_minigame.rb", "rb");
if (fp == NULL) {
fputs("Couldn't load 'init_minigame.rb'", stderr);
... | ---
+++
@@ -1,11 +1,17 @@
#include <mruby.h>
#include <mruby/compile.h>
-#include <stdio.h>
+#include <windows.h>
+#include <stdlib.h>
#include <stdlib.h>
+#ifdef _WIN32
+int WINAPI
+WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+#else
int
main(int argc, char **argv)
+#... | Add WinMain for windows platform
| mit | bggd/mruby-minigame,bggd/mruby-minigame | 09f760a42b52975948e9c92acb3506295a3e783d |
#ifndef OS_COMMON_H_
#define OS_COMMON_H_
#include <stddef.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include <sys/time.h>
/*
* MinGW lfind() and friends use `unsigned int *` where they should use a
* `size_t *` according to the man page.
*/
typedef unsigned int lfind_size_t;
// timeradd doesn't ex... | #ifndef OS_COMMON_H_
#define OS_COMMON_H_
#include <stddef.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
/*
* MinGW lfind() and friends use `unsigned int *` where they should use a
* `size_t *` according to the man page.
*/
typedef unsigned int lfind_size_t;
// timeradd doesn't exist on MinGW
#ifndef t... | ---
+++
@@ -5,6 +5,7 @@
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
+#include <sys/time.h>
/*
* MinGW lfind() and friends use `unsigned int *` where they should use a
@@ -14,14 +15,17 @@
// timeradd doesn't exist on MinGW
#ifndef timeradd
-#define timeradd(a, b, result) \
- do { \
- (r... | Implement timeradd as an inline function
| mit | kulp/tenyr,kulp/tenyr,kulp/tenyr | c5600ec92f953554dbb2f34ab8b17938620cff65 |
// xml_lexer.h see license.txt for copyright and terms of use
#ifndef XML_LEXER_H
#define XML_LEXER_H
#include <stdio.h>
#include "fstream.h" // ifstream
#include "str.h" // string
#include "sm_flexlexer.h" // yyFlexLexer
#include "baselexer.h" // FLEX_OUTPUT_METHOD... | // xml_lexer.h see license.txt for copyright and terms of use
#ifndef XML_LEXER_H
#define XML_LEXER_H
#include <stdio.h>
#include "fstream.h" // ifstream
#include "str.h" // string
#include "sm_flexlexer.h" // yyFlexLexer
#include "baselexer.h" // FLEX_OUTPUT_METHOD... | ---
+++
@@ -30,12 +30,12 @@
// this is yytext
char const *currentText() { return this->YYText(); }
// this is yyrestart
- void restart(istream *in) { this->yyrestart(in); }
+ void restart(istream *in) { this->yyrestart(in); sawEof = false; }
int tok(XmlToken kind);
int svalTok(XmlToken t);
void ... | Fix bug where XmlLexer::restart() doesn't reset sawEof
| bsd-3-clause | angavrilov/olmar,angavrilov/olmar,angavrilov/olmar,angavrilov/olmar | 4b7b88b94b98233ae714d8466ee86876fe9f3e42 |
/*
* Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <arch_helpers.h>
#include <arch_features.h>
#include <plat/common/platform.h>
#define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL)
u_register_t pla... | /*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <arch_helpers.h>
#include <plat/common/platform.h>
#define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL)
u_register_t plat_get_stack_protector_canar... | ---
+++
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -7,17 +7,25 @@
#include <stdint.h>
#include <arch_helpers.h>
+#include <arch_featu... | plat/qemu: Use RNDR in stack protector
When getting a stack protector canary value, check
if cpu supports FEAT_RNG and use that. Fallback to
old method of using a (hardcoded value ^ timer).
Signed-off-by: Tomas Pilar <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@nuviainc.com>
Change-Id: I8181acf8e31661d4cc82bc3a4078f8751... | bsd-3-clause | achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware | 83683ddd3d704e2d8c1fe9bef9eabb4639c0846a |
#ifndef TE_AUXILIARY_H
#define TE_AUXILIARY_H
#include <map>
struct SDL_Rect;
namespace te
{
struct Vector2i;
class Rectangle;
bool checkCollision(const SDL_Rect& a, const SDL_Rect& b);
bool checkCollision(const Rectangle& a, const Rectangle& b);
SDL_Rect getIntersection(const SDL_Rect& a, con... | #ifndef TE_AUXILIARY_H
#define TE_AUXILIARY_H
struct SDL_Rect;
namespace te
{
struct Vector2i;
class Rectangle;
bool checkCollision(const SDL_Rect& a, const SDL_Rect& b);
bool checkCollision(const Rectangle& a, const Rectangle& b);
SDL_Rect getIntersection(const SDL_Rect& a, const SDL_Rect& b);... | ---
+++
@@ -1,5 +1,7 @@
#ifndef TE_AUXILIARY_H
#define TE_AUXILIARY_H
+
+#include <map>
struct SDL_Rect;
@@ -20,6 +22,34 @@
void handlePaddleCollision(Rectangle& ball, const Rectangle& paddle, float dt, float velocityScalar = 200.f);
void handleWallCollision(Rectangle& ball, const Rectangle& wall, ... | Add insertOrAssign helper for maps
| mit | evinstk/TantechEngineOriginal,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngineOriginal,evinstk/TantechEngineOriginal,evinstk/TantechEngine,evinstk/TantechEngineOriginal,evinstk/TantechEngine,evinstk/TantechEngineOriginal,evinstk/TantechEngineOriginal,evinstk/TantechEngine | bc11202f53d082c559ff5d0ce1693c463b4777db |
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# pragma once
#include <vespa/vespalib/datastore/entryref.h>
namespace search::memoryindex {
/**
* Entry per document in memory index posting list.
*/
class PostingListEntry {
mutable datastore::En... | // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# pragma once
#include <vespa/vespalib/datastore/entryref.h>
namespace search::memoryindex {
/**
* Entry per document in memory index posting list.
*/
class PostingListEntry {
mutable datastore::En... | ---
+++
@@ -22,9 +22,14 @@
: _features()
{
}
- datastore::EntryRef get_features() const { return _features; }
- // Reference moved data (used when compacting FeatureStore)
+ datastore::EntryRef get_features() const { return _features; }
+
+ /*
+ * Reference moved features (used... | Fix indentation and update comment.
| apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa | 8ef5102c2ad6f1c0cd8098cdf45473d49f62e8de |
// cc log_example.c log.c -rdynamic
#include "log.h"
char
make_segmentfault()
{
char *s = NULL;
char ch = s[1]; // segment fault
return ch;
}
int main(int argc, const char *argv[])
{
/* open global logger to stderr (by setting filename to NULL) */
log_open("example", NULL, 0);
/* set log leve... | // cc log_example.c log.c -rdynamic
#include "log.h"
char
make_segmentfault()
{
char *s = NULL;
char ch = s[1]; // segment fault
return ch;
}
int main(int argc, const char *argv[])
{
/* open global logger to stderr (by setting filename to NULL) */
log_open("example", NULL, 0);
/* set log leve... | ---
+++
@@ -21,7 +21,7 @@
/* but info and warn, error message can be seen */
log_info("info message");
log_warn("warn message");
- log_error("error message");
+ log_error("error message: %s", "someting wrong");
/* will log trace back on segmentfault automatically */
make_segmentfault();... | Add example for log with formatting args
| bsd-2-clause | hit9/C-Snip,hit9/C-Snip | a714c4de411c309937f64b47cc6cddca00bd8cf2 |
#ifndef StringUtils_h
#define StringUtils_h
#include "cocos2d.h"
namespace CCMessageWindow {
class Utils {
public:
static std::string substringUTF8(const char* str, int from, int length);
static std::vector<std::string> split(const std::string& input, char delimiter);
static std::strin... | #ifndef StringUtils_h
#define StringUtils_h
#include <stdio.h>
#include <string.h>
namespace CCMessageWindow {
class Utils {
public:
static std::string substringUTF8(const char* str, int from, int length);
static std::vector<std::string> split(const std::string& input, char delimiter);
... | ---
+++
@@ -1,8 +1,7 @@
#ifndef StringUtils_h
#define StringUtils_h
-#include <stdio.h>
-#include <string.h>
+#include "cocos2d.h"
namespace CCMessageWindow {
class Utils { | Fix build error on Android
| mit | giginet/CCMessageWindow,giginet/CCMessageWindow | 8f6c32d4d8124bd58caf7886dda3032641416ded |
#ifndef OI_OS
#define OI_OS 1
#if defined(__GNUC__)
# define OI_GCC
#elif defined(_MSC_VER)
# define OI_MSVC
#else
# warning oi does not recognize compiler
# define OI_UNKNOWN_CC
#endif
#if defined(_WIN32) || defined(__WIN32__)
# define OI_WIN
#
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
... | #ifndef OI_OS
#define OI_OS 1
#if defined(_WIN32) || defined(__WIN32__)
# define OI_WIN
# ifdef _MSC_VER
# define OI_MSVC
# else
# define OI_GCC
# endif
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
#elif defined(linux) || defined(__linux)
# define OI... | ---
+++
@@ -1,44 +1,43 @@
#ifndef OI_OS
#define OI_OS 1
+#if defined(__GNUC__)
+# define OI_GCC
+#elif defined(_MSC_VER)
+# define OI_MSVC
+#else
+# warning oi does not recognize compiler
+# define OI_UNKNOWN_CC
+#endif
+
#if defined(_WIN32) || defined(__WIN32__)
# define OI_WIN
-
-# ifdef _MSC_VER
... | Set up actual compiler detections. Only supports gcc and msvc at the moment
| mit | geky/oi | 58864e0f25384641aef7bd616c6c5b5470656e46 |
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
namespace vespalib::eval {
inline double hamming_distance(double a, double b) {
uint8_t x = (uint8_t) (int8_t) a;
uint8_t y = (uint8_t) (int8_t) b;
return __builtin_popcount(x ^ y);
}
}
| // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
namespace vespalib::eval {
inline double hamming_distance(double a, double b) {
uint8_t x = (uint8_t) a;
uint8_t y = (uint8_t) b;
return __builtin_popcount(x ^ y);
}
}
| ---
+++
@@ -5,8 +5,8 @@
namespace vespalib::eval {
inline double hamming_distance(double a, double b) {
- uint8_t x = (uint8_t) a;
- uint8_t y = (uint8_t) b;
+ uint8_t x = (uint8_t) (int8_t) a;
+ uint8_t y = (uint8_t) (int8_t) b;
return __builtin_popcount(x ^ y);
}
| Convert from double to signed data type for reference hamming distance.
| apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa | 7a0ffdc64e8e522035a7bc74ee3cea0bfeb55cd1 |
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#ifndef TEST_SRCDIR
# define TEST_SRCDIR "."
#endif
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_r... |
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_res;
int xmain(void);
int main(void)
{
FILE *fp... | ---
+++
@@ -5,6 +5,10 @@
#include <stdio.h>
#include "sodium.h"
+
+#ifndef TEST_SRCDIR
+# define TEST_SRCDIR "."
+#endif
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" | Add a default value for TEST_SRCDIR
| isc | optedoblivion/android_external_libsodium,optedoblivion/android_external_libsodium,pyparallel/libsodium,paragonie-scott/libsodium,rustyhorde/libsodium,rustyhorde/libsodium,donpark/libsodium,mvduin/libsodium,zhuqling/libsodium,donpark/libsodium,kytvi2p/libsodium,SpiderOak/libsodium,CyanogenMod/android_external_dnscrypt_l... | e2262de49c039d58bdff68da136bb08309ef57d2 |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char* argv)
{
FILE *ps;
char date_str[32]={0};
if((ps = popen("date +%Y%m%d-%H%M%S", "r")) == NULL )
{
printf("popen() error!\n");
return 1;
}
fgets(date_str, sizeof(date_str),ps);
printf("%s\n",date_str);
pclose(ps);
if((ps... | #include <stdio.h>
#include <stdlib.h>
int main(int argc,char* argv)
{
return 0;
}
| ---
+++
@@ -1,10 +1,35 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+
int main(int argc,char* argv)
{
+ FILE *ps;
+ char date_str[32]={0};
+ if((ps = popen("date +%Y%m%d-%H%M%S", "r")) == NULL )
+ {
+ printf("popen() error!\n");
+ return 1;
+ }
+ fgets(date_str, sizeof(date_str),ps);
+ p... | Add date and storage percent functions.
| mit | wigcheng/pi_apps | 5bee973dd0c1ba2ba5b473398429c2f4c5f6447e |
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include "object.h"
typedef enum IterType_ {ITERLIST, ITERVECTOR} IterType;
typedef struct Iter_ {
IterType type;
union {
struct {
Object *node;
bool first;
} list;
struct {
Object *object;
int inde... | #ifndef SEQUENCE_H
#define SEQUENCE_H
#include "object.h"
typedef enum IterType_ {ITERLIST, ITERVECTOR} IterType;
typedef struct Iter_ {
IterType type;
union {
struct {
Object *node;
bool first;
} list;
struct {
Object *object;
int inde... | ---
+++
@@ -20,10 +20,10 @@
} u;
} Iter;
-bool object_isseq(Object *object);
+bool object_isseq(Object *object) __attribute__ ((pure));
Iter seq_iter(Object *object);
Object *iter_next(Iter *iter);
-int seq_len(Object *object);
-Object *seq_nth(Object *object, int n);
+int seq_len(Object *object) __attribut... | Mark some functions as pure
| mit | ids1024/idslisp | cfab8acf28fd7aff0b2d355c9935b028376ea08e |
#ifdef _MSC_VER
#include <nmmintrin.h>
#else
#include <popcntintrin.h>
#endif
#include <stdlib.h>
int main(void)
{
long long a = 0;
int b;
a = random();
b = random();
#ifdef _MSC_VER
#ifdef _M_X64
a = _mm_popcnt_u64(a);
#endif
b = _mm_popcnt_u32(b);
#else
#ifdef... | #ifdef _MSC_VER
#include <nmmintrin.h>
#else
#include <popcntintrin.h>
#endif
int main(void)
{
long long a = 0;
int b;
#ifdef _MSC_VER
#ifdef _M_X64
a = _mm_popcnt_u64(1);
#endif
b = _mm_popcnt_u32(1);
#else
#ifdef __x86_64__
a = __builtin_popcountll(1);
#endif
b = __bui... | ---
+++
@@ -4,20 +4,26 @@
#include <popcntintrin.h>
#endif
+#include <stdlib.h>
+
int main(void)
{
long long a = 0;
int b;
+
+ a = random();
+ b = random();
+
#ifdef _MSC_VER
#ifdef _M_X64
- a = _mm_popcnt_u64(1);
+ a = _mm_popcnt_u64(a);
#endif
- b = _mm_popcnt... | Fix compile-time test of POPCNT
The compile-time test of POPCNT, cpu_popcnt.c produced code that would
execute without error even if the machine didn't support the popcnt
instruction. This patch attempts to use popcnt on random numbers so the
compiler can't substitute the answer at compile time.
| bsd-3-clause | seberg/numpy,anntzer/numpy,simongibbons/numpy,charris/numpy,mattip/numpy,mattip/numpy,mhvk/numpy,jakirkham/numpy,anntzer/numpy,numpy/numpy,rgommers/numpy,mhvk/numpy,seberg/numpy,pdebuyl/numpy,pdebuyl/numpy,endolith/numpy,mhvk/numpy,rgommers/numpy,mhvk/numpy,endolith/numpy,charris/numpy,anntzer/numpy,jakirkham/numpy,rgo... | 59764c6d3621423c9d4e136e99a69078a79ca6f5 |
#ifndef DEBUGGER_TUI_H
#define DEBUGGER_TUI_H
#include "asic.h"
char **tui_parse_commandline(const char *, int *);
#ifndef EMSCRIPTEN
void tui_tick(asic_t *asic);
#endif
#endif
| #ifndef DEBUGGER_TUI_H
#define DEBUGGER_TUI_H
#include "asic.h"
char **tui_parse_commandline(const char *, int *);
void tui_tick(asic_t *asic);
#endif
| ---
+++
@@ -4,6 +4,9 @@
#include "asic.h"
char **tui_parse_commandline(const char *, int *);
+
+#ifndef EMSCRIPTEN
void tui_tick(asic_t *asic);
+#endif
#endif | Add ifs around TUI function not available in emscripten
| mit | KnightOS/z80e,KnightOS/z80e | ece0b186333657c94cd50148fbf10802a052d214 |
#include <string>
/* Obtained from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html */
void tokenizeString(const std::string& str,
std::vector<std::string>& tokens,
const std::string& delimiters)
{
// Skip delimiters at beginning.
std::string::size_type lastPos = str.find_first_not... | #include <string>
using namespace std;
/* Obtained from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html */
void tokenizeString(const string& str,
vector<string>& tokens,
const string& delimiters)
{
// Skip delimiters at beginning.
string::size_type lastPos = str.find_first_not_of... | ---
+++
@@ -1,18 +1,16 @@
#include <string>
-using namespace std;
-
/* Obtained from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html */
-void tokenizeString(const string& str,
- vector<string>& tokens,
- const string& delimiters)
+void tokenizeString(const std::string& str,
+ ... | Common: Remove use of using-directive for std
| mit | andresodio/lager,andresodio/lager,andresodio/lager,andresodio/lager | bce08b28ad4717b28356cfb98be76a551675d4a4 |
// Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
class VolumeTransformation;
class VolumeController {
public:
struct DeviceInfo {
std::wstring name;
std::wstring id;
};
/// <summary>
/// Retrieves the cu... | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
class VolumeTransformation;
class VolumeController {
public:
struct DeviceInfo {
std::wstring name;
std::wstring id;
};
/// <summary>
/// Retrieves the cu... | ---
+++
@@ -26,8 +26,8 @@
(Muted() == true) ? Muted(false) : Muted(true);
}
- virtual void Transformation(VolumeTransformation *transform) = 0;
- virtual VolumeTransformation* Transformation() = 0;
+ virtual void AddTransformation(VolumeTransformation *transform) = 0;
+ virtual void Remove... | Change transform interface to add/remove
This allows support for multiple transformations
| bsd-2-clause | malensek/3RVX,malensek/3RVX,malensek/3RVX | 774ae7b87f85601780a9361d3ab39e37600adf5b |
/* Unit tests for small utility routines.
*
* SCL; 2016
*/
#include <stdlib.h>
#include <assert.h>
#include "common.h"
#include "tests_common.h"
#include "gr1c_util.h"
void print_arr( FILE *fp, vartype *arr, int len )
{
int k;
assert( len > 0 );
fprintf( fp, "[" );
for (k = 0; k < len; k++) {
... | /* Unit tests for small utility routines.
*
* SCL; 2016
*/
#include <stdlib.h>
#include "common.h"
#include "tests_common.h"
#include "gr1c_util.h"
int main( int argc, char **argv )
{
vartype bv[] = {0,1,0,1};
if (bitvec_to_int( bv, 4 ) != 0xA) {
ERRPRINT( "bitvec_to_int( [0,1,0,1], 4) != 0xA" )... | ---
+++
@@ -4,20 +4,44 @@
*/
#include <stdlib.h>
+#include <assert.h>
#include "common.h"
#include "tests_common.h"
#include "gr1c_util.h"
+void print_arr( FILE *fp, vartype *arr, int len )
+{
+ int k;
+ assert( len > 0 );
+ fprintf( fp, "[" );
+ for (k = 0; k < len; k++) {
+ fprintf(... | TEST: Implement generic check of bitvec_to_int()
| bsd-3-clause | slivingston/gr1c,slivingston/gr1c,slivingston/gr1c | ee3c4d78acdfd67d161a3d9bac79e6597393d414 |
/*===========================================================================*
| fpbasis.c
| Copyright (c) 1996-97 Applied Logic Systems, Inc.
|
| -- Floating point math abstractions
|
*===========================================================================*/
#include "defs.h"
#include ... | /*===========================================================================*
| fpbasis.c
| Copyright (c) 1996-97 Applied Logic Systems, Inc.
|
| -- Floating point math abstractions
|
*===========================================================================*/
#include "defs.h"
#include ... | ---
+++
@@ -25,7 +25,7 @@
is_ieee_inf(v)
double v;
{
-#ifdef SOLARIS
+#if defined(SOLARIS) || defined(UNIX_SOLARIS)
switch (fpclass(v)) {
case FP_NINF:
return(1); | Change for new config system
| mit | AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog | 4b62610ef39e999c1328e884b01cc14c7dcd9591 |
//
// Portal.h
// Portal
//
// Created by Guido Marucci Blas on 3/14/17.
// Copyright © 2017 Guido Marucci Blas. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for Portal.
FOUNDATION_EXPORT double PortalVersionNumber;
//! Project version string for Portal.
FOUNDATION_EXPORT const unsi... | //
// Portal.h
// Portal
//
// Created by Guido Marucci Blas on 3/14/17.
// Copyright © 2017 Guido Marucci Blas. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for Portal.
FOUNDATION_EXPORT double PortalVersionNumber;
//! Project version string for Portal.
FOUNDATION_EXPORT const unsi... | ---
+++
@@ -16,6 +16,7 @@
// In this header, you should import all the public headers of your framework using statements like #import <Portal/PublicHeader.h>
-
+#import <Portal/Yoga.h>
+#import <Portal/YGNodeList.h>
#import <Portal/YGLayout.h>
#import <Portal/UIView+Yoga.h> | Add missing Yoga headers to umbrella header.
This is needed to avoid warnings.
| mit | guidomb/Portal,guidomb/Portal,guidomb/Portal,guidomb/Portal | 759f87259e5cfada2a9d84118e26d21d227e3718 |
//
// MagicalRecord for Core Data.
//
// Created by Saul Mora.
// Copyright 2011 Magical Panda Software. All rights reserved.
//
// enable to use caches for the fetchedResultsControllers (iOS only)
#if TARGET_OS_IPHONE
#define STORE_USE_CACHE
#endif
#define kCreateNewCoordinatorOnBackgroundOperations 0
#ifdef... | //
// MagicalRecord for Core Data.
//
// Created by Saul Mora.
// Copyright 2011 Magical Panda Software. All rights reserved.
//
// enable to use caches for the fetchedResultsControllers (iOS only)
#if TARGET_OS_IPHONE
#define STORE_USE_CACHE
#endif
#define kCreateNewCoordinatorOnBackgroundOperations 0
#define... | ---
+++
@@ -11,7 +11,18 @@
#endif
#define kCreateNewCoordinatorOnBackgroundOperations 0
+
+#ifdef MR_LOGGING
#define ENABLE_ACTIVE_RECORD_LOGGING
+#endif
+
+#ifdef DEBUG
+#define ENABLE_ACTIVE_RECORD_LOGGING
+#endif
+
+#ifdef MR_NO_LOGGING
+#undef ENABLE_ACTIVE_RECORD_LOGGING
+#endif
#ifdef ENABLE_ACTIVE_... | Define MR_NO_LOGGING to force no logging.
| mit | zwaldowski/AZCoreRecord,zwaldowski/AZCoreRecord | fb514a31f0c99c252e0948fa88ffb75ba5b5ec69 |
//
// WulfGame/Game/Player.h
// Copyright (C) 2012 Lexi Robinson
// This code is freely available under the MIT licence.
//
#pragma once
#include <glm/glm.hpp>
#include "WulfConstants.h"
#include "Game/InputManager.h"
#include "Game/Constants.h"
#include "Game/Entity.h"
#include "Map/Map.h"
namespace Wulf {
class Pla... | //
// WulfGame/Game/Player.h
// Copyright (C) 2012 Lexi Robinson
// This code is freely available under the MIT licence.
//
#pragma once
#include <glm/glm.hpp>
#include "WulfConstants.h"
#include "Game/InputManager.h"
#include "Game/Constants.h"
#include "Game/Entity.h"
#include "Map/Map.h"
namespace Wulf {
class Pla... | ---
+++
@@ -23,6 +23,9 @@
glm::vec3 GetUp() const { return mUp; }
#endif
+ byte Ammo;
+ word Score;
+
Difficulty GetDifficulty() const { return mDifficulty; }
void SetDifficulty(Difficulty nDiff) { mDifficulty = nDiff; }
| Add ammo and score fields to the player object
| mit | Lexicality/Wulf2012,Lexicality/Wulf2012 | f8cbdcc43038a1acb26f6643aa06c082b14c15ef |
// stm32f4xx_prefix.c becomes the initial portion of the generated pins file.
#include <stdio.h>
#include "py/obj.h"
#include "pin.h"
#include MICROPY_HAL_H
#define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
{ \
{ &pin_af_type }, \
.name = MP_QSTR_AF ## af_idx ## _ ## af_fn ## af_unit, \
.idx = (af_id... | // stm32f4xx_prefix.c becomes the initial portion of the generated pins file.
#include <stdio.h>
#include "py/obj.h"
#include "pin.h"
#include MICROPY_HAL_H
#define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
{ \
{ &pin_af_type }, \
.name = MP_QSTR_AF ## af_idx ## _ ## af_fn ## af_unit, \
.idx = (af_id... | ---
+++
@@ -23,7 +23,7 @@
.name = MP_QSTR_ ## p_port ## p_pin, \
.port = PORT_ ## p_port, \
.pin = (p_pin), \
- .num_af = (sizeof(p_af) / sizeof(pin_obj_t)), \
+ .num_af = (sizeof(p_af) / sizeof(pin_af_obj_t)), \
.pin_mask = (1 << ((p_pin) & 0x0f)), \
.gpio = GPIO ## p_port, \
.af ... | stmhal/boards/stm32fxx_prefix.c: Fix alt function number calculation
This prevented pin_find_af* functions from being able to find some
of the alternate functions in the pin struct
| mit | blmorris/micropython,matthewelse/micropython,pramasoul/micropython,feilongfl/micropython,ceramos/micropython,turbinenreiter/micropython,martinribelotta/micropython,MrSurly/micropython-esp32,stonegithubs/micropython,hiway/micropython,noahchense/micropython,rubencabrera/micropython,dmazzella/micropython,ahotam/micropytho... | 2af846e7114e98c2883061ffbd0e43adc24033d3 |
/*
* Copyright (c) 2017, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma onc... | /*
* Copyright (c) 2017, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma onc... | ---
+++
@@ -27,10 +27,10 @@
: prefix_(prefix.str()), suffix_(0) {}
std::thread newThread(folly::Func&& func) override {
- auto thread = std::thread([&](folly::Func&& funct) {
- folly::setThreadName(folly::to<std::string>(prefix_, suffix_++));
- funct();
- }, std::move(func));
+ auto threa... | Revert D5012627: [FBCode] Switch various calls to folly::setThreadName to set the current thread's name
Summary: This reverts commit a4e6e2c2cb5bd02b1ebea85c305eac59355a7d42
Differential Revision: D5012627
fbshipit-source-id: ff4b8ff94d5f5e76f0777b96d03975d3f7834a17
| apache-2.0 | facebook/wangle,facebook/wangle,facebook/wangle | 9bf27e459fa470bccd07d64ee3e6aad9b49847f4 |
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR 1603
void func()
{
const int *arr;
arr[0] = 1; // expected-error {{read-only variable is not assignable}}
}
struct foo {
int bar;
};
struct foo sfoo = { 0 };
int func2()
{
const struct foo *fp;
fp = &sfoo;
fp[0].bar = 1; // expected-error {{read-only v... | // RUN: not %clang_cc1_only -c %s -o - > /dev/null
// PR 1603
void func()
{
const int *arr;
arr[0] = 1; // expected-error {{assignment of read-only location}}
}
struct foo {
int bar;
};
struct foo sfoo = { 0 };
int func2()
{
const struct foo *fp;
fp = &sfoo;
fp[0].bar = 1; // expected-error {{ assignm... | ---
+++
@@ -1,9 +1,9 @@
-// RUN: not %clang_cc1_only -c %s -o - > /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR 1603
void func()
{
const int *arr;
- arr[0] = 1; // expected-error {{assignment of read-only location}}
+ arr[0] = 1; // expected-error {{read-only variable is not assignable}}
... | Fix a test that hasn't worked since 2007
Due to a missing -verify, 2007-10-01-BuildArrayRef.c was a no-op.
The message was changed 5 years ago so also update the test to reflect the new wording.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@196729 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl... | 2e2d5d779fa18c98d6affc025dc5fcb122743f4c |
typedef struct {
int version_num; /* version of this structure */
int cluster; /* Condor Cluster # */
int proc; /* Condor Proc # */
int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */
uid_t uid; /* Execute job under this UID */
gid_t gid; /* Execute job under this gid */
pid_t virt_pid... | typedef struct {
int cluster; /* Condor Cluster # */
int proc; /* Condor Proc # */
int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */
uid_t uid; /* Execute job under this UID */
gid_t gid; /* Execute job under this pid */
pid_t virt_pid; /* PVM virt pid of this process */
int soft_ki... | ---
+++
@@ -1,12 +1,12 @@
typedef struct {
+ int version_num; /* version of this structure */
int cluster; /* Condor Cluster # */
int proc; /* Condor Proc # */
int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */
uid_t uid; /* Execute job under this UID */
- gid_t gid; /* Execute jo... | Add version number and get rid if a.out name.
| apache-2.0 | djw8605/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/htcondor,clalancette/condor-dcloud,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,clalancette/condor-dcloud,zhangzhehust/htcon... | b5220189bc6a5ec22efa7c6b8ae39bc166303c62 |
//
// BBASearchServiceResult.h
// BBBAPI
//
// Created by Owen Worley on 12/01/2015.
// Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FEMObjectMapping;
/**
* Represents data provided from the search service when searching for books
*/
@interface ... | //
// BBASearchServiceResult.h
// BBBAPI
//
// Created by Owen Worley on 12/01/2015.
// Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FEMObjectMapping;
/**
* Represents data provided from the search service when searching for books
*/
@interface ... | ---
+++
@@ -15,6 +15,9 @@
@property (nonatomic, copy) NSString *type;
@property (nonatomic, copy) NSString *identifier;
+/**
+ * Array of `BBALibraryItemLink` objects
+ */
@property (nonatomic, copy) NSArray *links;
@property (nonatomic, assign) NSInteger numberOfResults;
@property (nonatomic, copy) NSArray *... | Document contents of Links array
| mit | blinkboxbooks/blinkbox-network.objc,blinkboxbooks/blinkbox-network.objc | 8ea9c9401cca7ea074d0e85ba57b2ccf42630cd7 |
#ifndef CONSTANTS_H_
#define CONSTANTS_H_
#include <math.h>
// Modify PRIME_FIELD_BINARY_BIT_LENGTH at will
#define PRIME_FIELD_BINARY_BIT_LENGTH (131)
// Do not modify anything below
#define LIMB_SIZE_IN_BITS (64)
#define LIMB_SIZE_IN_BYTES (LIMB_SIZE_IN_BITS / 8)
#define LIMB_SIZE_IN_HEX (LIMB_SIZE_IN_BITS / 4)
#d... | #ifndef CONSTANTS_H_
#define CONSTANTS_H_
#include <math.h>
#define PRIME_FIELD_BINARY_BIT_LENGTH (64)
#define LIMB_SIZE_IN_BITS (64)
#define LIMB_SIZE_IN_BYTES (LIMB_SIZE_IN_BITS / 8)
#define LIMB_SIZE_IN_HEX (LIMB_SIZE_IN_BITS / 4)
// +1 is important for basic operations like addition that may overflow to the
// n... | ---
+++
@@ -3,14 +3,18 @@
#include <math.h>
-#define PRIME_FIELD_BINARY_BIT_LENGTH (64)
+// Modify PRIME_FIELD_BINARY_BIT_LENGTH at will
+#define PRIME_FIELD_BINARY_BIT_LENGTH (131)
+// Do not modify anything below
#define LIMB_SIZE_IN_BITS (64)
#define LIMB_SIZE_IN_BYTES (LIMB_SIZE_IN_BITS / 8)
#define LIM... | Add compile-time check for bit length of prime field
| unlicense | sahandKashani/prime-field-arithmetic-AVX2,sahandKashani/prime-field-arithmetic-AVX2,sahandKashani/prime-field-arithmetic-AVX2 | dcc03187070b26677f38056ab4f7b3209202a52e |
//
// UIAlertView+RACCommandSupport.h
// ReactiveCocoa
//
// Created by Henrik Hodne on 6/16/13.
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@class RACCommand;
@interface UIAlertView (RACCommandSupport)
// Sets the alert view's command. When a button on the alert view is p... | //
// UIAlertView+RACCommandSupport.h
// ReactiveCocoa
//
// Created by Henrik Hodne on 6/16/13.
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@class RACCommand;
@interface UIAlertView (RACCommandSupport)
// Sets the alert view's command. When a button on the alert view is p... | ---
+++
@@ -14,6 +14,9 @@
// Sets the alert view's command. When a button on the alert view is pressed,
// the command is executed with the index of the button that was pressed.
+//
+// This will override the alert view's delegate, so you can't use this together
+// with a custom delegate.
@property (nonatomic, ... | Document that UIAlertView.rac_command overrides the delegate
| mit | DongDongDongDong/ReactiveCocoa,JohnJin007/ReactiveCocoa,AllanChen/ReactiveCocoa,walkingsmarts/ReactiveCocoa,Pingco/ReactiveCocoa,dz1111/ReactiveCocoa,zhenlove/ReactiveCocoa,brightcove/ReactiveCocoa,jsslai/ReactiveCocoa,Pikdays/ReactiveCocoa,paulyoung/ReactiveCocoa,on99/ReactiveCocoa,xumaolin/ReactiveCocoa,mxxiv/Reactiv... | 98c97486a56452a655471f0be6aa8ecfecc359fe |
#ifndef _LINEARLAYOUT_H_
#define _LINEARLAYOUT_H_
#include <Element.h>
#include <Command.h>
#define FW_VERTICAL 1
#define FW_HORIZONTAL 2
class LinearLayout : public Element {
public:
LinearLayout(int _direction, int _id = 0) : Element(_id), direction(_direction) { }
bool isA(const std::string & className) ov... | #ifndef _LINEARLAYOUT_H_
#define _LINEARLAYOUT_H_
#include <Element.h>
#include <Command.h>
#define FW_VERTICAL 1
#define FW_HORIZONTAL 2
class LinearLayout : public Element {
public:
LinearLayout(int _direction, int _id) : Element(_id), direction(_direction) { }
bool isA(const std::string & className) overri... | ---
+++
@@ -9,7 +9,7 @@
class LinearLayout : public Element {
public:
- LinearLayout(int _direction, int _id) : Element(_id), direction(_direction) { }
+ LinearLayout(int _direction, int _id = 0) : Element(_id), direction(_direction) { }
bool isA(const std::string & className) override { | Add default value to id on constructor | mit | Sometrik/framework,Sometrik/framework,Sometrik/framework | 45fb9eb248df779c8fa845dac32bcafd2c129d40 |
#include <string.h>
#include "roman_convert_to_int.h"
int roman_convert_to_int(const char *numeral)
{
const char first_letter = numeral ? *numeral : '?';
switch (first_letter)
{
case 'I':
return 1;
case 'V':
return 5;
case 'X':
return 10;
case 'L':
return 50;
case 'C':
return 100;
case '... | #include <string.h>
#include "roman_convert_to_int.h"
int roman_convert_to_int(const char *numeral)
{
if (!numeral)
{
return -1;
}
const char first_letter = *numeral;
switch (first_letter)
{
case 'I':
return 1;
case 'V':
return 5;
case 'X':
return 10;
case 'L':
return 50;
case 'C':
re... | ---
+++
@@ -4,11 +4,7 @@
int roman_convert_to_int(const char *numeral)
{
- if (!numeral)
- {
- return -1;
- }
- const char first_letter = *numeral;
+ const char first_letter = numeral ? *numeral : '?';
switch (first_letter)
{
case 'I': | Simplify error handling for missing/unknown numerals
| mit | greghaskins/roman-calculator.c | cdb6e95182e874765dd7a51155534111d186d631 |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_trmnew.c :+: :+: :+: ... | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_trmnew.c :+: :+: :+: ... | ---
+++
@@ -6,7 +6,7 @@
/* By: ncoden <ncoden@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/05/08 12:26:49 by ncoden #+# #+# */
-/* Updated: 2015/05/30 16:29:30 by ncoden ... | Set trm inherit signals by default
| apache-2.0 | ncoden/libft | 9fc55387986f0979d10370fe2fa313db8776bdea |
#ifndef XAPIAND_INCLUDED_SERVER_H
#define XAPIAND_INCLUDED_SERVER_H
#include <ev++.h>
#include "threadpool.h"
#include "database.h"
const int XAPIAND_HTTP_PORT_DEFAULT = 8880;
const int XAPIAND_BINARY_PORT_DEFAULT = 8890;
class XapiandServer : public Task {
private:
ev::dynamic_loop dynamic_loop;
ev::loop_ref *... | #ifndef XAPIAND_INCLUDED_SERVER_H
#define XAPIAND_INCLUDED_SERVER_H
#include <ev++.h>
#include "threadpool.h"
#include "database.h"
const int XAPIAND_HTTP_PORT_DEFAULT = 8880;
const int XAPIAND_BINARY_PORT_DEFAULT = 8890;
class XapiandServer : public Task {
private:
ev::dynamic_loop loop;
ev::sig sig;
ev::asyn... | ---
+++
@@ -13,7 +13,8 @@
class XapiandServer : public Task {
private:
- ev::dynamic_loop loop;
+ ev::dynamic_loop dynamic_loop;
+ ev::loop_ref *loop;
ev::sig sig;
ev::async quit;
@@ -35,7 +36,7 @@
void quit_cb(ev::async &watcher, int revents);
public:
- XapiandServer(int http_sock_, int binary_sock_);... | Allow passing an event loop to XapianServer
| mit | Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand | 855f14a819774f5417417e7a14938036c4115833 |
#ifndef MAP_H
#define MAP_H
#include <vector>
#include <map>
#include "DelaunayTriangulation.h"
#include "Structure.h"
#include "QuadTree.h"
using pCenterQT = QuadTree<Center*>;
// Forward Declaration
class Vector2;
namespace Noise
{
namespace Module
{
class Perlin;
}
}
#endif | #ifndef MAP_H
#define MAP_H
#include <vector>
#include <map>
#include "DelaunayTriangulation.h"
#include "Structure.h"
#include "QuadTree.h"
#endif | ---
+++
@@ -8,4 +8,16 @@
#include "Structure.h"
#include "QuadTree.h"
+using pCenterQT = QuadTree<Center*>;
+
+// Forward Declaration
+class Vector2;
+namespace Noise
+{
+ namespace Module
+ {
+ class Perlin;
+ }
+}
+
#endif | Define alias type, forward declaration
| mit | utilForever/PolyMapGenerator | 05461a9fc72c303f611d0b37cde545c2b0c7bdc2 |
/* Copyright (c) 2008 Sun Microsystems, Inc.
Use is subject to license terms.
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; version 2 of the License.
This program is distributed in ... | /* Copyright (c) 2008 Sun Microsystems, Inc.
Use is subject to license terms.
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; version 2 of the License.
This program is distributed in ... | ---
+++
@@ -18,12 +18,29 @@
#define PROBES_MYSQL_H
-#include <my_global.h>
#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE)
+
+#ifdef __linux__
+/*
+ On Linux, generated probes header may include C++ header
+ <limits> which conflicts with min and max macros from my_global.h .
+ To fix, temporarily und... | Fix build error on Ubuntu 11.10, if systemtap is installed.
The error is due to conflict between min/max macros in my_global.h
and system header < limits>, indirectly included via generated
probes_mysql_dtrace.h
Temporarily undefined min/max for the inclusion of the probes_mysq_dtrace.h
| lgpl-2.1 | ollie314/server,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,ollie314/server,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-... | c0a4377575c734ce8872d804229f852240d5b661 |
// 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);
... | // 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... | ---
+++
@@ -5,8 +5,6 @@
// Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com>
#include <gba.h>
-
-#include <stdio.h>
#include "gbt_player.h"
@@ -17,10 +15,6 @@
irqInit();
irqEnable(IRQ_VBLANK);
- consoleDemoInit();
-
- iprintf("GBT Player v3.0.9");
-
gbt_play(template_data,... | 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.
| mit | AntonioND/gbt-player,AntonioND/gbt-player,AntonioND/gbt-player | 4f76d799edab526b1de4ac24b61c909336b86bb9 |
@import Base;
@import ObjectiveC;
BaseClass *getBaseClassObjC();
void useBaseClassObjC(BaseClass *);
@interface UserClass : NSObject <BaseProto>
@end
id <BaseProto> getBaseProtoObjC();
void useBaseProtoObjC(id <BaseProto>);
@interface BaseClass (ObjCExtensions)
- (void)categoryMethod;
@end
| @import Base;
@import ObjectiveC;
BaseClass *getBaseClassObjC();
void useBaseClassObjC(BaseClass *);
@interface UserClass : NSObject <BaseProto>
@end
id <BaseProto> getBaseProtoObjC();
void useBaseProtoObjC(id <BaseProto>);
| ---
+++
@@ -10,3 +10,8 @@
id <BaseProto> getBaseProtoObjC();
void useBaseProtoObjC(id <BaseProto>);
+
+@interface BaseClass (ObjCExtensions)
+- (void)categoryMethod;
+@end
+ | [ClangImporter] Add a test for ObjC categories on Swift classes.
...that get unified by the importer.
Swift SVN r15083
| apache-2.0 | ken0nek/swift,JGiola/swift,deyton/swift,austinzheng/swift,bitjammer/swift,stephentyrone/swift,airspeedswift/swift,bitjammer/swift,JGiola/swift,glessard/swift,therealbnut/swift,ahoppen/swift,mightydeveloper/swift,allevato/swift,sdulal/swift,ben-ng/swift,codestergit/swift,mightydeveloper/swift,calebd/swift,nathawes/swift... | a356bd07150e558e19cead5eaa9d11e78b7842cb |
#include <stdlib.h>
#include "py/lexer.h"
#include "py/runtime.h"
#include "py/mperrno.h"
#include "memzip.h"
mp_lexer_t *mp_lexer_new_from_file(const char *filename)
{
void *data;
size_t len;
if (memzip_locate(filename, &data, &len) != MZ_OK) {
mp_raise_OSError(MP_ENOENT);
}
return mp_l... | #include <stdlib.h>
#include "py/lexer.h"
#include "memzip.h"
mp_lexer_t *mp_lexer_new_from_file(const char *filename)
{
void *data;
size_t len;
if (memzip_locate(filename, &data, &len) != MZ_OK) {
return NULL;
}
return mp_lexer_new_from_str_len(qstr_from_str(filename), (const char *)dat... | ---
+++
@@ -1,6 +1,8 @@
#include <stdlib.h>
#include "py/lexer.h"
+#include "py/runtime.h"
+#include "py/mperrno.h"
#include "memzip.h"
mp_lexer_t *mp_lexer_new_from_file(const char *filename)
@@ -9,7 +11,7 @@
size_t len;
if (memzip_locate(filename, &data, &len) != MZ_OK) {
- return NULL;
+... | lib/memzip: Make lexer constructor raise exception when file not found.
| mit | blazewicz/micropython,cwyark/micropython,infinnovation/micropython,selste/micropython,cwyark/micropython,bvernoux/micropython,PappaPeppar/micropython,pozetroninc/micropython,chrisdearman/micropython,henriknelson/micropython,AriZuu/micropython,MrSurly/micropython,micropython/micropython-esp32,torwag/micropython,Peetz0r/... | 41b1df604617bdde59bb722b9247c16fa4677d94 |
#ifndef HL7PARSER_CONFIG_H
#define HL7PARSER_CONFIG_H
/**
* \file config.h
*
* Generic configuration directives and macros used by the HL7 parser.
*
* \internal
* Copyright (c) 2003-2011 \b Erlar (http://erlar.com)
*/
/* ------------------------------------------------------------------------
Headers
----------... | #ifndef HL7PARSER_CONFIG_H
#define HL7PARSER_CONFIG_H
/**
* \file config.h
*
* Generic configuration directives and macros used by the HL7 parser.
*
* \internal
* Copyright (c) 2003-2011 \b Erlar (http://erlar.com)
*/
/* ------------------------------------------------------------------------
Headers
----------... | ---
+++
@@ -42,5 +42,10 @@
*/
#define HL7_ASSERT( p ) assert( p )
+#ifdef __GNUC__
+#define HL7_UNUSED __attribute__ ((__unused__))
+#else
+#define HL7_UNUSED
+#endif
#endif /* HL7PARSER_CONFIG_H */ | Add attribute for unused arguments
| apache-2.0 | jcomellas/hl7parser,jcomellas/hl7parser,jcomellas/hl7parser | e09d9db1a20d9e93bdb568975f26687b94ba7f7e |
/*
* detab: Replace tabs with blanks.
*/
#include <stdio.h>
#define TABSIZE 8
/* detab: Replace tabs with blanks. */
int
main(void)
{
int ch, i;
for (i = 0; (ch = getchar()) != EOF; i++) {
if (ch == '\n')
i = 0;
if (ch == '\t') {
putchar(' ');
while (i % TABSIZE) {
putchar(' ');
i++;
}
... | /*
* detab: Replace tabs with blanks.
*/
#include <stdio.h>
#define MAXLINE 10000 /* Max input line length. */
#define TABSTOP 8 /* Set tab stop to eight characters. */
int getaline(char *, int);
void detab(char *);
/* detab: Replace tabs with blanks. */
int
main(void)
{
char line[MAXLINE]; /* Current input lin... | ---
+++
@@ -4,54 +4,26 @@
#include <stdio.h>
-#define MAXLINE 10000 /* Max input line length. */
-#define TABSTOP 8 /* Set tab stop to eight characters. */
-
-int getaline(char *, int);
-void detab(char *);
+#define TABSIZE 8
/* detab: Replace tabs with blanks. */
int
main(void)
{
- char line[MAXLINE]; /*... | Make detab actually work reliably.
| isc | chettrick/tcpl | c2b83606e10756537cdbeb528815808a810460d8 |
/**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2013 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z... | /**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z... | ---
+++
@@ -1,7 +1,7 @@
/**
* \file os_rmdir.c
* \brief Remove a subdirectory.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ * \author Copyright (c) 2002-2013 Jason Perkins and the Premake project
*/
#include <stdlib.h>
@@ -16,7 +16,7 @@
#if PLATFORM_WINDOWS
z = RemoveDir... | Fix error result handling in os.rmdir()
| bsd-3-clause | premake/premake-4.x,soundsrc/premake-stable,ryanjmulder/premake-4.x,lizh06/premake-4.x,ryanjmulder/premake-4.x,soundsrc/premake-stable,premake/premake-4.x,lizh06/premake-4.x,premake/premake-4.x,soundsrc/premake-stable,ryanjmulder/premake-4.x,premake/premake-4.x,soundsrc/premake-stable,lizh06/premake-4.x,lizh06/premake-... | 20fd5a0c28f49618218d3c8d43c742fbab68edf0 |
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in t... | /* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in t... | ---
+++
@@ -16,16 +16,21 @@
#include <ndb_global.h>
+#include <my_sys.h>
#include <NdbSleep.h>
int
NdbSleep_MilliSleep(int milliseconds){
+ my_sleep(milliseconds*1000);
+ return 0;
+#if 0
int result = 0;
struct timespec sleeptime;
sleeptime.tv_sec = milliseconds / 1000;
sleeptime.tv_nsec = (mi... | Use my_sleep instead of nanosleep for portability
| lgpl-2.1 | ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,ollie314/server,flynn1973/mariadb-aix,davidl-zend/zenddbi,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,natsys... | 837f1bd12b5c80446bf0ee243303c66d37c6a69e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.