commit
stringlengths 40
40
| old_file
stringlengths 4
112
| new_file
stringlengths 4
112
| old_contents
stringlengths 0
2.05k
| new_contents
stringlengths 28
3.9k
| subject
stringlengths 17
736
| message
stringlengths 18
4.78k
| lang
stringclasses 1
value | license
stringclasses 13
values | repos
stringlengths 7
111k
|
---|---|---|---|---|---|---|---|---|---|
6dfebcd2cca5a3e6cb7668c43ff30c4619026c75 | source/crate_demo/game_state_manager.h | source/crate_demo/game_state_manager.h | /* 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_GAME_STATE_MANAGER_H
#define CRATE_DEMO_GAME_STATE_MANAGER_H
#include "common/game_state_manager_interface.h"
namespace CrateDemo {
class GameStateManager : public Common::IGameStateManager {
public:
GameStateManager();
private:
public:
bool Initialize();
void Shutdown();
/**
* Return the wanted period of time between update() calls.
*
* IE: If you want update to be called 20 times a second, this
* should return 50.
*
* NOTE: This should probably be inlined.
* NOTE: This will only be called at the beginning of HalflingEngine::Run()
* TODO: Contemplate the cost/benefit of calling this once per frame
*
* @return The period in milliseconds
*/
inline double GetUpdatePeriod() { return 30.0; }
/**
* Called every time the game logic should be updated. The frequency
* of this being called is determined by getUpdatePeriod()
*/
void Update();
void GamePaused();
void GameUnpaused();
};
} // End of namespace CrateDemo
#endif
| /* 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_GAME_STATE_MANAGER_H
#define CRATE_DEMO_GAME_STATE_MANAGER_H
#include "common/game_state_manager_base.h"
namespace CrateDemo {
class GameStateManager : public Common::GameStateManagerBase {
public:
GameStateManager();
private:
public:
bool Initialize();
void Shutdown();
/**
* Return the wanted period of time between update() calls.
*
* IE: If you want update to be called 20 times a second, this
* should return 50.
*
* NOTE: This should probably be inlined.
* NOTE: This will only be called at the beginning of HalflingEngine::Run()
* TODO: Contemplate the cost/benefit of calling this once per frame
*
* @return The period in milliseconds
*/
inline double GetUpdatePeriod() { return 30.0; }
/**
* Called every time the game logic should be updated. The frequency
* of this being called is determined by getUpdatePeriod()
*/
void Update();
void GamePaused();
void GameUnpaused();
};
} // End of namespace CrateDemo
#endif
| Update GameStateManager to use new base class name | CRATE_DEMO: Update GameStateManager to use new base class name
| C | apache-2.0 | RichieSams/thehalflingproject,RichieSams/thehalflingproject,RichieSams/thehalflingproject |
7b10792bb24ef266527e67baa0c67e67687134a9 | Fibonacci/C/fibonacci.c | Fibonacci/C/fibonacci.c | #include <stdio.h>
int i, v, num1 = 0, num2 = 1, temp;
int main() {
// Enter here number of times fib number is calculated;
scanf("%d", &v);
printf("Fibonacci numbers:");
for (i; i <= v; i++) {
// This prints fibonacci number;
printf("%d, ", num1);
// This calculates fibonacci number;
temp = num1 + num2;
num1 = num2;
num2 = temp;
}
return 0;
}
| Add Fibonacci algorithm in C | Add Fibonacci algorithm in C | C | apache-2.0 | churrizo/Algorithms_Example,xiroV/Algorithms_Example,Thuva4/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,Thuva4/Algorithms_Example,Astrophilic/Algorithms_Example,xiroV/Algorithms_Example,maazsq/Algorithms_Example,AtoMc/Algorithms_Example,maazsq/Algorithms_Example,Astrophilic/Algorithms_Example,pabe94/Algorithms_Example,alok760/Algorithms_Example,churrizo/Algorithms_Example,AtoMc/Algorithms_Example,Astrophilic/Algorithms_Example,Anat-Port/Algorithms_Example,AtoMc/Algorithms_Example,Anat-Port/Algorithms_Example,xiroV/Algorithms_Example,Thuva4/Algorithms_Example,Astrophilic/Algorithms_Example,xiroV/Algorithms_Example,Astrophilic/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,churrizo/Algorithms_Example,pranjalrai/Algorithms_Example,xiroV/Algorithms_Example,AtoMc/Algorithms_Example,AtoMc/Algorithms_Example,Anat-Port/Algorithms_Example,xiroV/Algorithms_Example,alok760/Algorithms_Example,Anat-Port/Algorithms_Example,AtoMc/Algorithms_Example,pranjalrai/Algorithms_Example,churrizo/Algorithms_Example,maazsq/Algorithms_Example,alok760/Algorithms_Example,churrizo/Algorithms_Example,alok760/Algorithms_Example,maazsq/Algorithms_Example,alok760/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,Astrophilic/Algorithms_Example,Anat-Port/Algorithms_Example,alok760/Algorithms_Example,churrizo/Algorithms_Example,pranjalrai/Algorithms_Example,AtoMc/Algorithms_Example,xiroV/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,Thuva4/Algorithms_Example,pranjalrai/Algorithms_Example,Anat-Port/Algorithms_Example,Thuva4/Algorithms_Example,Anat-Port/Algorithms_Example,alok760/Algorithms_Example,Astrophilic/Algorithms_Example,pranjalrai/Algorithms_Example,maazsq/Algorithms_Example,pabe94/Algorithms_Example,Thuva4/Algorithms_Example,AtoMc/Algorithms_Example,AtoMc/Algorithms_Example,churrizo/Algorithms_Example,Anat-Port/Algorithms_Example,pabe94/Algorithms_Example,alok760/Algorithms_Example,Astrophilic/Algorithms_Example,maazsq/Algorithms_Example,pabe94/Algorithms_Example,Anat-Port/Algorithms_Example,pranjalrai/Algorithms_Example,Anat-Port/Algorithms_Example,pabe94/Algorithms_Example,Thuva4/Algorithms_Example,AtoMc/Algorithms_Example,pranjalrai/Algorithms_Example,Thuva4/Algorithms_Example,pabe94/Algorithms_Example,xiroV/Algorithms_Example,pabe94/Algorithms_Example,xiroV/Algorithms_Example,maazsq/Algorithms_Example,AtoMc/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,pabe94/Algorithms_Example,Thuva4/Algorithms_Example,churrizo/Algorithms_Example,Thuva4/Algorithms_Example,alok760/Algorithms_Example,pranjalrai/Algorithms_Example,maazsq/Algorithms_Example,alok760/Algorithms_Example,maazsq/Algorithms_Example,churrizo/Algorithms_Example,Thuva4/Algorithms_Example,pranjalrai/Algorithms_Example,churrizo/Algorithms_Example,pranjalrai/Algorithms_Example,maazsq/Algorithms_Example,Anat-Port/Algorithms_Example,xiroV/Algorithms_Example,pabe94/Algorithms_Example,Astrophilic/Algorithms_Example,AtoMc/Algorithms_Example,alok760/Algorithms_Example,Thuva4/Algorithms_Example,xiroV/Algorithms_Example,r-o-k-u-r-o-u/Algorithms_Example,maazsq/Algorithms_Example,pabe94/Algorithms_Example,Astrophilic/Algorithms_Example,alok760/Algorithms_Example,Astrophilic/Algorithms_Example,pranjalrai/Algorithms_Example,churrizo/Algorithms_Example,maazsq/Algorithms_Example,churrizo/Algorithms_Example,pabe94/Algorithms_Example |
|
0c14a2dfdbcc90865ad17d44dbd578a9d2b6b945 | opendatacon/DaemonInterface.h | opendatacon/DaemonInterface.h | /* opendatacon
*
* Copyright (c) 2015:
*
* DCrip3fJguWgVCLrZFfA7sIGgvx1Ou3fHfCxnrz4svAi
* yxeOtDhDCXf1Z4ApgXvX5ahqQmzRfJ2DoX8S05SqHA==
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef DAEMONWRAPPER_H
#define DAEMONWRAPPER_H
void daemonp();
void daemon_install();
void daemon_remove();
#endif | Add actual code to interface | Add actual code to interface
| C | apache-2.0 | neilstephens/opendatacon,neilstephens/opendatacon,neilstephens/opendatacon,neilstephens/opendatacon,neilstephens/opendatacon,neilstephens/opendatacon,neilstephens/opendatacon |
|
f61acc197adfc2a6c69f9da6e5f33036a502983e | src/condor_ckpt/fcntl.h | src/condor_ckpt/fcntl.h | #if defined(__cplusplus) && !defined(OSF1) /* GNU G++ */
# include "fix_gnu_fcntl.h"
#elif defined(AIX32) /* AIX bsdcc */
typedef unsigned short ushort;
# include <fcntl.h>
#elif defined(HPUX9) /* HPUX 9 */
# define fcntl __condor_hide_fcntl
# include <fcntl.h>
# undef fcntl
int fcntl( int fd, int req, int arg );
#else /* Everybody else */
# include <fcntl.h>
#endif
| #if defined(__cplusplus) && !defined(OSF1) /* GNU G++ */
# include "fix_gnu_fcntl.h"
#elif defined(AIX32) /* AIX bsdcc */
# if !defined(_ALL_SOURCE)
typedef ushort_t ushort;
# endif
# include <fcntl.h>
#elif defined(HPUX9) /* HPUX 9 */
# define fcntl __condor_hide_fcntl
# include <fcntl.h>
# undef fcntl
int fcntl( int fd, int req, int arg );
#else /* Everybody else */
# include <fcntl.h>
#endif
| Make sure that for AIX 3.2 we get ushort defined when we need it, but not doubly defined... | Make sure that for AIX 3.2 we get ushort defined when we need it, but
not doubly defined...
| C | apache-2.0 | bbockelm/condor-network-accounting,djw8605/condor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/condor,djw8605/condor,htcondor/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,htcondor/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,neurodebian/htcondor,neurodebian/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,djw8605/condor,clalancette/condor-dcloud,zhangzhehust/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,zhangzhehust/htcondor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,neurodebian/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/condor |
c584028875926b3a193e480e16bfc19b1c613438 | turing.h | turing.h | #ifndef TURING_H_
#define TURING_H_
#define TAPE_LEN 1024
#define turing_error(...) fprintf(stderr, __VA_ARGS__);\
return TURING_ERROR
typedef int bool;
typedef enum {
TURING_OK,
TURING_HALT,
TURING_ERROR
} turing_status_t;
typedef struct Turing {
bool *tape;
bool *p;
} Turing;
Turing *init_turing();
void free_turing(Turing *turing);
turing_status_t move_head(Turing *turing, int direction);
turing_status_t execute_instruction(Turing *turing, char *program);
turing_status_t execute_definite_instruction(Turing *turing, char *program);
#endif // TURING_H_
| #ifndef TURING_H_
#define TURING_H_
#define TAPE_LEN 1024
#define turing_error(...) fprintf(stderr, __VA_ARGS__);\
return TURING_ERROR
#define move_head_left(t) move_head(t, 0)
#define move_head_right(t) move_head(t, 1)
typedef int bool;
typedef enum {
TURING_OK,
TURING_HALT,
TURING_ERROR
} turing_status_t;
typedef struct Turing {
bool *tape;
bool *p;
} Turing;
Turing *init_turing();
void free_turing(Turing *turing);
turing_status_t move_head(Turing *turing, int direction);
turing_status_t execute_instruction(Turing *turing, char *program);
turing_status_t execute_definite_instruction(Turing *turing, char *program);
#endif // TURING_H_
| Implement left and right macros | Implement left and right macros
| C | mit | mindriot101/turing-machine |
09bb0bf7b1a23d056db347286539611f38145da7 | Plugin/CppApi/include/ArcGISRuntimeToolkit.h | Plugin/CppApi/include/ArcGISRuntimeToolkit.h | // Copyright 2016 ESRI
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
//
// See the Sample code usage restrictions document for further information.
//
#ifndef ArcGISRuntimeToolkit_H
#define ArcGISRuntimeToolkit_H
#include <QQmlExtensionPlugin>
#include "ToolkitCommon.h"
namespace Esri
{
namespace ArcGISRuntime
{
namespace Toolkit
{
class TOOLKIT_EXPORT ArcGISRuntimeToolkit : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
explicit ArcGISRuntimeToolkit(QObject* parent = nullptr);
void registerTypes(const char* uri);
static void registerToolkitTypes(const char* uri = "Esri.ArcGISRuntime.Toolkit.CppApi");
private:
static constexpr int s_versionMajor = 100;
static constexpr int s_versionMinor = 2;
};
} // Toolkit
} // ArcGISRuntime
} // Esri
#endif // ArcGISRuntimeToolkit_H
| // Copyright 2016 ESRI
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
//
// See the Sample code usage restrictions document for further information.
//
#ifndef ArcGISRuntimeToolkit_H
#define ArcGISRuntimeToolkit_H
#include <QQmlExtensionPlugin>
#include "ToolkitCommon.h"
namespace Esri
{
namespace ArcGISRuntime
{
namespace Toolkit
{
class TOOLKIT_EXPORT ArcGISRuntimeToolkit : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
explicit ArcGISRuntimeToolkit(QObject* parent = nullptr);
void registerTypes(const char* uri);
static void registerToolkitTypes(const char* uri = "Esri.ArcGISRuntime.Toolkit.CppApi");
private:
static constexpr int s_versionMajor = 100;
static constexpr int s_versionMinor = 3;
};
} // Toolkit
} // ArcGISRuntime
} // Esri
#endif // ArcGISRuntimeToolkit_H
| Update registration version for 100.3 | Update registration version for 100.3
| C | apache-2.0 | Esri/arcgis-runtime-toolkit-qt,Esri/arcgis-runtime-toolkit-qt,Esri/arcgis-runtime-toolkit-qt |
4ca8b01f499f2c3a72191e6eb89a7790cf8af7ef | src/tests/enesim_test_renderer_error.c | src/tests/enesim_test_renderer_error.c | #include "Enesim.h"
int main(int argc, char **argv)
{
Enesim_Renderer *r;
Enesim_Surface *s;
Enesim_Log *error = NULL;
enesim_init();
r = enesim_renderer_rectangle_new();
enesim_renderer_shape_fill_color_set(r, 0xffffffff);
/* we dont set any property to force the error */
s = enesim_surface_new(ENESIM_FORMAT_ARGB8888, 320, 240);
if (!enesim_renderer_draw(r, s, ENESIM_ROP_FILL, NULL, 0, 0, &error))
{
enesim_log_dump(error);
enesim_log_delete(error);
}
enesim_shutdown();
return 0;
}
| #include "Enesim.h"
int main(int argc, char **argv)
{
Enesim_Renderer *r;
Enesim_Surface *s;
Enesim_Log *error = NULL;
enesim_init();
r = enesim_renderer_rectangle_new();
enesim_renderer_shape_fill_color_set(r, 0xffffffff);
/* we dont set any property to force the error */
s = enesim_surface_new(ENESIM_FORMAT_ARGB8888, 320, 240);
if (!enesim_renderer_draw(r, s, ENESIM_ROP_FILL, NULL, 0, 0, &error))
{
enesim_log_dump(error);
enesim_log_unref(error);
}
enesim_shutdown();
return 0;
}
| Use the new log API | Use the new log API
| C | lgpl-2.1 | turran/enesim,turran/enesim,turran/enesim,turran/enesim |
645c521a70c3d06118c93002fa7dd0af103e1524 | project/src/concurrentqueue.h | project/src/concurrentqueue.h | #include <mutex>
#include <deque>
#ifndef SRC_CONCURRENT_QUEUE_H
#define SRC_CONCURRENT_QUEUE_H
/* Concurrent queue
* so far just make sure it is consisten, no performance optimizations
* but interface should be general enought to replace queue with faster one
*/
template< typename T >
struct ConcurrentQueue {
void enqueue( const T &data ) {
Guard g{ _lock };
_queue.push_back( data );
g.unlock();
_cond.notify_one();
}
/** get and pop head of queue, this will block if queue is empty
*/
T dequeue() {
Guard g{ _lock };
while ( _queue.empty() )
_cond.wait( g );
T data = _queue.front();
_queue.pop_front();
return data;
}
/** not safe
*/
bool empty() {
Guard g{ _lock };
return _queue.empty();
}
private:
std::mutex _lock;
std::deque< T > _queue;
std::condition_variable _cond;
using Guard = std::unique_lock< std::mutex >;
};
#endif // SRC_CONCURRENT_QUEUE_H
| Add (prototype of) concurrent queue. | project: Add (prototype of) concurrent queue.
| C | mit | vlstill/ttk4145,vlstill/ttk4145,vlstill/ttk4145,vlstill/ttk4145,superboy0712/realtime,superboy0712/realtime,vlstill/ttk4145,superboy0712/realtime,superboy0712/realtime,superboy0712/realtime,superboy0712/realtime,vlstill/ttk4145 |
|
41d07a68c0a5cfed255d3ad628d0d41687ca00df | tests/regression/04-mutex/37-indirect_rc.c | tests/regression/04-mutex/37-indirect_rc.c | #include <pthread.h>
int g;
int *g1;
int *g2;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
pthread_mutex_lock(&mutex);
(*g1)++; // RACE!
pthread_mutex_lock(&mutex);
return NULL;
}
int main(void) {
pthread_t id;
int x;
g1 = g2 = &g;
pthread_create(&id, NULL, t_fun, NULL);
(*g2)++; // RACE!
pthread_join (id, NULL);
return 0;
}
| #include <pthread.h>
int g;
int *g1;
int *g2;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
pthread_mutex_lock(&mutex);
(*g1)++; // RACE!
pthread_mutex_unlock(&mutex);
return NULL;
}
int main(void) {
pthread_t id;
int x;
g1 = g2 = &g;
pthread_create(&id, NULL, t_fun, NULL);
(*g2)++; // RACE!
pthread_join (id, NULL);
return 0;
}
| Fix lock-unlock copy-paste mistake in 04/37 | Fix lock-unlock copy-paste mistake in 04/37
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
c7ee376f947ec1d3e81d49e2c4a81adf1c292c1d | libc/sysdeps/linux/common/getrusage.c | libc/sysdeps/linux/common/getrusage.c | /* vi: set sw=4 ts=4: */
/*
* getrusage() for uClibc
*
* Copyright (C) 2000-2004 by Erik Andersen <[email protected]>
*
* GNU Library General Public License (LGPL) version 2 or later.
*/
#include "syscalls.h"
#include <unistd.h>
#include <wait.h>
_syscall2(int, getrusage, int, who, struct rusage *, usage);
| /* vi: set sw=4 ts=4: */
/*
* getrusage() for uClibc
*
* Copyright (C) 2000-2004 by Erik Andersen <[email protected]>
*
* GNU Library General Public License (LGPL) version 2 or later.
*/
#include "syscalls.h"
#include <unistd.h>
#include <wait.h>
_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage);
| Correct type, gcc-3.4.5 fails, thanks nitinkg for reporting/testing | Correct type, gcc-3.4.5 fails, thanks nitinkg for reporting/testing
| C | lgpl-2.1 | foss-for-synopsys-dwc-arc-processors/uClibc,ChickenRunjyd/klee-uclibc,ysat0/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,brgl/uclibc-ng,ChickenRunjyd/klee-uclibc,ysat0/uClibc,kraj/uClibc,ndmsystems/uClibc,wbx-github/uclibc-ng,majek/uclibc-vx32,hjl-tools/uClibc,mephi42/uClibc,hwoarang/uClibc,ndmsystems/uClibc,czankel/xtensa-uclibc,hwoarang/uClibc,OpenInkpot-archive/iplinux-uclibc,ChickenRunjyd/klee-uclibc,hwoarang/uClibc,hjl-tools/uClibc,atgreen/uClibc-moxie,ffainelli/uClibc,ddcc/klee-uclibc-0.9.33.2,hwoarang/uClibc,kraj/uclibc-ng,czankel/xtensa-uclibc,waweber/uclibc-clang,klee/klee-uclibc,foss-xtensa/uClibc,ffainelli/uClibc,groundwater/uClibc,foss-xtensa/uClibc,kraj/uClibc,skristiansson/uClibc-or1k,kraj/uclibc-ng,wbx-github/uclibc-ng,waweber/uclibc-clang,foss-xtensa/uClibc,skristiansson/uClibc-or1k,gittup/uClibc,atgreen/uClibc-moxie,ysat0/uClibc,hjl-tools/uClibc,wbx-github/uclibc-ng,kraj/uClibc,klee/klee-uclibc,klee/klee-uclibc,hjl-tools/uClibc,OpenInkpot-archive/iplinux-uclibc,ddcc/klee-uclibc-0.9.33.2,kraj/uclibc-ng,majek/uclibc-vx32,foss-for-synopsys-dwc-arc-processors/uClibc,ffainelli/uClibc,m-labs/uclibc-lm32,ndmsystems/uClibc,majek/uclibc-vx32,groundwater/uClibc,mephi42/uClibc,brgl/uclibc-ng,groundwater/uClibc,kraj/uclibc-ng,gittup/uClibc,atgreen/uClibc-moxie,czankel/xtensa-uclibc,m-labs/uclibc-lm32,ddcc/klee-uclibc-0.9.33.2,hjl-tools/uClibc,kraj/uClibc,waweber/uclibc-clang,brgl/uclibc-ng,groundwater/uClibc,m-labs/uclibc-lm32,waweber/uclibc-clang,ffainelli/uClibc,ffainelli/uClibc,foss-xtensa/uClibc,OpenInkpot-archive/iplinux-uclibc,czankel/xtensa-uclibc,gittup/uClibc,brgl/uclibc-ng,gittup/uClibc,skristiansson/uClibc-or1k,m-labs/uclibc-lm32,foss-for-synopsys-dwc-arc-processors/uClibc,skristiansson/uClibc-or1k,atgreen/uClibc-moxie,majek/uclibc-vx32,groundwater/uClibc,OpenInkpot-archive/iplinux-uclibc,ChickenRunjyd/klee-uclibc,ddcc/klee-uclibc-0.9.33.2,ysat0/uClibc,klee/klee-uclibc,wbx-github/uclibc-ng,mephi42/uClibc,ndmsystems/uClibc,mephi42/uClibc |
76ea7e35cc30ffe119cfe0b7ce2397ca4cb7a88a | test/CodeGen/stack-size-section.c | test/CodeGen/stack-size-section.c | // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT
// CHECK-ABSENT-NOT: section .stack_sizes
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT
// CHECK-PRESENT: section .stack_sizes
int foo() { return 42; }
| // REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT
// CHECK-ABSENT-NOT: section .stack_sizes
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT
// CHECK-PRESENT: section .stack_sizes
int foo() { return 42; }
| Fix test added in r321992 failing on some buildbots (again), test requires x86. | Fix test added in r321992 failing on some buildbots (again), test requires x86.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@322000 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
0b7ec39c2d41c26fc00e50367b5a2cc47be7fede | src/pch.h | src/pch.h | //
// pch.h
// Header for standard system include files.
//
#ifndef _divida_precompiled_header_h_
#define _divida_precompiled_header_h_
#ifdef WINDOWS
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif
#include <algorithm>
#include <iomanip>
#include <string>
#include <sstream>
#endif
| //
// pch.h
// Header for standard system include files.
//
#ifndef _divida_precompiled_header_h_
#define _divida_precompiled_header_h_
#ifdef WINDOWS
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif
#include <algorithm>
#include <iomanip>
#include <memory>
#include <string>
#include <sstream>
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
namespace std
{
template<typename T, typename ...Args>
unique_ptr<T> make_unique(Args&& ...args)
{
return unique_ptr<T>(new T(std::forward<Args>(args)...));
}
}
#endif
#endif
| Add backup implementation of std::make_unique. | Add backup implementation of std::make_unique.
| C | mit | chrisculy/Divida,chrisculy/Divida |
8c040708668c09654682c3133c3c16aa691f3bf9 | libtock/ambient_light.c | libtock/ambient_light.c | #include "ambient_light.h"
#include "tock.h"
typedef struct {
int intensity;
bool fired;
} ambient_light_data_t;
// callback for synchronous reads
static void ambient_light_cb(int intensity,
__attribute__ ((unused)) int unused1,
__attribute__ ((unused)) int unused2, void* ud) {
ambient_light_data_t* result = (ambient_light_data_t*)ud;
result->intensity = intensity;
result->fired = true;
}
int ambient_light_read_intensity_sync(int* lux_value) {
int err;
ambient_light_data_t result = {0};
result.fired = false;
err = ambient_light_subscribe(ambient_light_cb, (void*)(&result));
if (err < TOCK_SUCCESS) {
return err;
}
err = ambient_light_start_intensity_reading();
if (err < TOCK_SUCCESS) {
return err;
}
yield_for(&result.fired);
*lux_value = result.intensity;
return TOCK_SUCCESS;
}
int ambient_light_subscribe(subscribe_cb callback, void* userdata) {
return subscribe(DRIVER_NUM_AMBIENT_LIGHT, 0, callback, userdata);
}
int ambient_light_start_intensity_reading(void) {
return command(DRIVER_NUM_AMBIENT_LIGHT, 1, 0, 0);
}
| #include "ambient_light.h"
#include "tock.h"
typedef struct {
int intensity;
bool fired;
} ambient_light_data_t;
// internal callback for faking synchronous reads
static void ambient_light_cb(int intensity,
__attribute__ ((unused)) int unused1,
__attribute__ ((unused)) int unused2, void* ud) {
ambient_light_data_t* result = (ambient_light_data_t*)ud;
result->intensity = intensity;
result->fired = true;
}
int ambient_light_read_intensity_sync(int* lux_value) {
int err;
ambient_light_data_t result = {0};
result.fired = false;
err = ambient_light_subscribe(ambient_light_cb, (void*)(&result));
if (err < TOCK_SUCCESS) {
return err;
}
err = ambient_light_start_intensity_reading();
if (err < TOCK_SUCCESS) {
return err;
}
yield_for(&result.fired);
*lux_value = result.intensity;
return TOCK_SUCCESS;
}
int ambient_light_subscribe(subscribe_cb callback, void* userdata) {
return subscribe(DRIVER_NUM_AMBIENT_LIGHT, 0, callback, userdata);
}
int ambient_light_start_intensity_reading(void) {
return command(DRIVER_NUM_AMBIENT_LIGHT, 1, 0, 0);
}
| Revert "Updating ambient light to 2.0 API." | Revert "Updating ambient light to 2.0 API."
This reverts commit 9a9df3a205dcebfcb358b60ef11df54698ec6dce.
| C | apache-2.0 | tock/libtock-c,tock/libtock-c,tock/libtock-c |
3f76bfade6c09f340aa3c5d1d53ea9bbb736761f | CefSharp.Core/Internals/StringVisitor.h | CefSharp.Core/Internals/StringVisitor.h | // Copyright 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "include/cef_string_visitor.h"
namespace CefSharp
{
private class StringVisitor : public CefStringVisitor
{
private:
gcroot<IStringVisitor^> _visitor;
public:
StringVisitor(IStringVisitor^ visitor) :
_visitor(visitor)
{
}
~StringVisitor()
{
_visitor = nullptr;
}
virtual void Visit(const CefString& string) OVERRIDE;
IMPLEMENT_REFCOUNTING(StringVisitor);
};
} | // Copyright 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "include/cef_string_visitor.h"
namespace CefSharp
{
private class StringVisitor : public CefStringVisitor
{
private:
gcroot<IStringVisitor^> _visitor;
public:
StringVisitor(IStringVisitor^ visitor) :
_visitor(visitor)
{
}
~StringVisitor()
{
_visitor = nullptr;
}
virtual void Visit(const CefString& string) OVERRIDE;
IMPLEMENT_REFCOUNTING(StringVisitor);
};
} | Fix minor indentation issue (formatting) | Fix minor indentation issue (formatting)
| C | bsd-3-clause | joshvera/CefSharp,windygu/CefSharp,haozhouxu/CefSharp,NumbersInternational/CefSharp,jamespearce2006/CefSharp,Livit/CefSharp,zhangjingpu/CefSharp,illfang/CefSharp,VioletLife/CefSharp,yoder/CefSharp,rlmcneary2/CefSharp,NumbersInternational/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,wangzheng888520/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,illfang/CefSharp,dga711/CefSharp,ITGlobal/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,zhangjingpu/CefSharp,VioletLife/CefSharp,NumbersInternational/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,jamespearce2006/CefSharp,battewr/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,wangzheng888520/CefSharp,yoder/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,Octopus-ITSM/CefSharp,windygu/CefSharp,battewr/CefSharp,dga711/CefSharp,illfang/CefSharp,wangzheng888520/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,ITGlobal/CefSharp,wangzheng888520/CefSharp,Haraguroicha/CefSharp,rover886/CefSharp,joshvera/CefSharp,ITGlobal/CefSharp,rover886/CefSharp,battewr/CefSharp,haozhouxu/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,rlmcneary2/CefSharp,AJDev77/CefSharp,joshvera/CefSharp,ruisebastiao/CefSharp,gregmartinhtc/CefSharp,jamespearce2006/CefSharp,Haraguroicha/CefSharp,Octopus-ITSM/CefSharp,Livit/CefSharp,battewr/CefSharp,AJDev77/CefSharp,AJDev77/CefSharp,haozhouxu/CefSharp,VioletLife/CefSharp,VioletLife/CefSharp,Haraguroicha/CefSharp,Livit/CefSharp,rover886/CefSharp,illfang/CefSharp,dga711/CefSharp,windygu/CefSharp,Octopus-ITSM/CefSharp,Octopus-ITSM/CefSharp,rover886/CefSharp,Livit/CefSharp,NumbersInternational/CefSharp,ruisebastiao/CefSharp,twxstar/CefSharp,joshvera/CefSharp,rover886/CefSharp,ITGlobal/CefSharp,windygu/CefSharp |
ea83ee487a59bb5d9fa122614886a2357b990e64 | PHOS/AliPHOSPreprocessor.h | PHOS/AliPHOSPreprocessor.h | #ifndef ALIPHOSPREPROCESSOR_H
#define ALIPHOSPREPROCESSOR_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// Class AliPHOSPreprocessor
///////////////////////////////////////////////////////////////////////////////
#include "AliPreprocessor.h"
class AliPHOSPreprocessor : public AliPreprocessor {
public:
AliPHOSPreprocessor();
AliPHOSPreprocessor(const char* detector, AliShuttleInterface* shuttle);
protected:
virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
virtual UInt_t Process(TMap* valueSet);
ClassDef(AliPHOSPreprocessor,0);
};
#endif
| #ifndef ALIPHOSPREPROCESSOR_H
#define ALIPHOSPREPROCESSOR_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// Class AliPHOSPreprocessor
///////////////////////////////////////////////////////////////////////////////
#include "AliPreprocessor.h"
class AliPHOSPreprocessor : public AliPreprocessor {
public:
AliPHOSPreprocessor();
AliPHOSPreprocessor(const char* detector, AliShuttleInterface* shuttle);
protected:
virtual UInt_t Process(TMap* valueSet);
ClassDef(AliPHOSPreprocessor,0);
};
#endif
| Remove declaration of unimplemented method | Remove declaration of unimplemented method
| C | bsd-3-clause | coppedis/AliRoot,shahor02/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,sebaleh/AliRoot,ecalvovi/AliRoot,miranov25/AliRoot,miranov25/AliRoot,miranov25/AliRoot,alisw/AliRoot,alisw/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,shahor02/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,shahor02/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,alisw/AliRoot,sebaleh/AliRoot,sebaleh/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,jgrosseo/AliRoot,alisw/AliRoot,alisw/AliRoot,miranov25/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,ecalvovi/AliRoot,miranov25/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,shahor02/AliRoot,shahor02/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,ALICEHLT/AliRoot,jgrosseo/AliRoot,sebaleh/AliRoot,ALICEHLT/AliRoot,jgrosseo/AliRoot,shahor02/AliRoot,jgrosseo/AliRoot,alisw/AliRoot |
17c191e8231e6429309bd6cc8e826eb38b9d8d89 | include/bubblesorts-bubble-inl.h | include/bubblesorts-bubble-inl.h | #ifndef SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_
#define SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_
namespace sorting {
namespace bubble {
template <class T>
void BubbleSort(T * const array, const int N)
/**
* Bubble sort: Bubble sort
* Scaling:
* Best case:
* Worst case:
* Useful:
*
*/
{
}
} // namespace bubble
} // namespace sorting
#endif // SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_
| #ifndef SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_
#define SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_
namespace sorting {
namespace bubble {
template <class T>
void BubbleSort(T * const array, const int N)
/**
* Bubble sort: Bubble sort
* Scaling:
* Best case:
* Worst case:
* Useful:
*
*/
{
int pass_count = 0; // Number of pass over the array.
int swap_count = 0; // Number of swap for a single pass.
// Pass over the array while the swap count is non-null.
do
{
// It's a new pass; reset the count of swap.
swap_count = 0;
// Iterate over the array, skipping the last item
for (int i = 0 ; i < N-1 ; i++)
{
// Swap elements if next one is "smaller" and register the swap.
if (array[i] > array[i+1])
{
std::swap(array[i], array[i+1]);
swap_count++;
}
}
pass_count++;
} while (swap_count != 0);
}
} // namespace bubble
} // namespace sorting
#endif // SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_
| Add working bubble sort implementation | Add working bubble sort implementation
| C | bsd-3-clause | nbigaouette/sorting,nbigaouette/sorting,nbigaouette/sorting,nbigaouette/sorting |
513937c89b160cb689dfd457e6aca34df58dc8f9 | Stat_Mode/C/patrickyevsukov_stat_mode.c | Stat_Mode/C/patrickyevsukov_stat_mode.c | // Patrick Yevsukov
// 2013 CC BY-NC-SA 4.0
// Excerpt From github.com/PatrickYevsukov/Statistics-Calculator
// I devised this algorithm to identify the statistical mode or
// modes of a dataset. It requires one pass through the set to
// identify the set's mode or mode's.
// This algorithm works by keeping track of the number of times a
// unique value occurs in the set. If a unique value has occurred
// more times than the ones before it, it is added to the list of
// modes. As the loop continues all values which occur this number
// of times are added to the list of modes, unless another unique
// value occurs more times than the currently identified modes. If
// this happens, the mode array indexing variable is reset to zero
// and the previously identified values are overwritten by the new
// modes. When finished, the mode array indexing variable will be
// one less than the number of modes.
// This algorithm requires a set of values in which all instances
// of a unique value are listed next to one another.
#include <stdio.h>
#include <stdlib.h>
#define MAX_SAMPLE 25
double *
SampleMode(double *, int *);
double *
SampleMode(double *sample, int *sample_size)
{
int ii = 0;
int kk = 0;
int num_modes = 0;
int previous_freq = 0;
int current_freq = 1; // Every value must occur at least once
double *modes = NULL;
modes = (double *) malloc(MAX_SAMPLE * sizeof *modes);
for (ii = 0; ii <= *sample_size - 1; ii++)
{
if (sample[ii] == sample[ii + 1])
{
current_freq++;
}
else
{
if (current_freq > previous_freq)
{
kk = 0; // Reset
previous_freq = current_freq;
modes[kk] = sample[ii];
}
else if (current_freq == previous_freq)
{
kk++;
modes[kk] = sample[ii];
}
current_freq = 1; // Reset
}
}
num_modes = kk + 1;
return modes;
}
| Add Statistical Mode Finding Algorithm | Add Statistical Mode Finding Algorithm
Implementation In C | C | mit | kidaa/Algorithm-Implementations,mishin/Algorithm-Implementations,vikas17a/Algorithm-Implementations,movb/Algorithm-Implementations,Endika/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,mishin/Algorithm-Implementations,joshimoo/Algorithm-Implementations,Yonaba/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,mishin/Algorithm-Implementations,isalnikov/Algorithm-Implementations,mishin/Algorithm-Implementations,joshimoo/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,mishin/Algorithm-Implementations,girishramnani/Algorithm-Implementations,Etiene/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,imanmafi/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,jb1717/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,vikas17a/Algorithm-Implementations,warreee/Algorithm-Implementations,girishramnani/Algorithm-Implementations,vikas17a/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,pravsingh/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,Endika/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,isalnikov/Algorithm-Implementations,vikas17a/Algorithm-Implementations,kennyledet/Algorithm-Implementations,Yonaba/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,jb1717/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,imanmafi/Algorithm-Implementations,mishin/Algorithm-Implementations,movb/Algorithm-Implementations,jiang42/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,Yonaba/Algorithm-Implementations,movb/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,jiang42/Algorithm-Implementations,kennyledet/Algorithm-Implementations,joshimoo/Algorithm-Implementations,kidaa/Algorithm-Implementations,Etiene/Algorithm-Implementations,imanmafi/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,kidaa/Algorithm-Implementations,movb/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,joshimoo/Algorithm-Implementations,Endika/Algorithm-Implementations,isalnikov/Algorithm-Implementations,warreee/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,joshimoo/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,joshimoo/Algorithm-Implementations,warreee/Algorithm-Implementations,imanmafi/Algorithm-Implementations,Yonaba/Algorithm-Implementations,Etiene/Algorithm-Implementations,mishin/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,pravsingh/Algorithm-Implementations,isalnikov/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,isalnikov/Algorithm-Implementations,Yonaba/Algorithm-Implementations,Endika/Algorithm-Implementations,imanmafi/Algorithm-Implementations,vikas17a/Algorithm-Implementations,isalnikov/Algorithm-Implementations,warreee/Algorithm-Implementations,mishin/Algorithm-Implementations,jb1717/Algorithm-Implementations,jiang42/Algorithm-Implementations,Yonaba/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,vikas17a/Algorithm-Implementations,isalnikov/Algorithm-Implementations,warreee/Algorithm-Implementations,isalnikov/Algorithm-Implementations,Yonaba/Algorithm-Implementations,Etiene/Algorithm-Implementations,rohanp/Algorithm-Implementations,isalnikov/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,Etiene/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,imanmafi/Algorithm-Implementations,rohanp/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,kidaa/Algorithm-Implementations,joshimoo/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,Endika/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,girishramnani/Algorithm-Implementations,kidaa/Algorithm-Implementations,mishin/Algorithm-Implementations,Yonaba/Algorithm-Implementations,jiang42/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,kidaa/Algorithm-Implementations,girishramnani/Algorithm-Implementations,movb/Algorithm-Implementations,joshimoo/Algorithm-Implementations,jiang42/Algorithm-Implementations,rohanp/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,jb1717/Algorithm-Implementations,vikas17a/Algorithm-Implementations,jb1717/Algorithm-Implementations,movb/Algorithm-Implementations,Etiene/Algorithm-Implementations,imanmafi/Algorithm-Implementations,kidaa/Algorithm-Implementations,imanmafi/Algorithm-Implementations,mishin/Algorithm-Implementations,warreee/Algorithm-Implementations,rohanp/Algorithm-Implementations,girishramnani/Algorithm-Implementations,jiang42/Algorithm-Implementations,jiang42/Algorithm-Implementations,rohanp/Algorithm-Implementations,jb1717/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kidaa/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,rohanp/Algorithm-Implementations,kidaa/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,jb1717/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,isalnikov/Algorithm-Implementations,rohanp/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,Endika/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,joshimoo/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,jb1717/Algorithm-Implementations,pravsingh/Algorithm-Implementations,vikas17a/Algorithm-Implementations,vikas17a/Algorithm-Implementations,Endika/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,rohanp/Algorithm-Implementations,isalnikov/Algorithm-Implementations,Yonaba/Algorithm-Implementations,imanmafi/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,rohanp/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,Yonaba/Algorithm-Implementations,imanmafi/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,Endika/Algorithm-Implementations,rohanp/Algorithm-Implementations,girishramnani/Algorithm-Implementations,mishin/Algorithm-Implementations,rohanp/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,imanmafi/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,Etiene/Algorithm-Implementations,movb/Algorithm-Implementations,warreee/Algorithm-Implementations,mishin/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,girishramnani/Algorithm-Implementations,imanmafi/Algorithm-Implementations,movb/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,Etiene/Algorithm-Implementations,vikas17a/Algorithm-Implementations,kidaa/Algorithm-Implementations,jb1717/Algorithm-Implementations,kennyledet/Algorithm-Implementations,jb1717/Algorithm-Implementations,jb1717/Algorithm-Implementations,kidaa/Algorithm-Implementations,jb1717/Algorithm-Implementations,isalnikov/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,movb/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,Etiene/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,isalnikov/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,Endika/Algorithm-Implementations,movb/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,movb/Algorithm-Implementations,pravsingh/Algorithm-Implementations,Etiene/Algorithm-Implementations,kennyledet/Algorithm-Implementations,jiang42/Algorithm-Implementations,movb/Algorithm-Implementations,vikas17a/Algorithm-Implementations,mishin/Algorithm-Implementations,warreee/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,rohanp/Algorithm-Implementations,pravsingh/Algorithm-Implementations,joshimoo/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,Endika/Algorithm-Implementations,kidaa/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,Endika/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,kennyledet/Algorithm-Implementations,warreee/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kidaa/Algorithm-Implementations,jb1717/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,joshimoo/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,jiang42/Algorithm-Implementations,kennyledet/Algorithm-Implementations,Endika/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,warreee/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,kennyledet/Algorithm-Implementations,Yonaba/Algorithm-Implementations,Yonaba/Algorithm-Implementations,jiang42/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,pravsingh/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,jiang42/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,pravsingh/Algorithm-Implementations,aayushKumarJarvis/Algorithm-Implementations,movb/Algorithm-Implementations,vikas17a/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,girishramnani/Algorithm-Implementations,vikas17a/Algorithm-Implementations,jb1717/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,pravsingh/Algorithm-Implementations,warreee/Algorithm-Implementations,Endika/Algorithm-Implementations,rohanp/Algorithm-Implementations,jiang42/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,Endika/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,jiang42/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,Yonaba/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,Yonaba/Algorithm-Implementations,Etiene/Algorithm-Implementations,Etiene/Algorithm-Implementations,warreee/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,kidaa/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,joshimoo/Algorithm-Implementations,joshimoo/Algorithm-Implementations,joshimoo/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,Etiene/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,movb/Algorithm-Implementations,warreee/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,girishramnani/Algorithm-Implementations,jiang42/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,warreee/Algorithm-Implementations,varunparkhe/Algorithm-Implementations,warreee/Algorithm-Implementations,pravsingh/Algorithm-Implementations,Endika/Algorithm-Implementations,imanmafi/Algorithm-Implementations,kennyledet/Algorithm-Implementations,mishin/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,praveenjha527/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,imanmafi/Algorithm-Implementations,kidaa/Algorithm-Implementations,isalnikov/Algorithm-Implementations,imanmafi/Algorithm-Implementations,AntonioModer/Algorithm-Implementations,Sweet-kid/Algorithm-Implementations,Etiene/Algorithm-Implementations,mishin/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,isalnikov/Algorithm-Implementations,movb/Algorithm-Implementations,jb1717/Algorithm-Implementations,girishramnani/Algorithm-Implementations,warreee/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,rohanp/Algorithm-Implementations,girishramnani/Algorithm-Implementations,Yonaba/Algorithm-Implementations,sugiartocokrowibowo/Algorithm-Implementations,pravsingh/Algorithm-Implementations,vikas17a/Algorithm-Implementations,vikas17a/Algorithm-Implementations,jiang42/Algorithm-Implementations,joshimoo/Algorithm-Implementations,imrandomizer/Algorithm-Implementations,girishramnani/Algorithm-Implementations,rohanp/Algorithm-Implementations |
|
e2b4f630a3880e4b30a960890672acf8dffa0dbd | src/units/unit.h | src/units/unit.h |
#ifndef UNITS_UNIT_H_
#define UNITS_UNIT_H_
#include <SFML/Graphics.hpp>
#include "engine/instance.h"
#include "base/aliases.h"
class Unit : public Instance {
public:
Unit();
virtual ~Unit();
virtual void Step(sf::Time elapsed);
void set_life(unsigned life) {
life_ = life;
}
unsigned life() {
return life_;
}
void set_position(Vec2f pos) {
sprite_.set_position(pos);
}
Vec2f position() {
return sprite_.getPosition();
}
void set_movement_speed(Vec2f movement_speed) {
movement_speed_ = movement_speed;
}
void set_attack_speed(unsigned attack_speed) {
attack_speed_ = attack_speed;
}
protected:
unsigned life_;
unsigned damage_;
unsigned attack_speed_;
Vec2f movement_speed_;
};
#endif // UNITS_UNIT_H_
|
#ifndef UNITS_UNIT_H_
#define UNITS_UNIT_H_
#include <SFML/Graphics.hpp>
#include "engine/instance.h"
#include "base/aliases.h"
class Unit : public Instance {
public:
Unit();
virtual ~Unit();
virtual void Step(sf::Time elapsed);
void set_life(unsigned life) {
life_ = life;
}
unsigned life() {
return life_;
}
void set_position(Vec2f pos) {
sprite_.set_position(pos);
}
Vec2f position() {
return sprite_.position();
}
void set_movement_speed(Vec2f movement_speed) {
movement_speed_ = movement_speed;
}
void set_attack_speed(unsigned attack_speed) {
attack_speed_ = attack_speed;
}
protected:
unsigned life_;
unsigned damage_;
unsigned attack_speed_;
Vec2f movement_speed_;
};
#endif // UNITS_UNIT_H_
| Rename function to the new version. | Rename function to the new version.
| C | mit | davidgasquez/loto,davidgasquez/loto |
92f64df6d3551bec6f5c14e78b1195a381f9fc11 | src/isolate/v8_version.h | src/isolate/v8_version.h | // These macros weren't added until v8 version 4.4
#include "node_wrapper.h"
#ifndef V8_MAJOR_VERSION
#if NODE_MODULE_VERSION <= 11
#define V8_MAJOR_VERSION 3
#define V8_MINOR_VERSION 14
#define V8_PATCH_LEVEL 0
#elif V8_MAJOR_VERSION <= 14
#define V8_MAJOR_VERSION 3
#define V8_MINOR_VERSION 28
#define V8_PATCH_LEVEL 0
#else
#error v8 version macros missing
#endif
#endif
#define V8_AT_LEAST(major, minor, patch) (\
V8_MAJOR_VERSION > (major) || \
(V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION >= (minor)) || \
(V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION == (minor) && V8_PATCH_LEVEL >= (patch)) \
)
#define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (\
defined(NODE_MODULE_VERSION) ? NODE_MODULE_VERSION >= nodejs : V8_AT_LEAST(v8_major, v8_minor, v8_patch) \
)
| // These macros weren't added until v8 version 4.4
#include "node_wrapper.h"
#ifndef V8_MAJOR_VERSION
#if NODE_MODULE_VERSION <= 11
#define V8_MAJOR_VERSION 3
#define V8_MINOR_VERSION 14
#define V8_PATCH_LEVEL 0
#elif V8_MAJOR_VERSION <= 14
#define V8_MAJOR_VERSION 3
#define V8_MINOR_VERSION 28
#define V8_PATCH_LEVEL 0
#else
#error v8 version macros missing
#endif
#endif
#define V8_AT_LEAST(major, minor, patch) (\
V8_MAJOR_VERSION > (major) || \
(V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION >= (minor)) || \
(V8_MAJOR_VERSION == (major) && V8_MINOR_VERSION == (minor) && V8_PATCH_LEVEL >= (patch)) \
)
#ifdef NODE_MODULE_VERSION
#define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (NODE_MODULE_VERSION >= nodejs)
#else
#define NODE_MODULE_OR_V8_AT_LEAST(nodejs, v8_major, v8_minor, v8_patch) (V8_AT_LEAST(v8_major, v8_minor, v8_patch))
#endif | Fix msvc preprocessor error (omg) | Fix msvc preprocessor error (omg)
| C | isc | laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm |
c5bccd7f4bf957d11ea9081eeea4e5aebdb43f46 | src/string_metric.h | src/string_metric.h | /*
* Copyright (C) 2016 deipi.com LLC and contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#pragma once
#include "metrics/jaccard.h"
#include "metrics/jaro.h"
#include "metrics/jaro_winkler.h"
#include "metrics/levenshtein.h"
#include "metrics/sorensen_dice.h"
| Add include file for string metric | Add include file for string metric
| C | mit | Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand |
|
2413283acfba846293a4476354cd2a88d79a8bb8 | arc/arc/Model/FileSystem.h | arc/arc/Model/FileSystem.h | //
// FileSystem.h
// arc
//
// Created by Jerome Cheng on 19/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Folder.h"
@interface FileSystem : NSObject {
@private
Folder *_rootFolder; // The root folder.
}
// Returns the root folder of the entire file system.
- (Folder*)getRootFolder;
// Returns the single FileSystem instance.
+ (FileSystem*)getInstance;
@end
| //
// FileSystem.h
// arc
//
// Created by Jerome Cheng on 19/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Folder.h"
@interface FileSystem : NSObject {
@private
Folder *_rootFolder; // The root folder.
}
// Returns the root folder of the entire file system.
- (Folder*)getRootFolder;
// Returns the single FileSystem instance.
+ (FileSystem*)getInstance;
// Returns an NSArray of FileObjects, corresponding to the contents
// of the given folder.
- (NSArray*)getFolderContents:(Folder*)folder;
// Returns an NSString containing the contents of the given file.
- (NSString*)getFileContents:(File*)file;
@end
| Add signatures for content retrieval methods. | Add signatures for content retrieval methods.
| C | mit | BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc |
12fb043e39695727114f7d24e5e3b2911a79c7a4 | Cerberus.h | Cerberus.h | #ifndef CERBERUS_H
#define CERBERUS_H
#include <iostream>
#include "ceres/ceres.h"
using namespace std;
using namespace ceres;
class Cerberus {
public:
Cerberus();
Solver::Options options;
LossFunction *loss;
Problem problem;
Solver::Summary summary;
void solve();
};
#endif | #ifndef CERBERUS_H
#define CERBERUS_H
#include <iostream>
#include "ceres/ceres.h"
#include "ceres/rotation.h"
using namespace std;
using namespace ceres;
class Cerberus {
public:
Cerberus();
Solver::Options options;
LossFunction *loss;
Problem problem;
Solver::Summary summary;
void solve();
};
// Rt is a 4x3 transformation matrix of the form [R|t]. result is a
// 6-dimensional vector with first three terms representing axis, magnitude
// angle, and the last three terms represent translation
template <typename T> void TransformationMatrixToAngleAxisAndTranslation(T *Rt, T *result) {
RotationMatrixToAngleAxis<T>(MatrixAdapter<const T, 4, 1>(Rt), result);
result[3] = Rt[3];
result[4] = Rt[7];
result[5] = Rt[11];
}
// At is a 6-dimensional vector with first three terms representing axis,
// magnitude angle, and the last three terms represent translation. Rt is a
// 4x3 transformation matrix of the form [R|t].
template <typename T> void AngleAxisAndTranslationToTransformationMatrix(const T *At, T *result) {
AngleAxisToRotationMatrix<T>(At, MatrixAdapter<T, 4, 1>(result));
result[3] = At[3];
result[7] = At[4];
result[11] = At[5];
}
#endif | Add utility functions for converting to and from AngleAxis | Add utility functions for converting to and from AngleAxis
| C | mit | danielsuo/Cerberus,danielsuo/Cerberus |
38310122f3a4d99326320da14638ff9088a33b56 | src/source/libpetsc4py.c | src/source/libpetsc4py.c | /* ---------------------------------------------------------------- */
#include <Python.h>
/* ---------------------------------------------------------------- */
#define MPICH_SKIP_MPICXX 1
#define OMPI_SKIP_MPICXX 1
#include <petsc.h>
/* ---------------------------------------------------------------- */
#include "python_core.h"
#define PETSCMAT_DLL
#include "python_mat.c"
#undef PETSCMAT_DLL
#define PETSCKSP_DLL
#include "python_ksp.c"
#undef PETSCKSP_DLL
#define PETSCKSP_DLL
#include "python_pc.c"
#undef PETSCKSP_DLL
#define PETSCSNES_DLL
#include "python_snes.c"
#undef PETSCSNES_DLL
#define PETSCTS_DLL
#include "python_ts.c"
#undef PETSCTS_DLL
/* ---------------------------------------------------------------- */
| /* ---------------------------------------------------------------- */
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#endif
/* ---------------------------------------------------------------- */
#define MPICH_SKIP_MPICXX 1
#define OMPI_SKIP_MPICXX 1
#include <petsc.h>
/* ---------------------------------------------------------------- */
#include "python_core.h"
#define PETSCMAT_DLL
#include "python_mat.c"
#undef PETSCMAT_DLL
#define PETSCKSP_DLL
#include "python_ksp.c"
#undef PETSCKSP_DLL
#define PETSCKSP_DLL
#include "python_pc.c"
#undef PETSCKSP_DLL
#define PETSCSNES_DLL
#include "python_snes.c"
#undef PETSCSNES_DLL
#define PETSCTS_DLL
#include "python_ts.c"
#undef PETSCTS_DLL
/* ---------------------------------------------------------------- */
| Fix build failure with Python<=2.4 and PETSc<=3.1 | Fix build failure with Python<=2.4 and PETSc<=3.1
| C | bsd-2-clause | zonca/petsc4py,zonca/petsc4py,zonca/petsc4py,zonca/petsc4py |
2b2f2991586e9aa843221f629df29596f8bfc6da | test/Frontend/dependency-generation-crash.c | test/Frontend/dependency-generation-crash.c | // RUN: not %clang_cc1 -E -dependency-file bla -MT %t/doesnotexist/bla.o -MP -o $t/doesnotexist/bla.o -x c /dev/null 2>&1 | FileCheck %s
// CHECK: error: unable to open output file
// rdar://9286457
| // RUN: not %clang_cc1 -E -dependency-file bla -MT %t/doesnotexist/bla.o -MP -o %t/doesnotexist/bla.o -x c /dev/null 2>&1 | FileCheck %s
// CHECK: error: unable to open output file
// rdar://9286457
| Fix typo in my last commit. | Fix typo in my last commit.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@231039 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
ffbfac16b089edc2ce0ff219bb6f8f8fc679f132 | include/libport/detect-win32.h | include/libport/detect-win32.h | /*
* Copyright (C) 2008-2010, Gostai S.A.S.
*
* This software is provided "as is" without warranty of any kind,
* either expressed or implied, including but not limited to the
* implied warranties of fitness for a particular purpose.
*
* See the LICENSE file for more information.
*/
#ifndef LIBPORT_DETECT_WIN32_H
# define LIBPORT_DETECT_WIN32_H
# ifndef WIN32
# if defined LIBPORT_WIN32 || defined _MSC_VER
# define WIN32
# endif
# endif
# ifdef WIN32
// Normalize to 1
# undef WIN32
# define WIN32 1
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0400
# endif
# endif /* !WIN32 */
# ifdef WIN32
# define WIN32_IF(Then, Else) Then
# define EXEEXT ".exe"
# else
# define WIN32_IF(Then, Else) Else
# define EXEEXT ""
# endif
#endif // !LIBPORT_DETECT_WIN32_H
| /*
* Copyright (C) 2008-2011, Gostai S.A.S.
*
* This software is provided "as is" without warranty of any kind,
* either expressed or implied, including but not limited to the
* implied warranties of fitness for a particular purpose.
*
* See the LICENSE file for more information.
*/
#ifndef LIBPORT_DETECT_WIN32_H
# define LIBPORT_DETECT_WIN32_H
# ifndef WIN32
# if defined LIBPORT_WIN32 || defined _MSC_VER
# define WIN32
# endif
# endif
# ifdef WIN32
// Normalize to 1
# undef WIN32
# define WIN32 1
# ifndef _WIN32_WINNT
// Boost 1.47 uses InitializeCriticalSectionAndSpinCount which is
// defined starting at 0x403
// (http://msdn.microsoft.com/en-us/library/windows/desktop/ms683476(v=vs.85).aspx).
# define _WIN32_WINNT 0x0403
# endif
# endif /* !WIN32 */
# ifdef WIN32
# define WIN32_IF(Then, Else) Then
# define EXEEXT ".exe"
# else
# define WIN32_IF(Then, Else) Else
# define EXEEXT ""
# endif
#endif // !LIBPORT_DETECT_WIN32_H
| Boost 1.47 on Windows: require _WIN32_WINNT 0x0403. | Boost 1.47 on Windows: require _WIN32_WINNT 0x0403.
* include/libport/detect-win32.h: here.
| C | bsd-3-clause | aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport |
1eb469e28be333e475b9b8b7c05d23c707ef2cad | Libs/PublicHeaders.h | Libs/PublicHeaders.h | //
// PublicHeaders.h
// Insider
//
// Created by Alexandru Maimescu on 3/2/16.
// Copyright © 2016 Alex Maimescu. All rights reserved.
//
#ifndef PublicHeaders_h
#define PublicHeaders_h
// GCDWebServer https://github.com/swisspol/GCDWebServer
#import <Insider/GCDWebServer.h>
#import <Insider/GCDWebServerURLEncodedFormRequest.h>
#import <Insider/GCDWebServerDataResponse.h>
// iOS-System-Services https://github.com/Shmoopi/iOS-System-Services
#import <Insider/SystemServices.h>
#endif /* PublicHeaders_h */
| //
// PublicHeaders.h
// Insider
//
// Created by Alexandru Maimescu on 3/2/16.
// Copyright © 2016 Alex Maimescu. All rights reserved.
//
#ifndef PublicHeaders_h
#define PublicHeaders_h
// GCDWebServer https://github.com/swisspol/GCDWebServer
#import "GCDWebServer.h"
#import "GCDWebServerURLEncodedFormRequest.h"
#import "GCDWebServerDataResponse.h"
// iOS-System-Services https://github.com/Shmoopi/iOS-System-Services
#import "SystemServices.h"
#endif /* PublicHeaders_h */
| Update imports in umbrella header. | Update imports in umbrella header.
| C | mit | alexmx/Insider,alexmx/Insider,alexmx/Insider,alexmx/Insider,alexmx/Insider,alexmx/Insider |
ad42abb933a1801721a5f0abe6bdb70bc8d70334 | components/libc/compilers/newlib/libc.c | components/libc/compilers/newlib/libc.c | /*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017/10/15 bernard the first version
*/
#include <rtthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/time.h>
#include "libc.h"
#ifdef RT_USING_PTHREADS
#include <pthread.h>
#endif
int _EXFUN(putenv,(char *__string));
int libc_system_init(void)
{
#if defined(RT_USING_DFS) & defined(RT_USING_DFS_DEVFS) & defined(RT_USING_CONSOLE)
rt_device_t dev_console;
dev_console = rt_console_get_device();
if (dev_console)
{
#if defined(RT_USING_POSIX)
libc_stdio_set_console(dev_console->parent.name, O_RDWR);
#else
libc_stdio_set_console(dev_console->parent.name, O_WRONLY);
#endif
}
#endif
/* set PATH and HOME */
putenv("PATH=/bin");
putenv("HOME=/home");
#if defined RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT
pthread_system_init();
#endif
return 0;
}
INIT_COMPONENT_EXPORT(libc_system_init);
| /*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017/10/15 bernard the first version
*/
#include <rtthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/time.h>
#include "libc.h"
#ifdef RT_USING_PTHREADS
#include <pthread.h>
#endif
int _EXFUN(putenv,(char *__string));
int libc_system_init(void)
{
#if defined(RT_USING_DFS) & defined(RT_USING_DFS_DEVFS) & defined(RT_USING_CONSOLE)
rt_device_t dev_console;
dev_console = rt_console_get_device();
if (dev_console)
{
#if defined(RT_USING_POSIX)
libc_stdio_set_console(dev_console->parent.name, O_RDWR);
#else
libc_stdio_set_console(dev_console->parent.name, O_WRONLY);
#endif
}
/* set PATH and HOME */
putenv("PATH=/bin");
putenv("HOME=/home");
#endif
#if defined RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT
pthread_system_init();
#endif
return 0;
}
INIT_COMPONENT_EXPORT(libc_system_init);
| Disable ENV when disable DFS. | [Libc] Disable ENV when disable DFS.
| C | apache-2.0 | AubrCool/rt-thread,zhaojuntao/rt-thread,armink/rt-thread,hezlog/rt-thread,zhaojuntao/rt-thread,AubrCool/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,igou/rt-thread,igou/rt-thread,ArdaFu/rt-thread,armink/rt-thread,weety/rt-thread,zhaojuntao/rt-thread,FlyLu/rt-thread,nongxiaoming/rt-thread,RT-Thread/rt-thread,igou/rt-thread,armink/rt-thread,hezlog/rt-thread,hezlog/rt-thread,AubrCool/rt-thread,armink/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread,FlyLu/rt-thread,weiyuliang/rt-thread,weiyuliang/rt-thread,zhaojuntao/rt-thread,geniusgogo/rt-thread,nongxiaoming/rt-thread,RT-Thread/rt-thread,ArdaFu/rt-thread,gbcwbz/rt-thread,FlyLu/rt-thread,RT-Thread/rt-thread,weety/rt-thread,ArdaFu/rt-thread,zhaojuntao/rt-thread,nongxiaoming/rt-thread,geniusgogo/rt-thread,geniusgogo/rt-thread,armink/rt-thread,geniusgogo/rt-thread,FlyLu/rt-thread,igou/rt-thread,AubrCool/rt-thread,igou/rt-thread,wolfgangz2013/rt-thread,weety/rt-thread,nongxiaoming/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,AubrCool/rt-thread,wolfgangz2013/rt-thread,geniusgogo/rt-thread,ArdaFu/rt-thread,ArdaFu/rt-thread,zhaojuntao/rt-thread,FlyLu/rt-thread,gbcwbz/rt-thread,wolfgangz2013/rt-thread,weiyuliang/rt-thread,ArdaFu/rt-thread,weety/rt-thread,gbcwbz/rt-thread,hezlog/rt-thread,gbcwbz/rt-thread,geniusgogo/rt-thread,RT-Thread/rt-thread,zhaojuntao/rt-thread,geniusgogo/rt-thread,wolfgangz2013/rt-thread,nongxiaoming/rt-thread,hezlog/rt-thread,nongxiaoming/rt-thread,AubrCool/rt-thread,armink/rt-thread,gbcwbz/rt-thread,weety/rt-thread,RT-Thread/rt-thread,weety/rt-thread,RT-Thread/rt-thread,nongxiaoming/rt-thread,weety/rt-thread,ArdaFu/rt-thread,gbcwbz/rt-thread,wolfgangz2013/rt-thread,wolfgangz2013/rt-thread,igou/rt-thread,armink/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,FlyLu/rt-thread,igou/rt-thread,weiyuliang/rt-thread,RT-Thread/rt-thread,gbcwbz/rt-thread |
82fc0cb7883747942326d6d6ca1333b27bd647f0 | test/Preprocessor/optimize.c | test/Preprocessor/optimize.c | // RUN: clang-cc -Eonly optimize.c -DOPT_O2 -O2 -verify &&
#ifdef OPT_O2
#ifndef __OPTIMIZE__
#error "__OPTIMIZE__ not defined"
#endif
#ifdef __OPTIMIZE_SIZE
#error "__OPTIMIZE_SIZE__ defined"
#endif
#endif
// RUN: clang-cc -Eonly optimize.c -DOPT_O0 -O0 -verify &&
#ifdef OPT_O0
#ifdef __OPTIMIZE__
#error "__OPTIMIZE__ defined"
#endif
#ifdef __OPTIMIZE_SIZE
#error "__OPTIMIZE_SIZE__ defined"
#endif
#endif
// RUN: clang-cc -Eonly optimize.c -DOPT_OS -Os -verify
#ifdef OPT_OS
#ifndef __OPTIMIZE__
#error "__OPTIMIZE__ not defined"
#endif
#ifndef __OPTIMIZE_SIZE
#error "__OPTIMIZE_SIZE__ not defined"
#endif
#endif
| // RUN: clang-cc -Eonly %s -DOPT_O2 -O2 -verify &&
#ifdef OPT_O2
#ifndef __OPTIMIZE__
#error "__OPTIMIZE__ not defined"
#endif
#ifdef __OPTIMIZE_SIZE
#error "__OPTIMIZE_SIZE__ defined"
#endif
#endif
// RUN: clang-cc -Eonly %s -DOPT_O0 -O0 -verify &&
#ifdef OPT_O0
#ifdef __OPTIMIZE__
#error "__OPTIMIZE__ defined"
#endif
#ifdef __OPTIMIZE_SIZE
#error "__OPTIMIZE_SIZE__ defined"
#endif
#endif
// RUN: clang-cc -Eonly %s -DOPT_OS -Os -verify
#ifdef OPT_OS
#ifndef __OPTIMIZE__
#error "__OPTIMIZE__ not defined"
#endif
#ifndef __OPTIMIZE_SIZE
#error "__OPTIMIZE_SIZE__ not defined"
#endif
#endif
| Use %s in test, not hard coded name. | Use %s in test, not hard coded name.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@68521 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
de93b2b6ea080ae28451ab9448e3628e55361dc2 | src/safe_memory.c | src/safe_memory.c | #include "safe-c/safe_memory.h"
#include <stdio.h>
#include <string.h>
void* safe_malloc_function(size_t size, const char* calling_function)
{
if (size == 0)
{
fprintf(stderr, "Error allocating memory: The function %s called "
"'safe_malloc' and requested zero memory. The pointer should "
"be explicitly set to NULL instead.\n",
calling_function);
exit(EXIT_FAILURE);
}
void* memory = malloc(size);
if (!memory)
{
fprintf(stderr, "Error allocating memory: The function %s called "
"'safe_malloc' requesting %zu bytes of memory, but an error "
"occurred allocating this amount of memory. Exiting",
calling_function, size);
exit(EXIT_FAILURE);
}
memory = memset(memory, 0, size);
return memory;
}
void safe_free_function(void** pointer_address)
{
if (pointer_address != NULL)
{
free(*pointer_address);
*pointer_address = NULL;
}
}
| #include "safe-c/safe_memory.h"
#include <stdio.h>
#include <string.h>
void* safe_malloc_function(size_t size, const char* calling_function)
{
if (size == 0)
{
fprintf(stderr, "Error allocating memory: The function %s called "
"'safe_malloc' and requested zero memory. The pointer should "
"be explicitly set to NULL instead.\n",
calling_function);
exit(EXIT_FAILURE);
}
void* memory = malloc(size);
if (!memory)
{
fprintf(stderr, "Error allocating memory: The function %s called "
"'safe_malloc' requesting %zu bytes of memory, but an error "
"occurred allocating this amount of memory.\n",
calling_function, size);
exit(EXIT_FAILURE);
}
memory = memset(memory, 0, size);
return memory;
}
void safe_free_function(void** pointer_address)
{
if (pointer_address != NULL)
{
free(*pointer_address);
*pointer_address = NULL;
}
}
| Add newline to error message in safe_malloc. | Add newline to error message in safe_malloc.
The message that is printed when safe_malloc fails to allocate memory was missing a newline character.
| C | mit | VanJanssen/safe-c,VanJanssen/elegan-c,ErwinJanssen/elegan-c |
9385f793dca96e402c971989375cbe421e85a2c6 | ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c | ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c | /*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
void board_init(void) {
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}
void board_deinit(void) {
}
| Add Cytron Maker Zero SAMD21 | Add Cytron Maker Zero SAMD21 | C | mit | adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython |
|
b9be70ddceebc4b6a9eff29a72bd680e10e091c7 | src/file/file_default.h | src/file/file_default.h | /*
* This file is part of libbdplus
* Copyright (C) 2015 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef FILE_DEFAULT_H_
#define FILE_DEFAULT_H_
#include "filesystem.h"
#include "util/attributes.h"
BD_PRIVATE BDPLUS_FILE_H *file_open_default(void *root_path, const char *file_name);
#endif /* FILE_DEFAULT_H_ */
| /*
* This file is part of libbdplus
* Copyright (C) 2015 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef FILE_DEFAULT_H_
#define FILE_DEFAULT_H_
#include "util/attributes.h"
struct bdplus_file;
BD_PRIVATE struct bdplus_file *file_open_default(void *root_path, const char *file_name);
#endif /* FILE_DEFAULT_H_ */
| Replace include with forward declaration | Replace include with forward declaration
| C | lgpl-2.1 | ShiftMediaProject/libbdplus,ShiftMediaProject/libbdplus,ShiftMediaProject/libbdplus |
e05b052ebf4b8ed48b8dc5f0e358c2c01aabda78 | Wangscape/noise/module/codecs/ModuleCodecs.h | Wangscape/noise/module/codecs/ModuleCodecs.h | #pragma once
#include "AbsWrapperCodec.h"
#include "AddWrapperCodec.h"
#include "BillowWrapperCodec.h"
#include "BlendWrapperCodec.h"
#include "CacheWrapperCodec.h"
#include "CheckerboardWrapperCodec.h"
#include "ClampWrapperCodec.h"
#include "ConstWrapperCodec.h"
#include "CurveWrapperCodec.h"
#include "CylindersWrapperCodec.h"
#include "DisplaceWrapperCodec.h"
#include "ExponentWrapperCodec.h"
#include "InvertWrapperCodec.h"
#include "MaxWrapperCodec.h"
#include "MinWrapperCodec.h"
#include "MultiplyWrapperCodec.h"
#include "NoiseSourcesCodec.h"
#include "PerlinWrapperCodec.h"
#include "PowerWrapperCodec.h"
#include "RidgedMultiWrapperCodec.h"
#include "RotatePointWrapperCodec.h"
#include "ScaleBiasWrapperCodec.h"
#include "ScalePointCodec.h"
#include "SelectWrapperCodec.h"
#include "SpheresWrapperCodec.h"
#include "TerraceWrapperCodec.h"
#include "TranslatePointWrapperCodec.h"
#include "TurbulenceWrapperCodec.h"
#include "VoronoiWrapperCodec.h"
| #pragma once
#include "AbsWrapperCodec.h"
#include "AddWrapperCodec.h"
#include "BillowWrapperCodec.h"
#include "BlendWrapperCodec.h"
#include "CacheWrapperCodec.h"
#include "CheckerboardWrapperCodec.h"
#include "ClampWrapperCodec.h"
#include "ConstWrapperCodec.h"
#include "CornerCombinerBaseWrapperCodec.h"
#include "CurveWrapperCodec.h"
#include "CylindersWrapperCodec.h"
#include "DisplaceWrapperCodec.h"
#include "ExpWrapperCodec.h"
#include "ExponentWrapperCodec.h"
#include "ForwardWrapperCodec.h"
#include "InvertWrapperCodec.h"
#include "MaxWrapperCodec.h"
#include "MinWrapperCodec.h"
#include "MultiplyWrapperCodec.h"
#include "NormLPQWrapperCodec.h"
#include "NoiseSourcesCodec.h"
#include "PerlinWrapperCodec.h"
#include "PowWrapperCodec.h"
#include "PowerWrapperCodec.h"
#include "RidgedMultiWrapperCodec.h"
#include "RotatePointWrapperCodec.h"
#include "ScaleBiasWrapperCodec.h"
#include "ScalePointCodec.h"
#include "SelectWrapperCodec.h"
#include "SpheresWrapperCodec.h"
#include "TerraceWrapperCodec.h"
#include "TranslatePointWrapperCodec.h"
#include "TurbulenceWrapperCodec.h"
#include "VoronoiWrapperCodec.h"
| Put new codecs in module codec header | Put new codecs in module codec header
| C | mit | serin-delaunay/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape |
8cb37afde89b4c89079f579f3532792d7dd5ff67 | src/http/responsedata.h | src/http/responsedata.h | #ifndef APIMOCK_RESPONSEDATA_H
#define APIMOCK_RESPONSEDATA_H
#include <string>
namespace ApiMock {
struct ResponseData {
std::string body;
};
}
#endif | #ifndef APIMOCK_RESPONSEDATA_H
#define APIMOCK_RESPONSEDATA_H
#include <string>
#include <unordered_map>
#include "statuscodes.h"
namespace ApiMock {
struct ResponseData {
std::string body;
std::unordered_map<std::string, std::string> headers;
HTTP_RESPONSE_CODE statusCode;
};
}
#endif | Add headers and status code to response | Add headers and status code to response
| C | mit | Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock |
17ceee99c3b3170a49b5fca7f7650f94f40e1de9 | Pod/Classes/Artsy+Authentication.h | Pod/Classes/Artsy+Authentication.h | #import "ArtsyToken.h"
#import "ArtsyAuthentication.h"
#import "ArtsyAuthentication+Facebook.h"
#import "ArtsyAuthentication+Twitter.h" | #import "ArtsyToken.h"
#import "ArtsyAuthentication.h"
#if __has_include("ArtsyAuthentication+Facebook.h")
#import "ArtsyAuthentication+Facebook.h"
#endif
#if __has_include("ArtsyAuthentication+Twitter.h")
#import "ArtsyAuthentication+Twitter.h"
#endif
| Use if includes for fb/tiwtter | Use if includes for fb/tiwtter | C | mit | artsy/Artsy_Authentication,artsy/Artsy-Authentication,artsy/Artsy-Authentication,artsy/Artsy-Authentication |
e913c8f42713491283d2bb1149a6b463f08b3579 | inputline.c | inputline.c | #include <stdio.h>
#define MAXLINE 81
#define MAXLENGTH 1000
int getline(char line[]);
/* print line longer than 80 characters */
int main(void)
{
int len;
char line[MAXLENGTH];
while ((len = getline(line)) > 0)
if (len > MAXLINE) {
printf("%s", line);
}
return 0;
}
int getline(char s[]) {
int c, i;
for (i=0; (c=getchar()) != EOF && c!='\n'; ++i)
s[i] = c;
if (c== '\n') {
s[i] = c;
++i;
}
s[i] = '\0';
return i;
}
| Print longer than 80 chars | Print longer than 80 chars
| C | bsd-2-clause | larbb/cexercises,larbb/cexercises |
|
738eddb1c30571adf27544bda80709b15ace587e | You-DataStore/datastore.h | You-DataStore/datastore.h | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class Transaction;
class DataStore {
friend class Transaction;
public:
static bool begin();
// Modifying methods
static bool post(TaskId, SerializedTask&);
static bool put(TaskId, SerializedTask&);
static bool erase(TaskId);
static boost::variant<bool, SerializedTask> get(TaskId);
static std::vector<SerializedTask>
filter(const std::function<bool(SerializedTask)>&);
private:
static DataStore& get();
bool isServing = false;
std::deque<Internal::IOperation> operationsQueue;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_DATASTORE_H_
| #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class Transaction;
class DataStore {
friend class Transaction;
public:
static bool begin();
// Modifying methods
static bool post(TaskId, SerializedTask&);
static bool put(TaskId, SerializedTask&);
static bool erase(TaskId);
static std::vector<SerializedTask> getAllTask();
static std::vector<SerializedTask>
filter(const std::function<bool(SerializedTask)>&);
private:
static DataStore& get();
bool isServing = false;
std::deque<Internal::IOperation> operationsQueue;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_DATASTORE_H_
| Rename get(TaskId) to getAllTask (QueryEngine does not need it) | Rename get(TaskId) to getAllTask (QueryEngine does not need it)
| C | mit | cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main |
065a075e17671be38341202bff5852a04f086548 | 00-HelloWorld/bind.c | 00-HelloWorld/bind.c | #include "libmypy.h"
char hellofunc_docs[] = "Hello world description.";
PyMethodDef helloworld_funcs[] = {
{ "hello",
(PyCFunction)hello,
METH_NOARGS,
hellofunc_docs},
{ NULL}
};
struct PyModuleDef helloworld_mod = {
PyModuleDef_HEAD_INIT,
"helloworld",
"This is hello world module.",
-1,
helloworld_funcs,
NULL,
NULL,
NULL,
NULL
};
void PyInit_helloworld(void) {
PyModule_Create(&helloworld_mod);
}
| #include "libmypy.h"
char hellofunc_docs[] = "Hello world description.";
PyMethodDef helloworld_funcs[] = {
{ "hello",
(PyCFunction)hello,
METH_NOARGS,
hellofunc_docs},
{ NULL}
};
char helloworldmod_docs[] = "This is hello world module.";
PyModuleDef helloworld_mod = {
PyModuleDef_HEAD_INIT,
"helloworld",
helloworldmod_docs,
-1,
helloworld_funcs,
NULL,
NULL,
NULL,
NULL
};
void PyInit_helloworld(void) {
PyModule_Create(&helloworld_mod);
}
| Make the codes in the order. | Make the codes in the order.
| C | bsd-3-clause | starnight/python-c-extension,starnight/python-c-extension,starnight/python-c-extension |
6f36fc3e94f81897a5780cbe943deb6af002a3c5 | texor.c | texor.c | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disableRawMode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enableRawMode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag &= ~(OPOST);
raw.c_cflag |= (CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enableRawMode();
char c;
while (read(STDIN_FILENO, &c, 1) == 1 && c!= 'q') {
if (iscntrl(c)) {
printf("%d\r\n", c);
} else {
printf("%d ('%c')\r\n", c, c);
}
}
return 0;
}
| #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disableRawMode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enableRawMode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag &= ~(OPOST);
raw.c_cflag |= (CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
raw.c_cc[VMIN] = 0;
raw.c_cc[VTIME] = 1;
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enableRawMode();
while (1) {
char c = '\0';
read(STDIN_FILENO, &c, 1);
if (iscntrl(c)) {
printf("%d\r\n", c);
} else {
printf("%d ('%c')\r\n", c, c);
}
if (c == 'q') break;
}
return 0;
}
| Add a timeout for read | Add a timeout for read
| C | bsd-2-clause | kyletolle/texor |
3d66f211250ccae47fdbc6259b22605cd14464c7 | include/Genes/Mutation_Rate_Gene.h | include/Genes/Mutation_Rate_Gene.h | #ifndef MUTATION_RATE_GENE_H
#define MUTATION_RATE_GENE_H
#include "Gene.h"
#include <string>
#include <memory>
#include <map>
#include "Game/Color.h"
//! The gene controls how much of the genome mutates per Genome::mutate() event.
class Mutation_Rate_Gene : public Gene
{
public:
std::string name() const noexcept override;
//! Controls how many changes a call to Genome::mutate() makes to the Gene collections.
//
//! \returns An integer number that determines the number of point mutations the Genome::mutate() makes.
int mutation_count() const noexcept;
void gene_specific_mutation() noexcept override;
std::unique_ptr<Gene> duplicate() const noexcept override;
protected:
std::map<std::string, double> list_properties() const noexcept override;
void load_properties(const std::map<std::string, double>& properties) override;
private:
double mutated_components_per_mutation = 100.0;
double score_board(const Board& board, Color perspective, size_t prior_real_moves) const noexcept override;
};
#endif // MUTATION_RATE_GENE_H
| #ifndef MUTATION_RATE_GENE_H
#define MUTATION_RATE_GENE_H
#include "Gene.h"
#include <string>
#include <memory>
#include <map>
#include "Game/Color.h"
//! The gene controls how much of the genome mutates per Genome::mutate() event.
class Mutation_Rate_Gene : public Gene
{
public:
std::string name() const noexcept override;
//! Controls how many changes a call to Genome::mutate() makes to the Gene collections.
//
//! \returns An integer number that determines the number of point mutations the Genome::mutate() makes.
int mutation_count() const noexcept;
void gene_specific_mutation() noexcept override;
std::unique_ptr<Gene> duplicate() const noexcept override;
protected:
std::map<std::string, double> list_properties() const noexcept override;
void load_properties(const std::map<std::string, double>& properties) override;
private:
double mutated_components_per_mutation = 1.0;
double score_board(const Board& board, Color perspective, size_t prior_real_moves) const noexcept override;
};
#endif // MUTATION_RATE_GENE_H
| Reduce initial number of mutations | Reduce initial number of mutations
| C | mit | MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess |
f825cd3d1f4dc05d7124ad00177c37d0f6b9a4d0 | yamiHikariGame/Classes/Constants.h | yamiHikariGame/Classes/Constants.h | //
// Constants.h
// yamiHikariGame
//
// Created by slightair on 2013/07/28.
//
//
#ifndef yamiHikariGame_Constants_h
#define yamiHikariGame_Constants_h
#define SpriteSheetImageFileName "spriteSheet.pvr.ccz"
#define DefaultFontName "mosamosa"
#define DefaultFontSize 24
#define StaminaMax 1000
#define SEItemGet "SE001.mp3"
#define SEGameOver "SE002.mp3"
#define SEBadItemGet "SE004.mp3"
#define SoundEffectVolume 0.15
#endif
| //
// Constants.h
// yamiHikariGame
//
// Created by slightair on 2013/07/28.
//
//
#ifndef yamiHikariGame_Constants_h
#define yamiHikariGame_Constants_h
#define SpriteSheetImageFileName "spriteSheet.pvr.ccz"
#define DefaultFontName "mosamosa.ttf"
#define DefaultFontSize 24
#define StaminaMax 1000
#define SEItemGet "SE001.mp3"
#define SEGameOver "SE002.mp3"
#define SEBadItemGet "SE004.mp3"
#define SoundEffectVolume 0.15
#endif
| Fix to Use specified Font mosamosa. | Fix to Use specified Font mosamosa.
| C | mit | slightair/yamiHikariGame,slightair/yamiHikariGame,slightair/yamiHikariGame,slightair/yamiHikariGame,slightair/yamiHikariGame |
7667f3bc0a968667d185887f527d5efecbb5bf52 | include/graph.h | include/graph.h | #ifndef GRAPH_H
#define GRAPH_H
#include <unordered_map>
#include <unordered_set>
template<typename T>
class Graph {
public:
void connect(const T &a, const T &b);
const std::unordered_set<T>& get_vertex_ids() const;
inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const {
return vertices_.at(vertex_id)->adjacent_ids_;
}
~Graph();
private:
struct Vertex {
T id_;
std::unordered_set<Vertex*> adjacent_;
std::unordered_set<T> adjacent_ids_;
Vertex(const T &id) : id_(id) {}
bool has_neighbor(Vertex *v) const {
return adjacent_.find(v) != adjacent_.end();
}
void add_neighbor(Vertex* v) {
adjacent_.insert(v);
adjacent_ids_.insert(v->id_);
}
};
std::unordered_map<T, Vertex*> vertices_;
std::unordered_set<T> vertex_ids;
Vertex* get_vertex(const T &a) const;
Vertex* get_or_insert(const T &a);
};
template class Graph<int>;
#endif
| #ifndef GRAPH_H
#define GRAPH_H
#include <unordered_map>
#include <unordered_set>
template<typename T>
class Graph {
public:
void connect(const T &a, const T &b);
const std::unordered_set<T>& get_vertex_ids() const;
inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const {
return vertices_.at(vertex_id)->adjacent_ids_;
}
~Graph();
private:
struct Vertex {
T id_;
std::unordered_set<Vertex*> adjacent_;
std::unordered_set<T> adjacent_ids_;
Vertex(const T &id) : id_(id) {}
bool has_neighbor(Vertex *v) const {
return adjacent_.find(v) != adjacent_.end();
}
void add_neighbor(Vertex* v) {
adjacent_.insert(v);
adjacent_ids_.insert(v->id_);
}
};
std::unordered_map<T, Vertex*> vertices_;
std::unordered_set<T> vertex_ids;
std::unordered_map<T, int> alias_id;
std::vector<int> reverse_mapping;
Vertex* get_vertex(const T &a) const;
Vertex* get_or_insert(const T &a);
};
template class Graph<int>;
#endif
| Add initial data structures for mapping | Add initial data structures for mapping
| C | mit | chivay/betweenness-centrality |
2fb635a28d5165f0a6f5bddf2b6fe28ce09b9dfb | features/nfc/nfc/NFCControllerDriver.h | features/nfc/nfc/NFCControllerDriver.h | /* mbed Microcontroller Library
* Copyright (c) 2018 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_NFC_CONTROLLER_DRIVER_H
#define MBED_NFC_CONTROLLER_DRIVER_H
#include <stdint.h>
#include "events/EventQueue.h"
#include "stack/nfc_errors.h"
#include "stack/transceiver/transceiver.h"
#include "stack/platform/scheduler.h"
namespace mbed {
namespace nfc {
struct NFCControllerDriver {
virtual void initialize(scheduler_timer_t* pTimer) = 0;
virtual transceiver_t* get_transceiver() const = 0;
};
} // namespace nfc
} // namespace mbed
#endif
| /* mbed Microcontroller Library
* Copyright (c) 2018 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_NFC_CONTROLLER_DRIVER_H
#define MBED_NFC_CONTROLLER_DRIVER_H
#include <stdint.h>
#include "events/EventQueue.h"
#include "stack/nfc_errors.h"
#include "stack/transceiver/transceiver.h"
#include "stack/platform/scheduler.h"
namespace mbed {
namespace nfc {
struct NFCControllerDriver {
virtual void initialize(scheduler_timer_t* pTimer) = 0;
virtual transceiver_t* get_transceiver() const = 0;
virtual nfc_rf_protocols_bitmask_t get_supported_rf_protocols() const = 0;
};
} // namespace nfc
} // namespace mbed
#endif
| Add get_supported_rf_protocols() method to driver | Add get_supported_rf_protocols() method to driver
| C | apache-2.0 | c1728p9/mbed-os,kjbracey-arm/mbed,betzw/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,c1728p9/mbed-os,mbedmicro/mbed,betzw/mbed-os,mbedmicro/mbed,andcor02/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,kjbracey-arm/mbed,c1728p9/mbed-os,betzw/mbed-os,andcor02/mbed-os,andcor02/mbed-os,mbedmicro/mbed,betzw/mbed-os,c1728p9/mbed-os,mbedmicro/mbed,betzw/mbed-os,andcor02/mbed-os,andcor02/mbed-os,betzw/mbed-os |
db7e7bd6d0b2695d6c1390e18a4843dbf36b54aa | lib/dec/quant.h | lib/dec/quant.h | /********************************************************************
* *
* THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function:
last mod: $Id$
********************************************************************/
#if !defined(_quant_H)
# define _quant_H (1)
# include "theora/codec.h"
# include "ocintrin.h"
typedef ogg_uint16_t oc_quant_table[64];
typedef oc_quant_table oc_quant_tables[64];
/*Maximum scaled quantizer value.*/
#define OC_QUANT_MAX (1024<<2)
/*Minimum scaled DC coefficient frame quantizer value for intra and inter
modes.*/
extern unsigned OC_DC_QUANT_MIN[2];
/*Minimum scaled AC coefficient frame quantizer value for intra and inter
modes.*/
extern unsigned OC_AC_QUANT_MIN[2];
void oc_dequant_tables_init(oc_quant_table *_dequant[2][3],
int _pp_dc_scale[64],const th_quant_info *_qinfo);
#endif
| /********************************************************************
* *
* THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function:
last mod: $Id$
********************************************************************/
#if !defined(_quant_H)
# define _quant_H (1)
# include "theora/codec.h"
# include "ocintrin.h"
typedef ogg_uint16_t oc_quant_table[64];
typedef oc_quant_table oc_quant_tables[64];
/*Maximum scaled quantizer value.*/
#define OC_QUANT_MAX (1024<<2)
void oc_dequant_tables_init(oc_quant_table *_dequant[2][3],
int _pp_dc_scale[64],const th_quant_info *_qinfo);
#endif
| Remove extern references for OC_*_QUANT_MIN. | Remove extern references for OC_*_QUANT_MIN.
These were exported for the use of the theora-exp encoder and are not
needed in trunk. Part of a patch from issue 1297.
git-svn-id: 8dbf393e6e9ab8d4979d29f9a341a98016792aa6@15322 0101bb08-14d6-0310-b084-bc0e0c8e3800
| C | bsd-3-clause | KTXSoftware/theora,KTXSoftware/theora,Distrotech/libtheora,Distrotech/libtheora,KTXSoftware/theora,KTXSoftware/theora,Distrotech/libtheora,Distrotech/libtheora,Distrotech/libtheora,KTXSoftware/theora |
b1c73bbd6bcd5c4e403998fe8f7bc1e1ace1359b | chip/mchp/adc_chip.h | chip/mchp/adc_chip.h | /* Copyright 2017 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* MCHP MEC specific ADC module for Chrome EC */
#ifndef __CROS_EC_ADC_CHIP_H
#define __CROS_EC_ADC_CHIP_H
/* Data structure to define ADC channels. */
struct adc_t {
const char *name;
int factor_mul;
int factor_div;
int shift;
int channel;
};
/*
* Boards must provide this list of ADC channel definitions.
* This must match the enum adc_channel list provided by the board.
*/
extern const struct adc_t adc_channels[];
/* Minimum and maximum values returned by adc_read_channel(). */
#define ADC_READ_MIN 0
#define ADC_READ_MAX 1023
/* Just plain id mapping for code readability */
#define MCHP_ADC_CH(x) (x)
#endif /* __CROS_EC_ADC_CHIP_H */
| /* Copyright 2017 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* MCHP MEC specific ADC module for Chrome EC */
#ifndef __CROS_EC_ADC_CHIP_H
#define __CROS_EC_ADC_CHIP_H
/* Data structure to define ADC channels. */
struct adc_t {
const char *name;
int factor_mul;
int factor_div;
int shift;
int channel;
};
/* List of ADC channels */
enum chip_adc_channel {
CHIP_ADC_CH0 = 0,
CHIP_ADC_CH1,
CHIP_ADC_CH2,
CHIP_ADC_CH3,
CHIP_ADC_CH4,
CHIP_ADC_CH5,
CHIP_ADC_CH6,
CHIP_ADC_CH7,
CHIP_ADC_COUNT,
};
/*
* Boards must provide this list of ADC channel definitions.
* This must match the enum adc_channel list provided by the board.
*/
extern const struct adc_t adc_channels[];
/* Minimum and maximum values returned by adc_read_channel(). */
#define ADC_READ_MIN 0
#define ADC_READ_MAX 1023
/* Just plain id mapping for code readability */
#define MCHP_ADC_CH(x) (x)
#endif /* __CROS_EC_ADC_CHIP_H */
| Add ADC channel enumeration to chip | mchp: Add ADC channel enumeration to chip
Add a chip level ADC channel enumerated type.
BRANCH=none
BUG=b:177463787
TEST=Booted skylake RVP to Chrome OS
Signed-off-by: Scott Worley <186210b307f58d6c0a191337b635ed93ad075837@microchip.corp-partner.google.com>
Change-Id: If30a71698b1d084380c6695e4c4b8921f5b8eec2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673019
Reviewed-by: Ravin Kumar <[email protected]>
Reviewed-by: Aseda Aboagye <[email protected]>
Tested-by: Ravin Kumar <[email protected]>
| C | bsd-3-clause | coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec |
ce1916c56d70edbe76ad36e4d2557e60f57b8645 | tests/regression/34-congruence/04-casting.c | tests/regression/34-congruence/04-casting.c | // PARAM: --disable ana.int.def_exc --enable ana.int.interval
// Ensures that the cast_to function handles casting for congruences correctly.
// TODO: Implement appropriate cast_to function, enable for congruences only and adjust test if necessary.
#include <assert.h>
#include <stdio.h>
int main(){
int c = 128;
for (int i = 0; i < 1; i++) {
c = c - 150;
}
char k = (char) c;
printf ("k: %d", k);
assert (k == -22); //UNKNOWN
k = k + 150;
assert (k == 0); //UNKNOWN!
}
| Add (deactivated) casting test for congruence domain | Add (deactivated) casting test for congruence domain
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
f1dcb34bfc420809b68884260247a14e75776372 | cpp/foreach/concat.h | cpp/foreach/concat.h | #ifndef _CONCAT_H_
#define _CONCAT_H_
/// Utitilies to make a unique variable name.
#define CONCAT_LINE(x) CONCAT(x, __LINE__)
#define CONCAT(a, b) CONCAT_INDIRECT(a, b)
#define CONCAT_INDIRECT(a, b) a ## b
#endif
| #ifndef _CONCAT_H_
#define _CONCAT_H_
/// Utitilies to make a unique variable name.
#define CONCAT_LINE(x) CONCAT(x ## _foreach__, __LINE__)
#define CONCAT(a, b) CONCAT_INDIRECT(a, b)
#define CONCAT_INDIRECT(a, b) a ## b
#endif
| Fix a __i386 bug in gcc | Fix a __i386 bug in gcc
In gcc, __i386 has special meaning for i386 CPU.
So we should avoid use __i386 as variable name. | C | unlicense | airekans/Snippet,airekans/Snippet,airekans/Snippet,airekans/Snippet |
142f635096a3c76946da848a6cc641152e118b40 | 3RVX/Skin/SystemColors.h | 3RVX/Skin/SystemColors.h | #pragma once
#include <Windows.h>
#include "../Logger.h"
#include <math.h>
#include <algorithm>
#include <dwmapi.h>
#pragma comment(lib, "Dwmapi.lib")
class SystemColors {
struct DWMColorizationParams {
UINT ColorizationColor;
UINT ColorizationAfterglow;
UINT ColorizationColorBalance;
UINT ColorizationAfterglowBalance;
UINT ColorizationBlurBalance;
UINT ColorizationGlassReflectionIntensity;
UINT ColorizationOpaqueBlend;
};
public:
SystemColors() {
HMODULE dwm = LoadLibrary(L"dwmapi.dll");
HRESULT(WINAPI *DwmGetColorizationParameters) (DWMColorizationParams *colorparam);
*(FARPROC *) &DwmGetColorizationParameters = GetProcAddress(dwm, (LPCSTR) 127);
DWMColorizationParams params;
DwmGetColorizationParameters(¶ms);
CLOG(L"-> %x", params.ColorizationColor);
CLOG(L"-> %x", params.ColorizationAfterglow);
CLOG(L"-> %d", params.ColorizationColorBalance);
CLOG(L"-> %d", params.ColorizationAfterglowBalance);
CLOG(L"-> %x", params.ColorizationBlurBalance);
CLOG(L"-> %x", params.ColorizationGlassReflectionIntensity);
CLOG(L"-> %x", params.ColorizationOpaqueBlend);
COLORREF base = RGB(217, 217, 217);
DWORD val;
BOOL opaque;
DwmGetColorizationColor(&val, &opaque);
CLOG(L"=> %x", val);
}
}; | Add class for retrieving system color scheme settings | Add class for retrieving system color scheme settings
| C | bsd-2-clause | malensek/3RVX,malensek/3RVX,malensek/3RVX |
|
c8651ac9661b393929177481c0726c9680d8e094 | h/CStringsView.h | h/CStringsView.h | //This Source Code Form is subject to the terms of the Mozilla Public
//License, v. 2.0. If a copy of the MPL was not distributed with this
//file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <stddef.h>
#include <string.h>
#include "Common.h"
namespace ej {
//! Represents a view on a list of C strings packed in an array
template <typename T = const char, size_t ALIGNMENT = alignof(T)>
class CStringsView {
public:
typedef T value_type;
typedef size_t size_type;
static_assert((ALIGNMENT & (ALIGNMENT - 1)) == 0 && ALIGNMENT >= alignof(value_type));
private:
value_type *Start;
value_type *Finish;
public:
constexpr CStringsView() noexcept : Start(nullptr), Finish(nullptr) {
}
constexpr CStringsView(value_type *start, value_type *finish) noexcept : Start(start), Finish(finish) {
}
template <size_t N>
constexpr CStringsView(value_type (&a)[N]) noexcept : Start(a), Finish(a + N) {
}
constexpr void assign(value_type *start, value_type *finish) noexcept {
Start = start;
Finish = finish;
}
template <size_t N>
constexpr void assign(value_type (&a)[N]) noexcept {
assign(a, a + N);
}
constexpr size_type size() const noexcept {
size_type n = 0;
for (auto iter = Start, end = Finish; iter < end;) {
auto length = strlen(iter);
iter += length + 1;
if constexpr (ALIGNMENT != alignof(value_type)) {
iter = reinterpret_cast<value_type *>(((reinterpret_cast<uintptr_t>(iter) + ALIGNMENT - 1) / ALIGNMENT) * ALIGNMENT);
}
n++;
}
return n;
}
constexpr bool empty() const noexcept {
return Start == Finish;
}
template <typename Function>
EJ_ALWAYS_INLINE void for_each(Function f) const noexcept {
for (auto iter = Start, end = Finish; iter < end;) {
auto n = strlen(iter);
f(iter, n);
iter += n + 1;
if constexpr (ALIGNMENT != alignof(value_type)) {
iter = reinterpret_cast<value_type *>(((reinterpret_cast<uintptr_t>(iter) + ALIGNMENT - 1) / ALIGNMENT) * ALIGNMENT);
}
}
}
};
}
| Add a view for a packed array of C strings. | Add a view for a packed array of C strings.
| C | mpl-2.0 | enochjul/ej |
|
7c6dcf070a18942956867419ec19f348f2e929cc | test/tsan/libdispatch/dispatch_once_deadlock.c | test/tsan/libdispatch/dispatch_once_deadlock.c | // Check that calling dispatch_once from a report callback works.
// RUN: %clang_tsan %s -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
#include <dispatch/dispatch.h>
#include <pthread.h>
#include <stdio.h>
long g = 0;
long h = 0;
void f() {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
g++;
});
h++;
}
void __tsan_on_report() {
fprintf(stderr, "Report.\n");
f();
}
int main() {
fprintf(stderr, "Hello world.\n");
f();
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_unlock(&mutex); // Unlock of an unlocked mutex
fprintf(stderr, "g = %ld.\n", g);
fprintf(stderr, "h = %ld.\n", h);
fprintf(stderr, "Done.\n");
}
// CHECK: Hello world.
// CHECK: Report.
// CHECK: g = 1
// CHECK: h = 2
// CHECK: Done.
| // Check that calling dispatch_once from a report callback works.
// RUN: %clang_tsan %s -o %t
// RUN: not %env_tsan_opts=ignore_noninstrumented_modules=0 %run %t 2>&1 | FileCheck %s
#include <dispatch/dispatch.h>
#include <pthread.h>
#include <stdio.h>
long g = 0;
long h = 0;
void f() {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
g++;
});
h++;
}
void __tsan_on_report() {
fprintf(stderr, "Report.\n");
f();
}
int main() {
fprintf(stderr, "Hello world.\n");
f();
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_unlock(&mutex); // Unlock of an unlocked mutex
fprintf(stderr, "g = %ld.\n", g);
fprintf(stderr, "h = %ld.\n", h);
fprintf(stderr, "Done.\n");
}
// CHECK: Hello world.
// CHECK: Report.
// CHECK: g = 1
// CHECK: h = 2
// CHECK: Done.
| Fix test failing on Linux | [TSan] Fix test failing on Linux
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@368641 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
4f66d2d8091e1faec2eaa138c6e95c928f7b669d | targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h | targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h | /* mbed Microcontroller Library
* Copyright (c) 2015-2017 Nuvoton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_CMSIS_H
#define MBED_CMSIS_H
#include "NANO100Series.h"
#include "cmsis_nvic.h"
// Support linker-generated symbol as start of relocated vector table.
#if defined(__CC_ARM)
extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base;
#elif defined(__ICCARM__)
#elif defined(__GNUC__)
extern uint32_t __start_vector_table__;
#endif
#endif
| /* mbed Microcontroller Library
* Copyright (c) 2015-2017 Nuvoton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_CMSIS_H
#define MBED_CMSIS_H
#include "Nano100Series.h"
#include "cmsis_nvic.h"
// Support linker-generated symbol as start of relocated vector table.
#if defined(__CC_ARM)
extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base;
#elif defined(__ICCARM__)
#elif defined(__GNUC__)
extern uint32_t __start_vector_table__;
#endif
#endif
| Fix the file name case problem for building code in Linux system | [NANO130] Fix the file name case problem for building code in Linux system
| C | apache-2.0 | betzw/mbed-os,nRFMesh/mbed-os,Archcady/mbed-os,catiedev/mbed-os,betzw/mbed-os,YarivCol/mbed-os,mazimkhan/mbed-os,ryankurte/mbed-os,karsev/mbed-os,nRFMesh/mbed-os,ryankurte/mbed-os,svogl/mbed-os,andcor02/mbed-os,catiedev/mbed-os,mbedmicro/mbed,YarivCol/mbed-os,andcor02/mbed-os,nRFMesh/mbed-os,mazimkhan/mbed-os,c1728p9/mbed-os,HeadsUpDisplayInc/mbed,HeadsUpDisplayInc/mbed,YarivCol/mbed-os,nRFMesh/mbed-os,kjbracey-arm/mbed,infinnovation/mbed-os,catiedev/mbed-os,Archcady/mbed-os,mazimkhan/mbed-os,ryankurte/mbed-os,c1728p9/mbed-os,mazimkhan/mbed-os,infinnovation/mbed-os,ryankurte/mbed-os,CalSol/mbed,infinnovation/mbed-os,svogl/mbed-os,c1728p9/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,CalSol/mbed,karsev/mbed-os,HeadsUpDisplayInc/mbed,CalSol/mbed,CalSol/mbed,betzw/mbed-os,c1728p9/mbed-os,karsev/mbed-os,karsev/mbed-os,catiedev/mbed-os,nRFMesh/mbed-os,HeadsUpDisplayInc/mbed,betzw/mbed-os,betzw/mbed-os,Archcady/mbed-os,mbedmicro/mbed,andcor02/mbed-os,CalSol/mbed,YarivCol/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,Archcady/mbed-os,karsev/mbed-os,svogl/mbed-os,CalSol/mbed,svogl/mbed-os,YarivCol/mbed-os,HeadsUpDisplayInc/mbed,andcor02/mbed-os,HeadsUpDisplayInc/mbed,mbedmicro/mbed,catiedev/mbed-os,ryankurte/mbed-os,nRFMesh/mbed-os,kjbracey-arm/mbed,Archcady/mbed-os,catiedev/mbed-os,ryankurte/mbed-os,Archcady/mbed-os,mbedmicro/mbed,mazimkhan/mbed-os,c1728p9/mbed-os,svogl/mbed-os,mazimkhan/mbed-os,mbedmicro/mbed,betzw/mbed-os,infinnovation/mbed-os,karsev/mbed-os,infinnovation/mbed-os,infinnovation/mbed-os,YarivCol/mbed-os,kjbracey-arm/mbed,svogl/mbed-os |
f739a7605b738b85ba32436825b44f0059b83f45 | test/test_cpuid.c | test/test_cpuid.c | #include "unity.h"
#include "cpuid.h"
void test_GetVendorName_should_ReturnGenuineIntel(void) {
char expected[20] = "GenuineIntel";
char actual[20];
get_vendor_name(actual);
TEST_ASSERT_EQUAL_STRING(expected, actual);
}
void test_GetVendorSignature_should_asdf(void) {
uint32_t exp_ebx = 0x756e6547; // translates to "Genu"
uint32_t exp_ecx = 0x6c65746e; // translates to "ineI"
uint32_t exp_edx = 0x49656e69; // translates to "ntel"
cpuid_info_t sig;
sig = get_vendor_signature();
TEST_ASSERT_EQUAL_UINT32(exp_ebx, sig.ebx);
TEST_ASSERT_EQUAL_UINT32(exp_ecx, sig.ecx);
TEST_ASSERT_EQUAL_UINT32(exp_edx, sig.edx);
}
void test_GetProcessorSignature_should_ReturnFamily6(void) {
unsigned int expected = 0x6;
unsigned int family;
uint32_t processor_signature = get_processor_signature();
family = (processor_signature >> 8) & 0xf;
TEST_ASSERT_EQUAL_UINT(expected, family);
}
| #include "unity.h"
#include "cpuid.h"
void test_GetVendorName_should_ReturnGenuineIntel(void) {
char expected[20] = "GenuineIntel";
char actual[20];
get_vendor_name(actual);
TEST_ASSERT_EQUAL_STRING(expected, actual);
}
void test_GetVendorSignature_should_ReturnCorrectCpuIdValues(void) {
uint32_t exp_ebx = 0x756e6547; // translates to "Genu"
uint32_t exp_ecx = 0x6c65746e; // translates to "ineI"
uint32_t exp_edx = 0x49656e69; // translates to "ntel"
cpuid_info_t sig;
sig = get_vendor_signature();
TEST_ASSERT_EQUAL_UINT32(exp_ebx, sig.ebx);
TEST_ASSERT_EQUAL_UINT32(exp_ecx, sig.ecx);
TEST_ASSERT_EQUAL_UINT32(exp_edx, sig.edx);
}
void test_GetProcessorSignature_should_ReturnFamily6(void) {
unsigned int expected = 0x6;
unsigned int family;
uint32_t processor_signature = get_processor_signature();
family = (processor_signature >> 8) & 0xf;
TEST_ASSERT_EQUAL_UINT(expected, family);
}
| Change method-name to something more appropriate | Change method-name to something more appropriate
| C | bsd-2-clause | sosy-lab/power-gadget_benchexec,sosy-lab/power-gadget_benchexec |
467b95c1f52ffcd22d928cbbe0bd102d24df3425 | print_helpers.h | print_helpers.h | /*
* print_helpers.h
*
* Created on: Nov 29, 2014
* Author: Konstantin Gredeskoul
* Code: https://github.com/kigster
*
* (c) 2014 All rights reserved, MIT License.
*/
#ifndef printv
#define printv(X,Y) (Serial.print(X) || Serial.println(Y))
#endif
| /*
* print_helpers.h
*
* Created on: Nov 29, 2014
* Author: Konstantin Gredeskoul
* Code: https://github.com/kigster
*
* (c) 2014 All rights reserved, MIT License.
*/
#ifndef printv
#define printv(X,Y) (Serial.print(X) || Serial.println(Y))
#endif
#ifndef _printf
#define _printf(X,Y) (Serial.printf(X, Y))
#endif
| Add probably useless _printf(x,y) macro | Add probably useless _printf(x,y) macro | C | mit | kigster/flix-capacitor,kigster/FilxCapacitor,kigster/flix-capacitor,kigster/FilxCapacitor |
d382aa8fca9778c0251ff9c8e708731c2a1f07ab | cmd/lefty/parse.h | cmd/lefty/parse.h | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/* Lefteris Koutsofios - AT&T Bell Laboratories */
#ifndef _PARSE_H
#define _PARSE_H
typedef struct Psrc_t {
int flag;
char *s;
FILE *fp;
int tok;
int lnum;
} Psrc_t;
void Pinit(void);
void Pterm(void);
Tobj Punit(Psrc_t *);
Tobj Pfcall(Tobj, Tobj);
Tobj Pfunction(char *, int);
#endif /* _PARSE_H */
#ifdef __cplusplus
}
#endif
| /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/* Lefteris Koutsofios - AT&T Labs Research */
#ifndef _PARSE_H
#define _PARSE_H
typedef struct Psrc_t {
int flag;
char *s;
FILE *fp;
int tok;
int lnum;
} Psrc_t;
void Pinit (void);
void Pterm (void);
Tobj Punit (Psrc_t *);
Tobj Pfcall (Tobj, Tobj);
Tobj Pfunction (char *, int);
#endif /* _PARSE_H */
#ifdef __cplusplus
}
#endif
| Update with new lefty, fixing many bugs and supporting new features | Update with new lefty, fixing many bugs and supporting new features
| C | epl-1.0 | jho1965us/graphviz,tkelman/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,tkelman/graphviz,pixelglow/graphviz,pixelglow/graphviz,kbrock/graphviz,pixelglow/graphviz,pixelglow/graphviz,jho1965us/graphviz,ellson/graphviz,tkelman/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,BMJHayward/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,pixelglow/graphviz,ellson/graphviz,BMJHayward/graphviz,pixelglow/graphviz,MjAbuz/graphviz,kbrock/graphviz,pixelglow/graphviz,MjAbuz/graphviz,kbrock/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,jho1965us/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,pixelglow/graphviz,jho1965us/graphviz,pixelglow/graphviz,kbrock/graphviz,BMJHayward/graphviz,pixelglow/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,BMJHayward/graphviz,tkelman/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,kbrock/graphviz,kbrock/graphviz,ellson/graphviz,tkelman/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz |
2ee20d77880e3b1afa0bd010e6a3cde5ec2109eb | fibonacci_number/FibonacciNumber.c | fibonacci_number/FibonacciNumber.c | #include<stdio.h>
long long int fibonacci(long long int n)
{
//Because first fibonacci number is 0 and second fibonacci number is 1.
if(n==1 || n==2)
{
return (n-1);
}
else
{
//store last fibonacci number
long long int a=1;
//store second last fibonacci number
long long int b=0;
//store current fibonacci number
long long int nth_Fib;
for(long long int i=3;i<=n;i++)
{
nth_Fib = a+b;
b = a;
a = nth_Fib;
}
return nth_Fib;
}
}
int main()
{
long long int n;
printf("Enter a Number : ");
scanf("%lli",&n);
if(n<1)
{
printf("Number must be greater than 0");
}
else
{
long long int nth_Fib = fibonacci(n);
printf("Fibonacci Number is %lli",nth_Fib);
}
return 0;
} | Add Code For nth Fibonacci Number in c | Add Code For nth Fibonacci Number in c
| C | mit | iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos |
|
86a2b10151809c3605b2094d8505e19e541060b2 | src/condor_includes/condor_fix_limits.h | src/condor_includes/condor_fix_limits.h | #ifndef FIX_LIMITS_H
#define FIX_LIMITS_H
#if defined(HPUX9)
# define select _hide_select
#endif
#include <limits.h>
#if defined(HPUX9)
# undef select
#endif
#endif
| Hide the system's version of the prototype for select(). We define it in "condor_fdset.h". | Hide the system's version of the prototype for select(). We define it
in "condor_fdset.h".
| C | apache-2.0 | zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,djw8605/condor,djw8605/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/condor,zhangzhehust/htcondor,neurodebian/htcondor,neurodebian/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,clalancette/condor-dcloud,htcondor/htcondor,clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,djw8605/condor,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,bbockelm/condor-network-accounting |
|
cefd1c2ebc604434a1330ec4f8dd393bb4ad1037 | Source/HYPFormsManager.h | Source/HYPFormsManager.h | @import Foundation;
#import "HYPFormField.h"
@interface HYPFormsManager : NSObject
@property (nonatomic, strong) NSMutableArray *forms;
@property (nonatomic, strong) NSMutableDictionary *hiddenFields;
@property (nonatomic, strong) NSMutableDictionary *hiddenSections;
@property (nonatomic, strong) NSArray *disabledFieldsIDs;
@property (nonatomic, strong) NSMutableDictionary *values;
- (instancetype)initWithJSON:(id)JSON
initialValues:(NSDictionary *)initialValues
disabledFieldIDs:(NSArray *)disabledFieldIDs
disabled:(BOOL)disabled;
- (instancetype)initWithForms:(NSMutableArray *)forms
initialValues:(NSDictionary *)initialValues;
- (NSArray *)invalidFormFields;
- (NSDictionary *)requiredFormFields;
- (NSMutableDictionary *)valuesForFormula:(HYPFormField *)field;
- (HYPFormField *)fieldWithID:(NSString *)fieldID
withIndexPath:(BOOL)withIndexPath;
- (HYPFormField *)fieldWithID:(NSString *)fieldID
withIndexPath:(BOOL)withIndexPath
inForms:(NSArray *)forms;
@end
| @import Foundation;
#import "HYPFormField.h"
@interface HYPFormsManager : NSObject
@property (nonatomic, strong) NSMutableArray *forms;
@property (nonatomic, strong) NSMutableDictionary *hiddenFields;
@property (nonatomic, strong) NSMutableDictionary *hiddenSections;
@property (nonatomic, strong) NSArray *disabledFieldsIDs;
@property (nonatomic, strong) NSMutableDictionary *values;
- (instancetype)initWithJSON:(id)JSON
initialValues:(NSDictionary *)initialValues
disabledFieldIDs:(NSArray *)disabledFieldIDs
disabled:(BOOL)disabled;
- (instancetype)initWithForms:(NSMutableArray *)forms
initialValues:(NSDictionary *)initialValues;
- (NSArray *)invalidFormFields;
- (NSDictionary *)requiredFormFields;
- (NSMutableDictionary *)valuesForFormula:(HYPFormField *)field;
- (HYPFormField *)fieldWithID:(NSString *)fieldID
withIndexPath:(BOOL)withIndexPath;
@end
| Remove fieldWithID:withIndexPath:inForms: from public header | Remove fieldWithID:withIndexPath:inForms: from public header
| C | mit | KevinJacob/Form,0x73/Form,wangmb/Form,Jamonek/Form,Jamonek/Form,0x73/Form,wangmb/Form,KevinJacob/Form,Jamonek/Form,fhchina/Form,kalsariyac/Form,wangmb/Form,KevinJacob/Form,steve21124/Form,steve21124/Form,kalsariyac/Form,fhchina/Form,kalsariyac/Form,steve21124/Form,fhchina/Form |
829b6a1e37d7edc599d146618905fb878dd547ee | cvrp/customer.h | cvrp/customer.h | #ifndef VRPSOLVER_CUSTOMER_H
#define VRPSOLVER_CUSTOMER_H
namespace VrpSolver {
class Customer {
public:
Customer(unsigned int id, std::size_t demand)
: id_(id), demand_(demand) {}
unsigned int id() const {
return id_;
}
std::size_t demand() const {
return demand_;
}
private:
Customer();
unsigned int id_;
std::size_t demand_;
};
} // namespace VrpSolver
#endif // VRPSOLVER_CUSTOMER_H
| #ifndef VRPSOLVER_CUSTOMER_H
#define VRPSOLVER_CUSTOMER_H
namespace VrpSolver {
class Customer {
public:
Customer(std::size_t id, std::size_t demand)
: id_(id), demand_(demand) {}
std::size_t id() const {
return id_;
}
std::size_t demand() const {
return demand_;
}
private:
Customer();
std::size_t id_;
std::size_t demand_;
};
} // namespace VrpSolver
#endif // VRPSOLVER_CUSTOMER_H
| Change the type of Customer::id to std::size_t | Change the type of Customer::id to std::size_t
| C | mit | U-MA/cvrp,U-MA/cvrp |
0decd1c40a34be040381594fd396baee29c14868 | Pbind/Classes/Client/_PBRequest.h | Pbind/Classes/Client/_PBRequest.h | //
// PBRequest.h
// Pbind <https://github.com/wequick/Pbind>
//
// Created by galen on 15/2/12.
// Copyright (c) 2015-present, Wequick.net. All rights reserved.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <Foundation/Foundation.h>
/**
An instance of PBRequest defines the base factors of fetching a data.
@discussion Cause the private ProtocolBuffer.framework use the same class name,
we had to rename it as _PBRequest, but owe to the ability of `@compatibility_alias` annotation,
we can also use PBRequest in our source code.
*/
@interface _PBRequest : NSObject
@property (nonatomic, strong) NSString *action; // Interface action.
@property (nonatomic, strong) NSString *method; // Interface action.
@property (nonatomic, strong) NSDictionary *params; // Major params.
@property (nonatomic, strong) NSDictionary *extParams; // Minor params.
/**
Whether the response data should be mutable, default is NO.
@discussion if set to YES then will convert all the response data from NSDictionary to PBDictionary in nested.
*/
@property (nonatomic, assign) BOOL requiresMutableResponse;
@end
@compatibility_alias PBRequest _PBRequest;
| //
// PBRequest.h
// Pbind <https://github.com/wequick/Pbind>
//
// Created by galen on 15/2/12.
// Copyright (c) 2015-present, Wequick.net. All rights reserved.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <Foundation/Foundation.h>
/**
An instance of PBRequest defines the base factors of fetching a data.
@discussion Cause the private ProtocolBuffer.framework use the same class name,
we had to rename it as _PBRequest, but owe to the ability of `@compatibility_alias` annotation,
we can also use PBRequest in our source code.
*/
@interface _PBRequest : NSObject
/**
The API name for the request.
*/
@property (nonatomic, strong) NSString *action;
/**
The method for the request which defined in RESTFul way.
@discussion Include:
- get
- post
- put
- patch
- delete
*/
@property (nonatomic, strong) NSString *method;
/**
The parameters for the request.
*/
@property (nonatomic, strong) NSDictionary *params;
/**
Whether the response data should be mutable, default is NO.
@discussion if set to YES then will convert all the response data from NSDictionary to PBDictionary in nested.
*/
@property (nonatomic, assign) BOOL requiresMutableResponse;
@end
@compatibility_alias PBRequest _PBRequest;
| Add comments for header file | Add comments for header file
| C | mit | wequick/Pbind,wequick/Pbind,wequick/Pbind |
7e608001d3125713d007e00b1b08f71abe6d48d4 | parameters.h | parameters.h | #ifndef __MY_PARAMETERS_H__
#define __MY_PARAMETERS_H__
#define USE_GCLOCK
#define PER_CPU
const int AIO_DEPTH_PER_FILE = 32;
const int IO_QUEUE_SIZE = AIO_DEPTH_PER_FILE * 5;
const int MAX_FETCH_REQS = AIO_DEPTH_PER_FILE;
const int MSG_SEND_BUF_SIZE = 10;
/**
* The number of requests issued by user applications
* in one access.
*/
const int NUM_REQS_BY_USER = 100;
/**
* The initial size of the queue for pending IO requests
* in the global cache.
*/
const int INIT_GCACHE_PENDING_SIZE = NUM_REQS_BY_USER * 10;
/**
* The min size of IO vector allocated for an IO request..
*/
const int MIN_NUM_ALLOC_IOVECS = 16;
const int NUM_EMBEDDED_IOVECS = 1;
/**
* The maximal size of IO vector issued by the global cache.
* The experiment shows AIO with 16 pages in a request can achieve
* the best performance.
*/
const int MAX_NUM_IOVECS = 16;
#endif
| #ifndef __MY_PARAMETERS_H__
#define __MY_PARAMETERS_H__
#define USE_GCLOCK
#define PER_CPU
const int AIO_DEPTH_PER_FILE = 32;
const int IO_QUEUE_SIZE = AIO_DEPTH_PER_FILE * 5;
const int MAX_FETCH_REQS = AIO_DEPTH_PER_FILE;
const int MSG_SEND_BUF_SIZE = 10;
/**
* The number of requests issued by user applications
* in one access.
*/
const int NUM_REQS_BY_USER = 100;
/**
* The initial size of the queue for pending IO requests
* in the global cache.
*/
const int INIT_GCACHE_PENDING_SIZE = NUM_REQS_BY_USER * 100;
/**
* The min size of IO vector allocated for an IO request..
*/
const int MIN_NUM_ALLOC_IOVECS = 16;
const int NUM_EMBEDDED_IOVECS = 1;
/**
* The maximal size of IO vector issued by the global cache.
* The experiment shows AIO with 16 pages in a request can achieve
* the best performance.
*/
const int MAX_NUM_IOVECS = 16;
#endif
| Increase the default pending IO queue size in global cache. | Increase the default pending IO queue size in global cache.
| C | apache-2.0 | icoming/FlashX,icoming/FlashGraph,zheng-da/FlashX,icoming/FlashX,silky/FlashGraph,flashxio/FlashX,flashxio/FlashX,icoming/FlashGraph,flashxio/FlashX,flashxio/FlashX,zheng-da/FlashX,icoming/FlashGraph,silky/FlashGraph,flashxio/FlashX,flashxio/FlashX,icoming/FlashGraph,icoming/FlashX,silky/FlashGraph,silky/FlashGraph,icoming/FlashX,zheng-da/FlashX,icoming/FlashGraph,zheng-da/FlashX,zheng-da/FlashX,icoming/FlashX,silky/FlashGraph |
d704bbb47a97d087245552a1f28053bf167bd8f4 | rbcoremidi.c | rbcoremidi.c | /*
* rbcoremidi.c
* rbcoremidi
*
* Created by cypher on 15.07.08.
* Copyright 2008 Nuclear Squid. All rights reserved.
*
*/
#include <ruby.h>
VALUE crbCoreMidi;
void Init_rbcoremidi (void)
{
// Add the initialization code of your module here.
}
| /*
* Copyright 2008 Markus Prinz
* Released unter an MIT licence
*
*/
#include <ruby.h>
VALUE crbCoreMidi;
void Init_rbcoremidi (void)
{
// Add the initialization code of your module here.
}
| Update header + licence information | Update header + licence information
| C | mit | cypher/rbcoremidi,cypher/rbcoremidi |
8d4224fd16a6c8729e534919aac6d1a9eac3c6e9 | mkchld.c | mkchld.c | #include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
pid_t pid;
assert(argc > 0);
if (argc < 2) {
printf("usage: %s command [arguments...]\n", argv[0]);
return 1;
}
pid = fork();
if (pid < 0) {
perror("fork");
return 1;
}
if (pid == 0) {
execvp(argv[1], argv + 1);
perror("execvp");
return 1;
}
assert(pid > 0);
if (wait(NULL) != pid) {
perror("wait");
return 1;
}
return 0;
}
| #include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
pid_t pid;
assert(argc > 0);
if (argc < 2) {
printf("usage: %s command [arguments...]\n", argv[0]);
return 1;
}
pid = fork();
if (pid < 0) {
perror("fork");
return 1;
}
if (pid == 0) {
execvp(argv[1], argv + 1);
perror(argv[1]);
return 1;
}
assert(pid > 0);
if (wait(NULL) != pid) {
perror("wait");
return 1;
}
return 0;
}
| Update execvp error message on file not found | Update execvp error message on file not found
| C | mit | joeljk13/mkchild |
6f16758e72150da6b2d98d8fab9fff35ab0777e7 | src/dawn/Unittest/UnittestLogger.h | src/dawn/Unittest/UnittestLogger.h | //===--------------------------------------------------------------------------------*- C++ -*-===//
// _
// | |
// __| | __ ___ ___ ___
// / _` |/ _` \ \ /\ / / '_ |
// | (_| | (_| |\ V V /| | | |
// \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain
//
//
// This file is distributed under the MIT License (MIT).
// See LICENSE.txt for details.
//
//===------------------------------------------------------------------------------------------===//
#ifndef DAWN_UNITTEST_UNITTESTLOGGER_H
#define DAWN_UNITTEST_UNITTESTLOGGER_H
#include "dawn/Support/Logging.h"
namespace dawn {
/// @brief Simple logger to std::cout for debugging purposes
class UnittestLogger : public LoggerInterface {
public:
void log(LoggingLevel level, const std::string& message, const char* file, int line) override;
};
} // namespace dawn
#endif
| //===--------------------------------------------------------------------------------*- C++ -*-===//
// _
// | |
// __| | __ ___ ___ ___
// / _` |/ _` \ \ /\ / / '_ |
// | (_| | (_| |\ V V /| | | |
// \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain
//
//
// This file is distributed under the MIT License (MIT).
// See LICENSE.txt for details.
//
//===------------------------------------------------------------------------------------------===//
#ifndef DAWN_UNITTEST_UNITTESTLOGGER_H
#define DAWN_UNITTEST_UNITTESTLOGGER_H
#include "dawn/Support/Logging.h"
namespace dawn {
/// @brief Simple logger to `std::cout` for debugging purposes
/// @ingroup unittest
class UnittestLogger : public LoggerInterface {
public:
void log(LoggingLevel level, const std::string& message, const char* file, int line) override;
};
} // namespace dawn
#endif
| Add unittest to unittest group in doxygen | Add unittest to unittest group in doxygen
| C | mit | twicki/dawn,twicki/dawn,twicki/dawn,MeteoSwiss-APN/dawn,MeteoSwiss-APN/dawn,twicki/dawn,MeteoSwiss-APN/dawn |
79337800123739d13f1e05d7e52458f6fac33f76 | qtssh/sshfilesystemmodel.h | qtssh/sshfilesystemmodel.h | #pragma once
#include <QObject>
#include <QAbstractItemModel>
#include <QHash>
class SshSFtp;
class SshFilesystemNode;
class SshFilesystemModel : public QAbstractItemModel
{
SshSFtp *m_provider;
SshFilesystemNode *m_rootItem;
QModelIndex m_root;
QHash<int, QByteArray> m_roles;
public:
enum Roles {
FileIconRole = Qt::DecorationRole,
FilePathRole = Qt::UserRole + 1,
FileNameRole = Qt::UserRole + 2,
FilePermissions = Qt::UserRole + 3
};
SshFilesystemModel(SshSFtp *provider);
// Basic functionality:
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &index = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QHash<int, QByteArray> roleNames() const;
void setRootPath(QString root = "/");
};
| #pragma once
#include <QObject>
#include <QAbstractItemModel>
#include <QHash>
class SshSFtp;
class SshFilesystemNode;
class SshFilesystemModel : public QAbstractItemModel
{
SshSFtp *m_provider;
SshFilesystemNode *m_rootItem;
QModelIndex m_root;
QHash<int, QByteArray> m_roles;
public:
enum Roles {
FileNameRole = Qt::UserRole + 1,
FilePathRole = Qt::UserRole + 2,
FileBaseNameRole = Qt::UserRole + 3,
FileSuffixRole = Qt::UserRole + 4,
FileSizeRole = Qt::UserRole + 5,
FileLastModifiedRole = Qt::UserRole + 6,
FileLastReadRole = Qt::UserRole +7,
FileIsDirRole = Qt::UserRole + 8,
FileUrlRole = Qt::UserRole + 9
};
SshFilesystemModel(SshSFtp *provider);
// Basic functionality:
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &index = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QHash<int, QByteArray> roleNames() const;
void setRootPath(QString root = "/");
};
| Use same Roles as QQuickFolderListModel | SshFilesystemModel: Use same Roles as QQuickFolderListModel
| C | bsd-3-clause | condo4/QtSsh |
c2d5ab6940fb1d93bcec22278f066f9429fa669a | templates/ComponentsEntities.h | templates/ComponentsEntities.h | // THIS FILE IS AUTO GENERATED, EDIT AT YOUR OWN RISK
//% L
#ifndef COMPONENTS_ENTITIES_H_
#define COMPONENTS_ENTITIES_H_
//% L
#include "Components.h"
//% L
{% for component in components %}
#include "{{component.get_type_name()}}.h"
{% endfor %}
//% L
// Entity definitions
//% L
{% for entity in entities %}
//% L
// Definition of {{entity.get_type_name()}}
//% L
class {{entity.get_type_name()}}: public Entity {
//* The vtables for each entities are statically defined
static const MessageHandler messageHandlers[];
static const int componentOffsets[];
//% L
public:
//* Default constructor
{{entity.get_type_name()}}(
{% for (i, attrib) in enumerate(general.common_entity_attributes) %}
{% if i != 0 %}, {% endif %} {{attrib.get_declaration()}}
{% endfor %}
);
virtual ~{{entity.get_type_name()}}();
//% L
//* The components
{% for component in entity.get_components() %}
{{component.get_type_name()}} {{component.get_variable_name()}};
{% endfor %}
};
//% L
{% endfor %}
//% LL
#endif // COMPONENTS_ENTITIES_H_
//% L
| // THIS FILE IS AUTO GENERATED, EDIT AT YOUR OWN RISK
//% L
#ifndef COMPONENTS_ENTITIES_H_
#define COMPONENTS_ENTITIES_H_
//% L
#include "Components.h"
#include "ComponentImplementationInclude.h"
//% L
// Entity definitions
//% L
{% for entity in entities %}
//% L
// Definition of {{entity.get_type_name()}}
//% L
class {{entity.get_type_name()}}: public Entity {
//* The vtables for each entities are statically defined
static const MessageHandler messageHandlers[];
static const int componentOffsets[];
//% L
public:
//* Default constructor
{{entity.get_type_name()}}(
{% for (i, attrib) in enumerate(general.common_entity_attributes) %}
{% if i != 0 %}, {% endif %} {{attrib.get_declaration()}}
{% endfor %}
);
virtual ~{{entity.get_type_name()}}();
//% L
//* The components
{% for component in entity.get_components() %}
{{component.get_type_name()}} {{component.get_variable_name()}};
{% endfor %}
};
//% L
{% endfor %}
//% LL
#endif // COMPONENTS_ENTITIES_H_
//% L
| Include the component implementation include helper instead of the individual components in Components.h. | Include the component implementation include helper instead of the individual components in Components.h.
| C | bsd-3-clause | DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain |
fea1a1cd1a8b4fd215f58f844f2b1e4702e694d7 | runtime/test/misc_bugs/many-microtask-args.c | runtime/test/misc_bugs/many-microtask-args.c | // RUN: %libomp-compile-and-run
#include <stdio.h>
int main()
{
int i1 = 0;
int i2 = 1;
int i3 = 2;
int i4 = 3;
int i5 = 4;
int i6 = 6;
int i7 = 7;
int i8 = 8;
int i9 = 9;
int i10 = 10;
int i11 = 11;
int i12 = 12;
int i13 = 13;
int i14 = 14;
int i15 = 15;
int i16 = 16;
int r = 0;
#pragma omp parallel for firstprivate(i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16) reduction(+:r)
for (int i = 0; i < i16; i++) {
r += i + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + i16;
}
int rf = 2216;
if (r != rf) {
fprintf(stderr, "r should be %d but instead equals %d\n", rf, r);
return 1;
}
return 0;
}
| Add a test case for microtask dispatch with many arguments | Add a test case for microtask dispatch with many arguments
This is a cleaned-up version of the test case posted in the D19879 review.
git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@270867 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp |
|
1a266ba95249e635f44b78edcede6444940ba17c | test/profile/instrprof-error.c | test/profile/instrprof-error.c | // RUN: %clang_profgen -o %t -O3 %s
// RUN: touch %t.profraw
// RUN: chmod -w %t.profraw
// RUN: env LLVM_PROFILE_FILE=%t.profraw LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
// RUN: chmod +w %t.profraw
int main(int argc, const char *argv[]) {
if (argc < 2)
return 1;
return 0;
}
// CHECK: LLVM Profile: Failed to write file
| // RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE="/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
int main(int argc, const char *argv[]) {
if (argc < 2)
return 1;
return 0;
}
// CHECK: LLVM Profile: Failed to write file
| Make a test work if run by the super-user | [profile] Make a test work if run by the super-user
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@264773 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
4bd83c842ab1cdc7245b2a6f78ca63047aa4062f | AFToolkit/ObjectProvider/AFObjectModel.h | AFToolkit/ObjectProvider/AFObjectModel.h |
#pragma mark Forward Declarations
@class AFObjectProvider;
#pragma mark Type Definitions
typedef void (^AFObjectUpdateBlock)(AFObjectProvider *provider, id object, NSDictionary *values);
typedef id (^AFObjectCreateBlock)(AFObjectProvider *provider, NSDictionary *values);
#pragma mark - Class Interface
@interface AFObjectModel : NSObject
#pragma mark - Properties
@property (nonatomic, strong) Class myClass;
@property (nonatomic, copy) NSArray *idProperties;
@property (nonatomic, copy) NSDictionary *propertyKeyMap;
@property (nonatomic, copy) NSDictionary *collectionTypeMap;
@property (nonatomic, copy) AFObjectUpdateBlock updateBlock;
@property (nonatomic, copy) AFObjectCreateBlock createBlock;
#pragma mark - Constructors
- (id)initWithClass: (Class)myClass
idProperties: (NSArray *)idProperties
propertyKeyMap: (NSDictionary *)propertyKeyMap
collectionTypeMap: (NSDictionary *)collectionTypeMap
updateBlock: (AFObjectUpdateBlock)updateBlock
createBlock: (AFObjectCreateBlock)createBlock;
#pragma mark - Static Methods
+ (id)objectModelWithClass: (Class)myClass
idProperties: (NSArray *)idProperties
propertyKeyMap: (NSDictionary *)propertyKeyMap
collectionTypeMap: (NSDictionary *)collectionTypeMap
updateBlock: (AFObjectUpdateBlock)updateBlock
createBlock: (AFObjectCreateBlock)createBlock;
@end // @interface AFObjectModel |
#pragma mark Forward Declarations
@class AFObjectProvider;
#pragma mark Type Definitions
typedef void (^AFObjectUpdateBlock)(id provider, id object, NSDictionary *values);
typedef id (^AFObjectCreateBlock)(id provider, NSDictionary *values);
#pragma mark - Class Interface
@interface AFObjectModel : NSObject
#pragma mark - Properties
@property (nonatomic, strong) Class myClass;
@property (nonatomic, copy) NSArray *idProperties;
@property (nonatomic, copy) NSDictionary *propertyKeyMap;
@property (nonatomic, copy) NSDictionary *collectionTypeMap;
@property (nonatomic, copy) AFObjectUpdateBlock updateBlock;
@property (nonatomic, copy) AFObjectCreateBlock createBlock;
#pragma mark - Constructors
- (id)initWithClass: (Class)myClass
idProperties: (NSArray *)idProperties
propertyKeyMap: (NSDictionary *)propertyKeyMap
collectionTypeMap: (NSDictionary *)collectionTypeMap
updateBlock: (AFObjectUpdateBlock)updateBlock
createBlock: (AFObjectCreateBlock)createBlock;
#pragma mark - Static Methods
+ (id)objectModelWithClass: (Class)myClass
idProperties: (NSArray *)idProperties
propertyKeyMap: (NSDictionary *)propertyKeyMap
collectionTypeMap: (NSDictionary *)collectionTypeMap
updateBlock: (AFObjectUpdateBlock)updateBlock
createBlock: (AFObjectCreateBlock)createBlock;
@end // @interface AFObjectModel | Update update and create block signatures. | Update update and create block signatures.
| C | mit | mlatham/AFToolkit |
6bab2c613d7fa70bb8514f89ab7455ede717142b | include/linux/irqreturn.h | include/linux/irqreturn.h | #ifndef _LINUX_IRQRETURN_H
#define _LINUX_IRQRETURN_H
/**
* enum irqreturn
* @IRQ_NONE interrupt was not from this device
* @IRQ_HANDLED interrupt was handled by this device
* @IRQ_WAKE_THREAD handler requests to wake the handler thread
*/
enum irqreturn {
IRQ_NONE = (0 << 0),
IRQ_HANDLED = (1 << 0),
IRQ_WAKE_THREAD = (1 << 1),
};
typedef enum irqreturn irqreturn_t;
#define IRQ_RETVAL(x) ((x) != IRQ_NONE)
#endif
| #ifndef _LINUX_IRQRETURN_H
#define _LINUX_IRQRETURN_H
/**
* enum irqreturn
* @IRQ_NONE interrupt was not from this device
* @IRQ_HANDLED interrupt was handled by this device
* @IRQ_WAKE_THREAD handler requests to wake the handler thread
*/
enum irqreturn {
IRQ_NONE = (0 << 0),
IRQ_HANDLED = (1 << 0),
IRQ_WAKE_THREAD = (1 << 1),
};
typedef enum irqreturn irqreturn_t;
#define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE)
#endif
| Correct fuzzy and fragile IRQ_RETVAL() definition | genirq: Correct fuzzy and fragile IRQ_RETVAL() definition
commit bedd30d986a0 ("genirq: make irqreturn_t an enum") blindly replaced
"0" by "IRQ_NONE" in the "IRQ_RETVAL(x)" macro definition.
However, as "x" is a condition, "0" meant "boolean false", not an
irqreturn_t value.
All of this worked, and kept working after the addition of IRQ_WAKE_THREAD,
as
- both "boolean false" and "IRQ_NONE" are "0" (for the comparison),
- "boolean true" and "boolean false" nicely map to the correct values of
"IRQ_HANDLED" and "IRQ_NONE" (for the return value).
Correct the macro definition for clarity and future-proofness.
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
925d17f3ee4b7f7881fa77a31524ecd9f1305242 | include/internal/thread_once.h | include/internal/thread_once.h | /*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <openssl/crypto.h>
#define DEFINE_RUN_ONCE(init) \
static int init(void); \
int init##_ossl_ret_ = 0; \
void init##_ossl_(void) \
{ \
init##_ossl_ret_ = init(); \
} \
static int init(void)
#define DECLARE_RUN_ONCE(init) \
extern int init##_ossl_ret_; \
void init##_ossl_(void);
#define DEFINE_RUN_ONCE_STATIC(init) \
static int init(void); \
static int init##_ossl_ret_ = 0; \
static void init##_ossl_(void) \
{ \
init##_ossl_ret_ = init(); \
} \
static int init(void)
/*
* RUN_ONCE - use CRYPTO_THREAD_run_once, and check if the init succeeded
* @once: pointer to static object of type CRYPTO_ONCE
* @init: function name that was previously given to DEFINE_RUN_ONCE,
* DEFINE_RUN_ONCE_STATIC or DECLARE_RUN_ONCE.
*
* The return value is 1 on success or 0 in case of error.
*/
#define RUN_ONCE(once, init) \
(CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
| Define a few internal macros for easy use of run_once functions | Define a few internal macros for easy use of run_once functions
Because pthread_once() takes a function taking no argument and
returning nothing, and we want to be able to check if they're
successful, we define a few internal macros to get around the issue.
Reviewed-by: Kurt Roeckx <[email protected]>
| C | apache-2.0 | openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl |
|
65cb3326e30ef8a67eb1d4411ec563e91be6e9ae | brotli/dec/types.h | brotli/dec/types.h | /* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Common types
*/
#ifndef BROTLI_DEC_TYPES_H_
#define BROTLI_DEC_TYPES_H_
#include <stddef.h> /* for size_t */
#ifndef _MSC_VER
#include <inttypes.h>
#ifdef __STRICT_ANSI__
#define BROTLI_INLINE
#else /* __STRICT_ANSI__ */
#define BROTLI_INLINE inline
#endif
#else
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned long long int uint64_t;
typedef long long int int64_t;
#define BROTLI_INLINE __forceinline
#endif /* _MSC_VER */
#endif /* BROTLI_DEC_TYPES_H_ */
| /* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Common types
*/
#ifndef BROTLI_DEC_TYPES_H_
#define BROTLI_DEC_TYPES_H_
#include <stddef.h> /* for size_t */
#ifndef _MSC_VER
#include <inttypes.h>
#if defined(__cplusplus) || !defined(__STRICT_ANSI__) \
|| __STDC_VERSION__ >= 199901L
#define BROTLI_INLINE inline
#else
#define BROTLI_INLINE
#endif
#else
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned long long int uint64_t;
typedef long long int int64_t;
#define BROTLI_INLINE __forceinline
#endif /* _MSC_VER */
#endif /* BROTLI_DEC_TYPES_H_ */
| Allow use of inline keyword in c++/c99 mode | Allow use of inline keyword in c++/c99 mode
| C | mit | google/woff2,khaledhosny/woff2,rsheeter/woff2,anthrotype/woff2,bxchusun/le-huong-van,bxchusun/le-huong-van,seanjensengrey/font-compression-reference,bxchusun/le-huong-van,bxchusun/le-huong-van,seanjensengrey/font-compression-reference,seanjensengrey/font-compression-reference |
142b3a0aa1e6c5d0addb914a13c3dd8755f89010 | kmail/filterimporterexporter.h | kmail/filterimporterexporter.h | #ifndef __FILTERIMPORTEREXPORTER_H__
#define __FILTERIMPORTEREXPORTER_H__
#include <qvalueList.h>
class KMFilter;
class KConfig;
namespace KMail
{
/**
@short Utility class that provides persisting of filters to/from KConfig.
@author Till Adam <[email protected]>
*/
class FilterImporterExporter
{
public:
FilterImporterExporter( bool popFilter = false );
virtual ~FilterImporterExporter();
/** Export the given filter rules to a file which
* is asked from the user. The list to export is also
* presented for confirmation/selection. */
void exportFilters( const QValueList<KMFilter*> & );
/** Import filters. Ask the user where to import them from
* and which filters to import. */
QValueList<KMFilter*> importFilters();
static void writeFiltersToConfig( const QValueList<KMFilter*>& filters, KConfig* config, bool bPopFilter );
static QValueList<KMFilter*> readFiltersFromConfig( KConfig* config, bool bPopFilter );
private:
bool mPopFilter;
};
}
#endif /* __FILTERIMPORTEREXPORTER_H__ */
| #ifndef __FILTERIMPORTEREXPORTER_H__
#define __FILTERIMPORTEREXPORTER_H__
#include <qvaluelist.h>
class KMFilter;
class KConfig;
namespace KMail
{
/**
@short Utility class that provides persisting of filters to/from KConfig.
@author Till Adam <[email protected]>
*/
class FilterImporterExporter
{
public:
FilterImporterExporter( bool popFilter = false );
virtual ~FilterImporterExporter();
/** Export the given filter rules to a file which
* is asked from the user. The list to export is also
* presented for confirmation/selection. */
void exportFilters( const QValueList<KMFilter*> & );
/** Import filters. Ask the user where to import them from
* and which filters to import. */
QValueList<KMFilter*> importFilters();
static void writeFiltersToConfig( const QValueList<KMFilter*>& filters, KConfig* config, bool bPopFilter );
static QValueList<KMFilter*> readFiltersFromConfig( KConfig* config, bool bPopFilter );
private:
bool mPopFilter;
};
}
#endif /* __FILTERIMPORTEREXPORTER_H__ */
| Fix compilation for case-sensitive file systems. | Fix compilation for case-sensitive file systems.
svn path=/branches/kdepim/enterprise/kdepim/; revision=728559
| C | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi |
d6e38bce49b4e71b2a670267d305f54b899ab4ea | test/echo.c | test/echo.c | #include <arpa/inet.h>
#include <endian.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
int main()
{
struct sockaddr_in serv_addr;
memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1");
serv_addr.sin_port = htons(11122);
int fd = socket(AF_INET, SOCK_STREAM, 0);
static const int tcp_nodelay_on = 1;
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &tcp_nodelay_on, sizeof(tcp_nodelay_on)) < 0) {
fprintf(stderr, "Could not set TCP_NODELAY\n");
return EXIT_FAILURE;
}
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
fprintf(stderr, "Failed to connect with server\n");
return EXIT_FAILURE;
}
char buffer[1000];
char *write_ptr = buffer;
const char msg[] = "bla";
uint32_t len = strlen(msg);
len = htobe32(len);
memcpy(write_ptr, &len, sizeof(len));
write_ptr += sizeof(len);
memcpy(write_ptr, msg, strlen(msg));
int i;
for (i = 0; i < 1000000; i++) {
write(fd, buffer, sizeof(len) + strlen(msg));
uint32_t msg_len;
ssize_t got = read(fd, &msg_len, sizeof(msg_len));
if (got != sizeof(msg_len)) {
fprintf(stderr, "could not read enough for msg_len: %zd\n", got);
return EXIT_FAILURE;
}
msg_len = be32toh(msg_len);
if (msg_len != be32toh(len)) {
fprintf(stderr, "msglen != len\n");
}
char read_buffer[1000];
got = read(fd, read_buffer, msg_len);
if (got != msg_len) {
fprintf(stderr, "could not read enough of message!\n");
}
read_buffer[msg_len] = '\0';
if (strcmp(read_buffer, msg) != 0) {
fprintf(stderr, "received message not the same like send!\n");
}
}
close(fd);
return EXIT_SUCCESS;
}
| Add client test program to measure speed of message handling. | Add client test program to measure speed of message handling.
| C | mit | gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet |
|
d06957e790aef773f00332203d69cbb550bf44e7 | src/cpp_wrapper/FlatFile.h | src/cpp_wrapper/FlatFile.h | /******************************************************************************/
/**
@file
@author Dana Klamut
@brief The C++ implementation of a flat file dictionary.
*/
/******************************************************************************/
#if !defined(PROJECT_FLATFILE_H)
#define PROJECT_FLATFILE_H
#include "Dictionary.h"
#include "../key_value/kv_system.h"
#include "../dictionary/flat_file/flat_file_dictionary_handler.h"
template<typename K, typename V>
class FlatFile:public Dictionary<K, V> {
public:
/**
@brief Registers a specific flat file dictionary instance.
@details Registers functions for dictionary.
@param type_key
The type of keys to be stored in the dictionary.
@param key_size
The size of keys to be stored in the dictionary.
@param value_size
The size of the values to be stored in the dictionary.
*/
FlatFile(
ion_key_type_t type_key,
int key_size,
int value_size,
int dictionary_size
) {
ffdict_init(&this->handler);
this->initializeDictionary(type_key, key_size, value_size, dictionary_size);
}
};
#endif /* PROJECT_FLATFILE_H */
| /******************************************************************************/
/**
@file
@author Dana Klamut
@brief The C++ implementation of a flat file dictionary.
*/
/******************************************************************************/
#if !defined(PROJECT_FLATFILE_H)
#define PROJECT_FLATFILE_H
#include "Dictionary.h"
#include "../key_value/kv_system.h"
#include "../dictionary/flat_file/flat_file_dictionary_handler.h"
template<typename K, typename V>
class FlatFile:public Dictionary<K, V> {
public:
/**
@brief Registers a specific flat file dictionary instance.
@details Registers functions for dictionary.
@param type_key
The type of keys to be stored in the dictionary.
@param key_size
The size of keys to be stored in the dictionary.
@param value_size
The size of the values to be stored in the dictionary.
@param dictionary_size
The size desired for the dictionary.
*/
FlatFile(
ion_key_type_t type_key,
int key_size,
int value_size,
int dictionary_size
) {
ffdict_init(&this->handler);
this->initializeDictionary(type_key, key_size, value_size, dictionary_size);
}
};
#endif /* PROJECT_FLATFILE_H */
| Update doxygen comments to reflect changes to flat file constructor | Update doxygen comments to reflect changes to flat file constructor
| C | bsd-3-clause | iondbproject/iondb,iondbproject/iondb |
c51997e83f1b3f8f1ddd4f19ef045feb83ad05f7 | lynx/base/compiler_specific.h | lynx/base/compiler_specific.h | #ifndef LYNX_BASE_COMPILER_SPECIFIC_H_
#define LYNX_BASE_COMPILER_SPECIFIC_H_
#if !defined(UNLIKELY)
#if defined(COMPILER_GCC)
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
#else
#define UNLIKELY(x) (x)
#endif
#endif
#endif | Add UNLIKELY for compiler optimization | Add UNLIKELY for compiler optimization
UNLIKELY only used in GCC compiler
| C | mit | hxxft/lynx-native,hxxft/lynx-native,hxxft/lynx-native,hxxft/lynx-native,hxxft/lynx-native,hxxft/lynx-native,hxxft/lynx-native,hxxft/lynx-native,hxxft/lynx-native |
|
4f133b2d11568f9e495cfa76ed1a61bed8b4c81c | sys/pc98/include/clock.h | sys/pc98/include/clock.h | /*-
* Copyright (C) 2005 TAKAHASHI Yoshihiro. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _PC98_INCLUDE_CLOCK_H_
#define _PC98_INCLUDE_CLOCK_H_
#include <i386/clock.h>
#endif /* _PC98_INCLUDE_CLOCK_H_ */
| /*-
* This file is in the public domain.
*/
/* $FreeBSD$ */
#include <i386/clock.h>
| Remove my copyright. This file includes simply i386's one now. | Remove my copyright. This file includes simply i386's one now.
| C | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase |
8dd96657649aeaceeac1a139e8e0215a6a9c5fc2 | okui/include/onair/okui/applications/SDLAndroidMain.h | okui/include/onair/okui/applications/SDLAndroidMain.h | #pragma once
#include "onair/okui/config.h"
#if SCRAPS_ANDROID
#include <SDL2/SDL_main.h>
#include <jni.h>
extern "C" {
/* Called before SDL_main() to initialize JNI bindings in SDL library */
extern void SDL_Android_Init(JNIEnv* env, jclass cls);
/* Start up the SDL app */
JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject array)
{
int i;
int argc;
int status;
/* This interface could expand with ABI negotiation, callbacks, etc. */
SDL_Android_Init(env, cls);
SDL_SetMainReady();
/* Prepare the arguments. */
int len = env->GetArrayLength((jobjectArray)array);
char* argv[1 + len + 1];
argc = 0;
/* Use the name "app_process" so PHYSFS_platformCalcBaseDir() works.
https://bitbucket.org/MartinFelis/love-android-sdl2/issue/23/release-build-crash-on-start
*/
argv[argc++] = SDL_strdup("app_process");
for (i = 0; i < len; ++i) {
const char* utf;
char* arg = NULL;
jstring string = (jstring)env->GetObjectArrayElement((jobjectArray)array, i);
if (string) {
utf = env->GetStringUTFChars(string, 0);
if (utf) {
arg = SDL_strdup(utf);
env->ReleaseStringUTFChars(string, utf);
}
env->DeleteLocalRef(string);
}
if (!arg) {
arg = SDL_strdup("");
}
argv[argc++] = arg;
}
argv[argc] = NULL;
/* Run the application. */
status = SDL_main(argc, argv);
/* Release the arguments. */
for (i = 0; i < argc; ++i) {
SDL_free(argv[i]);
}
/* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
/* exit(status); */
return status;
}
}
#endif
| Add android main for sdl | Add android main for sdl
Summary: Needed for the viewer, putting a helper here to be included by the viewer
Test Plan: Run viewer on android
Reviewers: mike.naquin
Reviewed By: mike.naquin
Subscribers: #engineering
Differential Revision: https://phabricator.btlive.tv/D1484
[This commit was only partially migrated from livelib commit 397ac913a235a97fb4bf7f61710a522a0094100e.] | C | apache-2.0 | bittorrent/okui,bittorrent/okui,bittorrent/okui,bittorrent/okui,bittorrent/okui |
|
859f0d817daea24874bda1f07d350be481cc1012 | sixtracklib/_impl/namespace_begin.h | sixtracklib/_impl/namespace_begin.h | #pragma once
#if !defined( NS_CONCAT_ )
#define NS_CONCAT_( A, B ) A##B
#endif /* !defined( NS_CONCAT ) */
#if !defined( NS_CONCAT )
#define NS_CONCAT( A, B ) NS_CONCAT_( A, B )
#endif /* !defined( NS_CONCAT ) */
#if !defined( NAMESPACE )
#define NAMESPACE
#endif /* !defined( NAMESPACE ) */
#if !defined( NS )
#define NS(name) NS_CONCAT( NAMESPACE, name )
#endif /* !defined( NS ) */
/* end: sixtracklib/_impl/namespace_begin.h */
| #pragma once
#if !defined( NS_CONCAT_ )
#define NS_CONCAT_( A, B ) A##B
#endif /* !defined( NS_CONCAT ) */
#if !defined( NS_CONCAT )
#define NS_CONCAT( A, B ) NS_CONCAT_( A, B )
#endif /* !defined( NS_CONCAT ) */
#if !defined( __NAMESPACE )
#define __NAMESPACE
#endif /* !defined( __NAMESPACE ) */
#if !defined( NS )
#define NS(name) NS_CONCAT( __NAMESPACE, name )
#endif /* !defined( NS ) */
/* end: sixtracklib/_impl/namespace_begin.h */
| Fix not yet corrected NAMESPACE macro | Fix not yet corrected NAMESPACE macro
| C | lgpl-2.1 | SixTrack/SixTrackLib,SixTrack/SixTrackLib,SixTrack/SixTrackLib,SixTrack/SixTrackLib |
17c0d74dde5122245a19bd358e2471b0e3fce037 | runtime/include/stdchpl.h | runtime/include/stdchpl.h | #ifndef _stdchpl_H_
#define _stdchpl_H_
#include "chplrt.h"
#include <errno.h>
#include <math.h>
#include <float.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <chpl_md.h>
#include "arg.h"
#include "config.h"
#include "chplcast.h"
#include "chplcgfns.h"
#include "chpl-atomics.h"
#include "chpl-comm.h"
#include "chplcopygc.h"
#include "chplexit.h"
#include <chplfp.h>
#include "chplio.h"
#include "chplmath.h"
#include "chpl-mem.h"
#include "chplmemtrack.h"
#include "chplsys.h"
#include "chpl-tasks.h"
#include "chpltimers.h"
#include "chpltypes.h"
#include "chplgpu.h"
#include "error.h"
#include "chpl-comm-compiler-macros.h"
#endif
| #ifndef _stdchpl_H_
#define _stdchpl_H_
#include "chplrt.h"
#include <errno.h>
#include <math.h>
#include <float.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <chpl_md.h>
#include "arg.h"
#include "config.h"
#include "chplcast.h"
#include "chplcgfns.h"
#include "chpl-atomics.h"
#include "chpl-comm.h"
#include "chplcopygc.h"
#include "chplexit.h"
#include <chplfp.h>
#include "chplio.h"
#include "chplmath.h"
#include "chpl-mem.h"
#include "chplmemtrack.h"
#include "chplsys.h"
#include "chpl-tasks.h"
#include "chpltimers.h"
#include "chpltypes.h"
#include "chplgpu.h"
#include "error.h"
#include "chplgmp.h"
#include "chpl-comm-compiler-macros.h"
#endif
| Include "chplgmp.h" for the emitted code. | Include "chplgmp.h" for the emitted code.
[Not reviewed, because seems obvious (now), small, and safe.]
The r21083 change was a bit overenthusiastic in its removal of the
inclusion of "chplgmp.h" into stdchpl.h and this the emitted code.
Without that, tests that use GMP won't build. Put it back.
git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@21107 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
| C | apache-2.0 | CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,chizarlicious/chapel,chizarlicious/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,chizarlicious/chapel,sungeunchoi/chapel,chizarlicious/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,chizarlicious/chapel,sungeunchoi/chapel,hildeth/chapel |
6d6519a43a674622a617cef7171c6003ed85fc0b | src/include/index/index_util.h | src/include/index/index_util.h | //===----------------------------------------------------------------------===//
//
// Peloton
//
// index_util.h
//
// Identification: src/include/index/index_util.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//
#pragma once
#include "index/index.h"
namespace peloton {
namespace index {
void ConstructIntervals(oid_t leading_column_id,
const std::vector<Value> &values,
const std::vector<oid_t> &key_column_ids,
const std::vector<ExpressionType> &expr_types,
std::vector<std::pair<Value, Value>> &intervals);
void FindMaxMinInColumns(oid_t leading_column_id,
const std::vector<Value> &values,
const std::vector<oid_t> &key_column_ids,
const std::vector<ExpressionType> &expr_types,
std::map<oid_t, std::pair<Value, Value>> &non_leading_columns);
bool HasNonOptimizablePredicate(const std::vector<ExpressionType> &expr_types);
bool IsPointQuery(const IndexMetadata *metadata_p,
const std::vector<oid_t> &tuple_column_id_list,
const std::vector<ExpressionType> &expr_list);
} // End index namespace
} // End peloton namespace
| //===----------------------------------------------------------------------===//
//
// Peloton
//
// index_util.h
//
// Identification: src/include/index/index_util.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//
#pragma once
#include "index/index.h"
namespace peloton {
namespace index {
void ConstructIntervals(oid_t leading_column_id,
const std::vector<Value> &values,
const std::vector<oid_t> &key_column_ids,
const std::vector<ExpressionType> &expr_types,
std::vector<std::pair<Value, Value>> &intervals);
void FindMaxMinInColumns(oid_t leading_column_id,
const std::vector<Value> &values,
const std::vector<oid_t> &key_column_ids,
const std::vector<ExpressionType> &expr_types,
std::map<oid_t, std::pair<Value, Value>> &non_leading_columns);
bool HasNonOptimizablePredicate(const std::vector<ExpressionType> &expr_types);
bool IsPointQuery(const IndexMetadata *metadata_p,
const std::vector<oid_t> &tuple_column_id_list,
const std::vector<ExpressionType> &expr_list,
std::vector<std::pair<oid_t, oid_t>> &value_index_list);
} // End index namespace
} // End peloton namespace
| Change interface of IsPointQuery() in header file | Change interface of IsPointQuery() in header file
| C | apache-2.0 | prashasthip/peloton,haojin2/peloton,malin1993ml/peloton,ShuxinLin/peloton,seojungmin/peloton,haojin2/peloton,AllisonWang/peloton,prashasthip/peloton,vittvolt/15721-peloton,AngLi-Leon/peloton,apavlo/peloton,jessesleeping/iso_peloton,seojungmin/peloton,malin1993ml/peloton,vittvolt/15721-peloton,phisiart/peloton-p3,AngLi-Leon/peloton,vittvolt/15721-peloton,phisiart/peloton-p3,PauloAmora/peloton,PauloAmora/peloton,cmu-db/peloton,ShuxinLin/peloton,apavlo/peloton,ShuxinLin/peloton,cmu-db/peloton,yingjunwu/peloton,cmu-db/peloton,prashasthip/peloton,ShuxinLin/peloton,eric-haibin-lin/peloton-1,yingjunwu/peloton,PauloAmora/peloton,cmu-db/peloton,vittvolt/peloton,phisiart/peloton-p3,phisiart/peloton-p3,eric-haibin-lin/peloton-1,AngLi-Leon/peloton,vittvolt/15721-peloton,yingjunwu/peloton,apavlo/peloton,phisiart/peloton-p3,eric-haibin-lin/peloton-1,AllisonWang/peloton,vittvolt/15721-peloton,prashasthip/peloton,yingjunwu/peloton,malin1993ml/peloton,eric-haibin-lin/peloton-1,malin1993ml/peloton,AngLi-Leon/peloton,eric-haibin-lin/peloton-1,vittvolt/15721-peloton,AllisonWang/peloton,malin1993ml/peloton,haojin2/peloton,wangziqi2016/peloton,apavlo/peloton,haojin2/peloton,AngLi-Leon/peloton,prashasthip/peloton,jessesleeping/iso_peloton,apavlo/peloton,seojungmin/peloton,seojungmin/peloton,vittvolt/peloton,PauloAmora/peloton,AngLi-Leon/peloton,wangziqi2016/peloton,cmu-db/peloton,vittvolt/peloton,vittvolt/peloton,AllisonWang/peloton,jessesleeping/iso_peloton,apavlo/peloton,phisiart/peloton-p3,ShuxinLin/peloton,vittvolt/peloton,yingjunwu/peloton,AllisonWang/peloton,wangziqi2016/peloton,cmu-db/peloton,AllisonWang/peloton,seojungmin/peloton,PauloAmora/peloton,wangziqi2016/peloton,jessesleeping/iso_peloton,jessesleeping/iso_peloton,jessesleeping/iso_peloton,malin1993ml/peloton,vittvolt/peloton,jessesleeping/iso_peloton,ShuxinLin/peloton,eric-haibin-lin/peloton-1,wangziqi2016/peloton,seojungmin/peloton,haojin2/peloton,PauloAmora/peloton,wangziqi2016/peloton,yingjunwu/peloton,prashasthip/peloton,haojin2/peloton |
6e61eb443ffd8c2e9e5a7ebca80f3d2fda63fd12 | Motif/Motif.h | Motif/Motif.h | //
// Motif.h
// Motif
//
// Created by Eric Horacek on 3/29/15.
// Copyright (c) 2015 Eric Horacek. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for Motif.
FOUNDATION_EXPORT double MotifVersionNumber;
//! Project version string for Motif.
FOUNDATION_EXPORT const unsigned char MotifVersionString[];
#import "MTFBackwardsCompatableNullability.h"
#import "MTFTheme.h"
#import "MTFThemeClass.h"
#import "MTFThemeClassApplicable.h"
#import "MTFDynamicThemeApplier.h"
#import "MTFThemeParser.h"
#import "NSObject+ThemeClassAppliers.h"
#import "NSObject+ThemeClassName.h"
#import "MTFReverseTransformedValueClass.h"
#import "MTFObjCTypeValueTransformer.h"
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
#import "MTFScreenBrightnessThemeApplier.h"
#import "MTFColorFromStringTransformer.h"
#import "MTFEdgeInsetsFromStringTransformer.h"
#import "MTFPointFromStringTransformer.h"
#import "MTFRectFromStringTransformer.h"
#import "MTFSizeFromStringTransformer.h"
#endif
| //
// Motif.h
// Motif
//
// Created by Eric Horacek on 3/29/15.
// Copyright (c) 2015 Eric Horacek. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for Motif.
FOUNDATION_EXPORT double MotifVersionNumber;
//! Project version string for Motif.
FOUNDATION_EXPORT const unsigned char MotifVersionString[];
#import <Motif/MTFBackwardsCompatableNullability.h>
#import <Motif/MTFTheme.h>
#import <Motif/MTFThemeClass.h>
#import <Motif/MTFThemeClassApplicable.h>
#import <Motif/MTFDynamicThemeApplier.h>
#import <Motif/MTFThemeParser.h>
#import <Motif/NSObject+ThemeClassAppliers.h>
#import <Motif/NSObject+ThemeClassName.h>
#import <Motif/MTFReverseTransformedValueClass.h>
#import <Motif/MTFObjCTypeValueTransformer.h>
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
#import <Motif/MTFScreenBrightnessThemeApplier.h>
#import <Motif/MTFColorFromStringTransformer.h>
#import <Motif/MTFEdgeInsetsFromStringTransformer.h>
#import <Motif/MTFPointFromStringTransformer.h>
#import <Motif/MTFRectFromStringTransformer.h>
#import <Motif/MTFSizeFromStringTransformer.h>
#endif
| Use <> import syntax for umbrella header | Use <> import syntax for umbrella header
| C | mit | jsslai/Motif,jsslai/Motif,ekurutepe/Motif,erichoracek/Motif,erichoracek/Motif,jlawton/Motif |
27ef086cdd1037b2deaf58feeced028b2b8df154 | app/tx/main.c | app/tx/main.c | #include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "nrf51.h"
#include "nrf_delay.h"
#include "error.h"
#include "radio.h"
void radio_event_handler(radio_evt_t * evt)
{
}
int main(void)
{
uint8_t i = 0;
radio_packet_t packet;
packet.len = 4;
radio_init(radio_event_handler);
NRF_GPIO->DIR = 1 << 18;
while (1)
{
packet.data[0] = i++;
packet.data[1] = 0x12;
radio_send(&packet);
NRF_GPIO->OUTSET = 1 << 18;
nrf_delay_us(100000);
NRF_GPIO->OUTCLR = 1 << 18;
nrf_delay_us(100000);
}
}
| #include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "nrf51.h"
#include "nrf_delay.h"
#include "error.h"
#include "radio.h"
void radio_evt_handler(radio_evt_t * evt)
{
}
int main(void)
{
uint8_t i = 0;
radio_packet_t packet;
packet.len = 4;
packet.flags.ack = 0;
radio_init(radio_evt_handler);
NRF_GPIO->DIR = 1 << 18;
while (1)
{
packet.data[0] = i++;
packet.data[1] = 0x12;
radio_send(&packet);
NRF_GPIO->OUTSET = 1 << 18;
nrf_delay_us(100000);
NRF_GPIO->OUTCLR = 1 << 18;
nrf_delay_us(100000);
}
}
| Rename the radio event handler. | Rename the radio event handler.
| C | bsd-3-clause | hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio |
145d1d2ef55ac62417539d7e7d8adebe90b37808 | testsuite/testing-tools/algorithm.h | testsuite/testing-tools/algorithm.h | /*
* Copyright (c) 2015-2018 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_TESTSUITE_ALGORITHM_H_
#define CPPSORT_TESTSUITE_ALGORITHM_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <functional>
#include <iterator>
#include <cpp-sort/utility/as_function.h>
#include <cpp-sort/utility/functional.h>
namespace helpers
{
template<
typename Iterator,
typename Compare = std::less<>,
typename Projection = cppsort::utility::identity
>
auto is_sorted(Iterator first, Iterator last,
Compare compare={}, Projection projection={})
-> bool
{
auto&& comp = cppsort::utility::as_function(compare);
auto&& proj = cppsort::utility::as_function(projection);
for (auto it = std::next(first) ; it != last ; ++it) {
if (comp(proj(*it), proj(*first))) {
return false;
}
}
return true;
}
template<
typename ForwardIterator,
typename T,
typename Projection = cppsort::utility::identity
>
auto iota(ForwardIterator first, ForwardIterator last,
T value, Projection projection={})
-> void
{
auto&& proj = cppsort::utility::as_function(projection);
while (first != last)
{
proj(*first++) = value;
++value;
}
}
}
#endif // CPPSORT_TESTSUITE_ALGORITHM_H_
| /*
* Copyright (c) 2015-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_TESTSUITE_ALGORITHM_H_
#define CPPSORT_TESTSUITE_ALGORITHM_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <functional>
#include <cpp-sort/utility/as_function.h>
#include <cpp-sort/utility/functional.h>
namespace helpers
{
template<
typename Iterator,
typename Compare = std::less<>,
typename Projection = cppsort::utility::identity
>
constexpr auto is_sorted(Iterator first, Iterator last,
Compare compare={}, Projection projection={})
-> bool
{
auto&& comp = cppsort::utility::as_function(compare);
auto&& proj = cppsort::utility::as_function(projection);
if (first == last) {
return true;
}
auto next = first;
while (++next != last) {
if (comp(proj(*next), proj(*first))) {
return false;
}
++first;
}
return true;
}
template<
typename ForwardIterator,
typename T,
typename Projection = cppsort::utility::identity
>
auto iota(ForwardIterator first, ForwardIterator last,
T value, Projection projection={})
-> void
{
auto&& proj = cppsort::utility::as_function(projection);
while (first != last)
{
proj(*first++) = value;
++value;
}
}
}
#endif // CPPSORT_TESTSUITE_ALGORITHM_H_
| Fix incorrect is_sorted implementation in the test suite | Fix incorrect is_sorted implementation in the test suite
I'm not sure how this managed to slip under my radar since 2015, that's
a bit embarrassing.
| C | mit | Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort |
c79713ed09ebd9ac54a52c573b47e86d33a39400 | 3RVX/Controllers/BrightnessController.h | 3RVX/Controllers/BrightnessController.h | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#pragma comment(lib, "Dxva2.lib")
#include <Windows.h>
#include <HighLevelMonitorConfigurationAPI.h>
class Monitor;
class BrightnessController {
public:
BrightnessController(HMONITOR monitor);
BrightnessController(Monitor &monitor);
float Brightness();
void Brightness(float level);
private:
bool SupportsBrightnessAPI(PHYSICAL_MONITOR &pm);
}; | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#pragma comment(lib, "Dxva2.lib")
#include <Windows.h>
#include <HighLevelMonitorConfigurationAPI.h>
class Monitor;
class BrightnessController {
public:
BrightnessController(HMONITOR monitor);
BrightnessController(Monitor &monitor);
float Brightness();
void Brightness(float level);
private:
bool _useBrightnessAPI;
bool SupportsBrightnessAPI(PHYSICAL_MONITOR &pm);
}; | Add bool for brightness API usage | Add bool for brightness API usage
| C | bsd-2-clause | malensek/3RVX,malensek/3RVX,malensek/3RVX |
1654c426db17e35b211fa86cea327c6b38d44317 | src/devices/ram.h | src/devices/ram.h | #ifndef RAM_H_
#define RAM_H_
#define RAM_BASE (1ULL << 12)
#define RAM_END ((1ULL << 16) - 1)
#endif
| #ifndef RAM_H_
#define RAM_H_
#define RAM_BASE (1ULL << 12)
#define RAM_END ((1ULL << 14) - 1)
#endif
| Make assembly prologue match new memory map | Make assembly prologue match new memory map
| C | mit | kulp/tenyr,kulp/tenyr,kulp/tenyr |
6bfa5c586b87a36f742e0525e6c337074b68978d | arch/powerpc/include/asm/abs_addr.h | arch/powerpc/include/asm/abs_addr.h | #ifndef _ASM_POWERPC_ABS_ADDR_H
#define _ASM_POWERPC_ABS_ADDR_H
#ifdef __KERNEL__
/*
* c 2001 PPC 64 Team, IBM Corp
*
* 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.
*/
#include <linux/memblock.h>
#include <asm/types.h>
#include <asm/page.h>
#include <asm/prom.h>
#define phys_to_abs(pa) (pa)
/* Convenience macros */
#define virt_to_abs(va) __pa(va)
#define abs_to_virt(aa) __va(aa)
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_ABS_ADDR_H */
| #ifndef _ASM_POWERPC_ABS_ADDR_H
#define _ASM_POWERPC_ABS_ADDR_H
#ifdef __KERNEL__
/*
* c 2001 PPC 64 Team, IBM Corp
*
* 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.
*/
#include <linux/memblock.h>
#include <asm/types.h>
#include <asm/page.h>
#include <asm/prom.h>
/* Convenience macros */
#define virt_to_abs(va) __pa(va)
#define abs_to_virt(aa) __va(aa)
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_ABS_ADDR_H */
| Remove phys_to_abs() now all users have been removed | powerpc: Remove phys_to_abs() now all users have been removed
Signed-off-by: Michael Ellerman <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
| C | apache-2.0 | TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs |
e5607744456ae98cd0379d076bd68dd4cbf1495e | chap1/ctof.c | chap1/ctof.c | #include <stdio.h>
/* print Celsius to Fahrenheit table
* for Fahrenheit 0, 20, ..., 300 */
int main()
{
float fahr;
float cel;
int lower;
int upper;
int step;
lower = 0; /* lower bound for the table */
upper = 150; /* upper bound for the table */
step = 10; /* amount to step by */
printf(" C \t");
printf(" F \n");
cel = lower;
while (cel <= upper) {
fahr = (9.0 / 5.0 * cel) + 32.0;
/* cel = (5.0 / 9.0) * (fahr - 32.0); */
printf("%6.0f\t%3.1f\n", cel, fahr);
cel += step;
}
}
| Add C to F program | Add C to F program
| C | mit | jabocg/theclang |
|
596ee1d8c4e7a34020579dfefcf86a8c5a0a1814 | src/shlwapi_dll.c | src/shlwapi_dll.c | /**
* Win32 UTF-8 wrapper
*
* ----
*
* shlwapi.dll functions.
*/
#include <Shlwapi.h>
#include "win32_utf8.h"
BOOL STDAPICALLTYPE PathMatchSpecU(
__in LPCSTR pszFile,
__in LPCSTR pszSpec
)
{
BOOL ret;
WCHAR_T_DEC(pszFile);
WCHAR_T_DEC(pszSpec);
WCHAR_T_CONV(pszFile);
WCHAR_T_CONV(pszSpec);
ret = PathMatchSpecW(pszFile_w, pszSpec_w);
VLA_FREE(pszFile_w);
VLA_FREE(pszSpec_w);
return ret;
}
BOOL STDAPICALLTYPE PathFileExistsU(
__in LPCSTR pszPath
)
{
BOOL ret;
WCHAR_T_DEC(pszPath);
WCHAR_T_CONV(pszPath);
ret = PathFileExistsW(pszPath_w);
VLA_FREE(pszPath_w);
return ret;
}
BOOL STDAPICALLTYPE PathRemoveFileSpecU(
__inout LPSTR pszPath
)
{
// Hey, let's re-write the function to also handle forward slashes
// while we're at it!
LPSTR newPath = PathFindFileNameA(pszPath);
if((newPath) && (newPath != pszPath)) {
newPath[0] = TEXT('\0');
return 1;
}
return 0;
}
| /**
* Win32 UTF-8 wrapper
*
* ----
*
* shlwapi.dll functions.
*/
#include <Shlwapi.h>
#include "win32_utf8.h"
BOOL STDAPICALLTYPE PathFileExistsU(
__in LPCSTR pszPath
)
{
BOOL ret;
WCHAR_T_DEC(pszPath);
WCHAR_T_CONV_VLA(pszPath);
ret = PathFileExistsW(pszPath_w);
VLA_FREE(pszPath_w);
return ret;
}
BOOL STDAPICALLTYPE PathMatchSpecU(
__in LPCSTR pszFile,
__in LPCSTR pszSpec
)
{
BOOL ret;
WCHAR_T_DEC(pszFile);
WCHAR_T_DEC(pszSpec);
WCHAR_T_CONV(pszFile);
WCHAR_T_CONV(pszSpec);
ret = PathMatchSpecW(pszFile_w, pszSpec_w);
VLA_FREE(pszFile_w);
VLA_FREE(pszSpec_w);
return ret;
}
BOOL STDAPICALLTYPE PathRemoveFileSpecU(
__inout LPSTR pszPath
)
{
// Hey, let's re-write the function to also handle forward slashes
// while we're at it!
LPSTR newPath = PathFindFileNameA(pszPath);
if((newPath) && (newPath != pszPath)) {
newPath[0] = TEXT('\0');
return 1;
}
return 0;
}
| Reorder function definitions to match their order in the header file. | Reorder function definitions to match their order in the header file.
This is driving me ma~d.
| C | unlicense | thpatch/win32_utf8 |
4c5a3b621d60cff4b112fe48e93d17284f5d23fd | net/netisr_dispatch.h | net/netisr_dispatch.h | /* $NetBSD: netisr_dispatch.h,v 1.2 2000/07/02 04:40:47 cgd Exp $ */
/*
* netisr_dispatch: This file is included by the
* machine dependant softnet function. The
* DONETISR macro should be set before including
* this file. i.e.:
*
* softintr() {
* ...do setup stuff...
* #define DONETISR(bit, fn) do { ... } while (0)
* #include <net/netisr_dispatch.h>
* #undef DONETISR
* ...do cleanup stuff.
* }
*/
#ifndef _NET_NETISR_H_
#error <net/netisr.h> must be included before <net/netisr_dispatch.h>
#endif
/*
* When adding functions to this list, be sure to add headers to provide
* their prototypes in <net/netisr.h> (if necessary).
*/
#ifdef INET
#include "ether.h"
#if NETHER > 0
DONETISR(NETISR_ARP,arpintr);
#endif
DONETISR(NETISR_IP,ipintr);
#endif
#ifdef INET6
DONETISR(NETISR_IPV6,ip6intr);
#endif
#ifdef NETATALK
DONETISR(NETISR_ATALK,atintr);
#endif
#ifdef IMP
DONETISR(NETISR_IMP,impintr);
#endif
#ifdef IPX
DONETISR(NETISR_IPX,ipxintr);
#endif
#ifdef NS
DONETISR(NETISR_NS,nsintr);
#endif
#ifdef ISO
DONETISR(NETISR_ISO,clnlintr);
#endif
#ifdef CCITT
DONETISR(NETISR_CCITT,ccittintr);
#endif
#ifdef NATM
DONETISR(NETISR_NATM,natmintr);
#endif
#include "ppp.h"
#if NPPP > 0
DONETISR(NETISR_PPP,pppintr);
#endif
#include "bridge.h"
#if NBRIDGE > 0
DONETISR(NETISR_BRIDGE,bridgeintr);
#endif
| Add a centralized dispatcher for softnet interrupts. This is so that we won't need to change every arch on a softnet change. | Add a centralized dispatcher for softnet interrupts.
This is so that we won't need to change every arch on a softnet change.
From NetBSD.
| C | isc | orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars |
|
e4fe1d72e8014e510cb2b308df1e353926f7ceab | src/dict.h | src/dict.h | /* Copyright (c) 2012 Fritz Grimpen
*
* Permission is hereby granted, unalloc of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define F_DICT_STRUCTS
#include <f/dict.h>
#define SLOT(h) (((h) * (F_DICT_SLOTS_COUNT - 1)) % F_DICT_SLOTS_COUNT)
#define BUCKET(d, h) ((h) % (d)->buckets_cnt)
| /* Copyright (c) 2012 Fritz Grimpen
*
* Permission is hereby granted, unalloc of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define F_DICT_STRUCTS
#include <f/dict.h>
#define SLOT(h) (((h) * (F_DICT_SLOTS_COUNT - 1)) & (F_DICT_SLOTS_COUNT - 1))
#define BUCKET(d, h) ((h) % (d)->buckets_cnt)
| Replace modulo by AND gatter | Replace modulo by AND gatter
| C | mit | fritz0705/libf |
ddfac6ad96a03c3c6a5a638c4bf50ac00af8a58f | src/scenes/appConstants.h | src/scenes/appConstants.h |
#pragma once
// assume that visuals and code are the same here....
// and also assuming our screen is square :)
#define VISUALS_WIDTH 504
#define VISUALS_HEIGHT 504
#define CODE_WIDTH VISUALS_WIDTH
#define CODE_HEIGHT VISUALS_HEIGHT
#define CODE_X_POS 520 // via the tech staff
//if this is defined, we will wait for type animation
#define TYPE_ANIMATION
#define USE_MIDI_PARAM_SYNC
// if this is defined, we will disable all sound playback inside this app, and instead send
// OpenSoundControl messages which can be used to trigger sounds in another program (e.g. Ableton Live)
//#define USE_EXTERNAL_SOUNDS |
#pragma once
// assume that visuals and code are the same here....
// and also assuming our screen is square :)
#define VISUALS_WIDTH 504
#define VISUALS_HEIGHT 504
#define CODE_WIDTH VISUALS_WIDTH
#define CODE_HEIGHT VISUALS_HEIGHT
#define CODE_X_POS 520 // via the tech staff
//if this is defined, we will wait for type animation
//#define TYPE_ANIMATION
#define USE_MIDI_PARAM_SYNC
// if this is defined, we will disable all sound playback inside this app, and instead send
// OpenSoundControl messages which can be used to trigger sounds in another program (e.g. Ableton Live)
//#define USE_EXTERNAL_SOUNDS | Revert accidental uncommenting of TYPE_ANIMATION | Revert accidental uncommenting of TYPE_ANIMATION
| C | mit | sh0w/recoded,sh0w/recoded,sh0w/recoded,ofZach/dayForNightSFPC,sh0w/recoded,ofZach/dayForNightSFPC,ofZach/dayForNightSFPC,ofZach/dayForNightSFPC |
6ec5fad7e7122413b6e15d07f2ead6a5be8220b9 | locks.h | locks.h | // -*- c++ -*-
#ifndef LOCKS_H
#define LOCKS_H
#include <pthread.h>
namespace locks {
template <typename L>
void unlocker(void* lock_ptr)
{
L* lock = (L*) lock_ptr;
lock->unlock();
}
template <typename L>
void unlocker_checked(void* lock_ptr)
{
L& lock = *((L*) lock_ptr);
if (lock)
lock.unlock();
}
}
#endif /* LOCKS_H */
| // -*- c++ -*-
#ifndef LOCKS_H
#define LOCKS_H
#include <cstdio>
#include <pthread.h>
namespace locks {
template <typename L>
void unlocker(void* lock_ptr)
{
L* lock = (L*) lock_ptr;
fprintf(stderr, "Releasing lock (unchecked) during cancellation!\n");
lock->unlock();
}
template <typename L>
void unlocker_checked(void* lock_ptr)
{
L& lock = *((L*) lock_ptr);
if (lock.owns_lock()) {
fprintf(stderr, "Releasing lock (checked) during cancellation!\n");
lock.unlock();
}
}
}
#endif /* LOCKS_H */
| Add logging etc. to lock release code. | Add logging etc. to lock release code.
| C | lgpl-2.1 | csw/libraft,csw/libraft |
a1b4cdcacd8392ee180de0951263b0d5372fa7ce | src/list.h | src/list.h | #ifndef LIST_H
#define LIST_H
#define NEXT_NODE(node) node->next
#define FINDTAILNODE(x) if(x)while(x->next)x=x->next;
#define ADDNODEAFTER(x,t) if(x){t=x->next; x->next=malloc(sizeof(*t)); x->next->next=t;}
#endif
| #ifndef LIST_H
#define LIST_H
#define NEXT_NODE(node) node->next
#define FINDTAILNODE(x) if(x)while(x->next)x=x->next;
#define ADDNODE(x,t) if(x){t=x; x=malloc(sizeof(*x)); x->next=t;}
#define ADDNODEAFTER(x,t) if(x){t=x->next; x->next=malloc(sizeof(*t)); x->next->next=t;}
#endif
| Add missing macro from last commit. | Add missing macro from last commit.
| C | isc | heckendorfc/libyaml-dom |
b39de78113a9c224df0026ccb9cc629fe3b187e7 | src/util.h | src/util.h | #ifndef UTIL_H
#define UTIL_H
#include <chrono>
#include <numeric>
#include <iterator>
#include <array>
#include <algorithm>
namespace util
{
class Timer
{
public:
Timer() = default;
Timer(bool start_running);
~Timer() = default;
void start();
void stop();
float stop_seconds();
float seconds();
private:
std::chrono::high_resolution_clock::time_point start_time;
std::chrono::high_resolution_clock::time_point stop_time;
};
namespace math
{
template<typename T> int mean(T collection)
{
return std::accumulate(std::begin(collection), std::end(collection), 0) / std::size(collection);
}
} // namespace math
} // namespace util
#endif // UTIL_H
| #ifndef UTIL_H
#define UTIL_H
#include <chrono>
#include <numeric>
#include <iterator>
#include <array>
#include <algorithm>
namespace util
{
class Timer
{
public:
Timer() = default;
Timer(bool start_running);
~Timer() = default;
void start();
void stop();
float stop_seconds();
float seconds();
private:
std::chrono::high_resolution_clock::time_point start_time;
std::chrono::high_resolution_clock::time_point stop_time;
};
namespace math
{
template<typename T> int mean(T collection)
{
if (std::size(collection) == 0)
return 0;
return std::accumulate(std::begin(collection), std::end(collection), 0) / std::size(collection);
}
} // namespace math
} // namespace util
#endif // UTIL_H
| Fix possible divide by zero error | Fix possible divide by zero error
| C | mit | jwkpeter/tincan |
b9b636884725b783c3a33cf762148cbf19e0458d | test/lex.c | test/lex.c | // Copyright 2012 Rui Ueyama <[email protected]>
// This program is free software licensed under the MIT license.
#include "test.h"
#define stringify(x) #x
void digraph(void) {
expect_string("[", stringify(<:));
expect_string("]", stringify(:>));
expect_string("{", stringify(<%));
expect_string("}", stringify(%>));
expect_string("#", stringify(%:));
expect_string("% :", stringify(% :));
expect_string("##", stringify(%:%:));
expect_string("#%", stringify(%:%));
}
void escape(void) {
int value = 10;
expect(10, val\
ue);
}
void whitespace(void) {
expect_string("x y", stringify(xy));
}
void testmain(void) {
print("lexer");
digraph();
escape();
whitespace();
}
| // Copyright 2012 Rui Ueyama <[email protected]>
// This program is free software licensed under the MIT license.
#include "test.h"
#define stringify(x) #x
void digraph(void) {
expect_string("[", stringify(<:));
expect_string("]", stringify(:>));
expect_string("{", stringify(<%));
expect_string("}", stringify(%>));
expect_string("#", stringify(%:));
expect_string("% :", stringify(% :));
expect_string("##", stringify(%:%:));
expect_string("#%", stringify(%:%));
}
void escape(void) {
int value = 10;
expect(10, val\
ue);
}
void whitespace(void) {
expect_string("x y", stringify(xy));
}
void newline(void) {
#
}
void testmain(void) {
print("lexer");
digraph();
escape();
whitespace();
newline();
}
| Add a test for line separator characters. | Add a test for line separator characters.
| C | mit | jtramm/8cc,vastin/8cc,vastin/8cc,8l/8cc,vastin/8cc,nobody1986/8cc,rui314/8cc,cpjreynolds/8cc,abc00/8cc,nobody1986/8cc,gergo-/8cc,rui314/8cc,jtramm/8cc,andrewchambers/8cc,andrewchambers/8cc,nobody1986/8cc,cpjreynolds/8cc,8l/8cc,andrewchambers/8cc,abc00/8cc,andrewchambers/8cc,jtramm/8cc,cpjreynolds/8cc,jtramm/8cc,gergo-/8cc,abc00/8cc,nobody1986/8cc,rui314/8cc,cpjreynolds/8cc,8l/8cc,gergo-/8cc,vastin/8cc,rui314/8cc,8l/8cc,abc00/8cc |
ebfe818d2eb3a5c4e27040f139ae3fb349f13865 | common/math_defs.h | common/math_defs.h | #ifndef AL_MATH_DEFS_H
#define AL_MATH_DEFS_H
#include <math.h>
#ifndef M_PI
#define M_PI (3.14159265358979323846)
#endif
#define F_PI (3.14159265358979323846f)
#define F_PI_2 (1.57079632679489661923f)
#define F_TAU (6.28318530717958647692f)
#define SQRTF_3 1.73205080756887719318f
constexpr inline float Deg2Rad(float x) noexcept { return x * float{M_PI/180.0}; }
constexpr inline float Rad2Deg(float x) noexcept { return x * float{180.0/M_PI}; }
#endif /* AL_MATH_DEFS_H */
| #ifndef AL_MATH_DEFS_H
#define AL_MATH_DEFS_H
#include <math.h>
#ifndef M_PI
#define M_PI (3.14159265358979323846)
#endif
#define F_PI (3.14159265358979323846f)
#define F_PI_2 (1.57079632679489661923f)
#define F_TAU (6.28318530717958647692f)
#define SQRTF_3 1.73205080756887719318f
constexpr inline float Deg2Rad(float x) noexcept { return x * static_cast<float>(M_PI/180.0); }
constexpr inline float Rad2Deg(float x) noexcept { return x * static_cast<float>(180.0/M_PI); }
#endif /* AL_MATH_DEFS_H */
| Fix narrowing conversion from double to float | Fix narrowing conversion from double to float
| C | lgpl-2.1 | aaronmjacobs/openal-soft,aaronmjacobs/openal-soft |
f7285e5f08b0b2aca0caf7fe03b897303c9981bd | Firmware/Inc/platform_hw.h | Firmware/Inc/platform_hw.h | #ifndef PLATFORM_HW_H__
#define PLATFORM_HW_H__
#include <stdbool.h>
#include "color.h"
#include "stm32f0xx_hal.h"
#include "stm32f0xx_hal_gpio.h"
#define LED_CHAIN_LENGTH 10
#define USER_BUTTON_PORT (GPIOA)
#define USER_BUTTON_PIN (GPIO_PIN_0)
#define LED_SPI_INSTANCE (SPI1)
#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
union platformHW_LEDRegister {
uint8_t raw[4];
struct {
//header/global brightness is 0bAAABBBBB
//A = 1
//B = integer brightness divisor from 0x0 -> 0x1F
uint8_t const header :3;
//3 bits always, 5 bits global brightness, 8B, 8G, 8R
//Glob = 0xE1 = min bright
//uint8_t const globalHeader :8;
uint8_t globalBrightness :5;
struct color_ColorRGB color;
};
};
#pragma pack(pop) /* restore original alignment from stack */
bool platformHW_Init(void);
bool platformHW_SpiInit(SPI_HandleTypeDef * const spi, SPI_TypeDef* spiInstance);
void platformHW_UpdateLEDs(SPI_HandleTypeDef* spi);
#endif//PLATFORM_HW_H__
| #ifndef PLATFORM_HW_H__
#define PLATFORM_HW_H__
#include <stdbool.h>
#include "color.h"
#include "stm32f0xx_hal.h"
#include "stm32f0xx_hal_gpio.h"
#define LED_CHAIN_LENGTH 10
#define USER_BUTTON_PORT (GPIOA)
#define USER_BUTTON_PIN (GPIO_PIN_0)
#define LED_SPI_INSTANCE (SPI1)
#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
union platformHW_LEDRegister {
uint8_t raw[4];
struct {
//3 bits always, 5 bits global brightness, 8B, 8G, 8R
//Glob = 0xE1 = min bright
uint8_t globalBrightness :5;
//header/global brightness is 0bAAABBBBB
//A = 1
//B = integer brightness divisor from 0x0 -> 0x1F
uint8_t const header :3;
struct color_ColorRGB color;
};
};
#pragma pack(pop) /* restore original alignment from stack */
bool platformHW_Init(void);
bool platformHW_SpiInit(SPI_HandleTypeDef * const spi, SPI_TypeDef* spiInstance);
void platformHW_UpdateLEDs(SPI_HandleTypeDef* spi);
#endif//PLATFORM_HW_H__
| Fix incorrect LED header bit order | Fix incorrect LED header bit order
| C | mit | borgel/sympetrum-v2,borgel/sympetrum-v2 |
067133a2658b611718a8b111d6c7824dfbf19f56 | jet_string.h | jet_string.h | #ifndef CJET_STRING_H
#define CJET_STRING_H
#include <stdlib.h>
#include <string.h>
static inline char *duplicate_string(const char *s)
{
size_t length = strlen(s);
char *new_string = malloc(length + 1);
if (unlikely(new_string == NULL)) {
return NULL;
}
strncpy(new_string, s, length + 1);
return new_string;
}
#endif
| #ifndef CJET_STRING_H
#define CJET_STRING_H
#include <stdlib.h>
#include <string.h>
static inline char *duplicate_string(const char *s)
{
size_t length = strlen(s);
char *new_string = malloc(length + 1);
if (unlikely(new_string != NULL)) {
strncpy(new_string, s, length + 1);
}
return new_string;
}
#endif
| Simplify string duplication function a bit. | Simplify string duplication function a bit.
| C | mit | gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet |
18e68bd789834bc6a044fdfc0f1de437cd16360c | usart0s.h | usart0s.h | /*
usart0s.h - C interface to routine written in assembler
Compile the corresponding assembler file with
#define C_COMPAT_ASM_CODE 1
Copyright (c) 2015 Igor Mikolic-Torreira. All right reserved.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef usart0s_h
#define usart0s_h
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
void sendUSART0( uint8_t byteToSend );
#ifdef __cplusplus
}
#endif
#endif
| /*
usart0s.h - C interface to routine written in assembler
The MIT License (MIT)
Copyright (c) 2015 Igor Mikolic-Torreira
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef usart0s_h
#define usart0s_h
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
void enableUSART0();
void sendUSART0( uint8_t byteToSend );
#ifdef __cplusplus
}
#endif
#endif
| Revise license and add missing prototype | Revise license and add missing prototype
| C | mit | igormiktor/ASMUtils |
be467abeac9c2b1fba3cd18303a2336e26da8104 | src/ia64/Gset_caching_policy-ia64.c | src/ia64/Gset_caching_policy-ia64.c | /* libunwind - a platform-independent unwind library
Copyright (C) 2002 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "unwind_i.h"
PROTECTED int
unw_set_caching_policy (unw_addr_space_t as, unw_caching_policy_t policy)
{
if (unw.needs_initialization)
ia64_init ();
#ifndef HAVE___THREAD
if (policy == UNW_CACHE_PER_THREAD)
policy = UNW_CACHE_GLOBAL;
#endif
if (policy == as->caching_policy)
return 0; /* no change */
as->caching_policy = policy;
/* Ensure caches are empty (and initialized). */
unw_flush_cache (as, 0, 0);
return 0;
}
| Declare libunwind-entry-points as PROTECTED to ensure local uses get resolved within the library itself. | Declare libunwind-entry-points as PROTECTED to ensure local uses get
resolved within the library itself.
2004/01/03 00:25:12-08:00 hp.com!davidm
Rename: src/ia64/set_caching_policy-ia64.c -> src/ia64/Gset_caching_policy-ia64.c
(Logical change 1.151)
| C | mit | cms-externals/libunwind,SyndicateRogue/libunwind,lat/libunwind,SyndicateRogue/libunwind,igprof/libunwind,krytarowski/libunwind,project-zerus/libunwind,atanasyan/libunwind-android,lat/libunwind,fillexen/libunwind,atanasyan/libunwind,android-ia/platform_external_libunwind,zliu2014/libunwind-tilegx,rantala/libunwind,joyent/libunwind,zliu2014/libunwind-tilegx,android-ia/platform_external_libunwind,zeldin/platform_external_libunwind,libunwind/libunwind,frida/libunwind,Keno/libunwind,zliu2014/libunwind-tilegx,unkadoug/libunwind,unkadoug/libunwind,lat/libunwind,CyanogenMod/android_external_libunwind,cloudius-systems/libunwind,dropbox/libunwind,geekboxzone/mmallow_external_libunwind,libunwind/libunwind,frida/libunwind,zeldin/platform_external_libunwind,geekboxzone/lollipop_external_libunwind,ehsan/libunwind,cms-externals/libunwind,maltek/platform_external_libunwind,evaautomation/libunwind,rantala/libunwind,djwatson/libunwind,Chilledheart/libunwind,CyanogenMod/android_external_libunwind,dagar/libunwind,martyone/libunwind,ehsan/libunwind,vtjnash/libunwind,mpercy/libunwind,vegard/libunwind,joyent/libunwind,rogwfu/libunwind,rntz/libunwind,fdoray/libunwind,project-zerus/libunwind,SyndicateRogue/libunwind,djwatson/libunwind,androidarmv6/android_external_libunwind,jrmuizel/libunwind,wdv4758h/libunwind,0xlab/0xdroid-external_libunwind,dagar/libunwind,rantala/libunwind,joyent/libunwind,dreal-deps/libunwind,dropbox/libunwind,pathscale/libunwind,DroidSim/platform_external_libunwind,geekboxzone/lollipop_external_libunwind,yuyichao/libunwind,bo-on-software/libunwind,adsharma/libunwind,adsharma/libunwind,krytarowski/libunwind,olibc/libunwind,geekboxzone/mmallow_external_libunwind,maltek/platform_external_libunwind,tronical/libunwind,cms-externals/libunwind,igprof/libunwind,adsharma/libunwind,tronical/libunwind,tkelman/libunwind,dreal-deps/libunwind,vegard/libunwind,cloudius-systems/libunwind,mpercy/libunwind,unkadoug/libunwind,rntz/libunwind,project-zerus/libunwind,zeldin/platform_external_libunwind,vegard/libunwind,rntz/libunwind,tony/libunwind,krytarowski/libunwind,evaautomation/libunwind,atanasyan/libunwind,pathscale/libunwind,libunwind/libunwind,Keno/libunwind,yuyichao/libunwind,jrmuizel/libunwind,djwatson/libunwind,atanasyan/libunwind-android,mpercy/libunwind,0xlab/0xdroid-external_libunwind,tony/libunwind,cloudius-systems/libunwind,igprof/libunwind,geekboxzone/lollipop_external_libunwind,Chilledheart/libunwind,tkelman/libunwind,dreal-deps/libunwind,jrmuizel/libunwind,tkelman/libunwind,frida/libunwind,atanasyan/libunwind-android,bo-on-software/libunwind,Chilledheart/libunwind,rogwfu/libunwind,vtjnash/libunwind,androidarmv6/android_external_libunwind,androidarmv6/android_external_libunwind,fillexen/libunwind,pathscale/libunwind,olibc/libunwind,yuyichao/libunwind,olibc/libunwind,fdoray/libunwind,0xlab/0xdroid-external_libunwind,maltek/platform_external_libunwind,Keno/libunwind,atanasyan/libunwind,vtjnash/libunwind,fillexen/libunwind,tronical/libunwind,tony/libunwind,wdv4758h/libunwind,fdoray/libunwind,dropbox/libunwind,CyanogenMod/android_external_libunwind,martyone/libunwind,martyone/libunwind,DroidSim/platform_external_libunwind,bo-on-software/libunwind,wdv4758h/libunwind,DroidSim/platform_external_libunwind,android-ia/platform_external_libunwind,dagar/libunwind,geekboxzone/mmallow_external_libunwind,rogwfu/libunwind,evaautomation/libunwind,ehsan/libunwind |
|
7c74772ff14401da9fde234334add253c8c11010 | DungeonsOfNoudar486/include/RasterizerCommon.h | DungeonsOfNoudar486/include/RasterizerCommon.h | //
// Created by monty on 27/08/16.
//
#ifndef BLANKSLATE_COMMON_H
#define BLANKSLATE_COMMON_H
namespace odb {
#ifdef LOWRES
using FixP = fixed_point<int16_t, -4>;
#else
using FixP = fixed_point<int32_t, -16>;
#endif
class Vec3 {
public:
FixP mX;
FixP mY;
FixP mZ;
};
Vec3 operator+(const Vec3 &v1, const Vec3 &v2);
Vec3 operator-(const Vec3 &v1, const Vec3 &v2);
Vec3 &operator+=(Vec3 &v1, const Vec3 &v2);
Vec3 &operator-=(Vec3 &v1, const Vec3 &v2);
class Vec2 {
public:
FixP mX;
FixP mY;
};
}
#endif //BLANKSLATE_COMMON_H
| //
// Created by monty on 27/08/16.
//
#ifndef BLANKSLATE_COMMON_H
#define BLANKSLATE_COMMON_H
namespace odb {
#ifdef LOWRES
using FixP = fixed_point<int16_t, -3>;
#else
using FixP = fixed_point<int32_t, -16>;
#endif
class Vec3 {
public:
FixP mX;
FixP mY;
FixP mZ;
};
Vec3 operator+(const Vec3 &v1, const Vec3 &v2);
Vec3 operator-(const Vec3 &v1, const Vec3 &v2);
Vec3 &operator+=(Vec3 &v1, const Vec3 &v2);
Vec3 &operator-=(Vec3 &v1, const Vec3 &v2);
class Vec2 {
public:
FixP mX;
FixP mY;
};
}
#endif //BLANKSLATE_COMMON_H
| Bring the lower resolution version back from the dead | Bring the lower resolution version back from the dead
Some textures look warped, but it mostly works.
| C | bsd-2-clause | TheFakeMontyOnTheRun/dungeons-of-noudar,TheFakeMontyOnTheRun/dungeons-of-noudar |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.