Skip to content

Commit

Permalink
Code cleanup in order to better conform with the C11 standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkallima committed Dec 12, 2024
1 parent 2f52a9a commit 09f1d75
Show file tree
Hide file tree
Showing 61 changed files with 253 additions and 228 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ volatile int64_t object CACHE_ALIGN;
int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i, id;

id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/activesetbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ volatile ToggleVector active_set CACHE_ALIGN;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i, rnum, mybank;
volatile long j;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ccheapbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void* Arg) {
static void *Execute(void* Arg) {
CCHeapThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ccqueuebench.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
CCQueueThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ccstackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
CCStackThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ccsynchbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int64_t d1, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
CCSynchThreadState *th_state;
long i, rnum;
volatile long j;
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/clhbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline void apply_op(RetVal (*sfunc)(void *, ArgVal, int), void *state, ArgVal arg, int pid) {
void apply_op(RetVal (*sfunc)(void *, ArgVal, int), void *state, ArgVal arg, int pid) {
CLHLock(object_lock, pid);
sfunc(state, arg, pid);
#ifdef DEBUG
Expand All @@ -31,7 +31,7 @@ inline void apply_op(RetVal (*sfunc)(void *, ArgVal, int), void *state, ArgVal a
CLHUnlock(object_lock, pid);
}

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i, rnum;
volatile long j;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/clhhashbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
int64_t key, value;
CLHHashThreadState *th_state;
long i, rnum;
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/clhqueuebench.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SynchBenchArgs bench_args CACHE_ALIGN;

__thread SynchPoolStruct pool_node;

inline static void enqueue(Object arg, int pid) {
static void enqueue(Object arg, int pid) {
Node *n = synchAllocObj(&pool_node);

n->val = (Object)arg;
Expand All @@ -48,7 +48,7 @@ inline static void enqueue(Object arg, int pid) {
CLHUnlock(ltail, pid);
}

inline static Object dequeue(int pid) {
static Object dequeue(int pid) {
Object result;
Node *node = NULL;

Expand All @@ -75,7 +75,7 @@ inline static Object dequeue(int pid) {
return result;
}

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i;
long rnum;
int id = synchGetThreadId();
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/clhstackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SynchBenchArgs bench_args CACHE_ALIGN;

__thread SynchPoolStruct pool_node;

inline static void push(Object arg, int pid) {
static void push(Object arg, int pid) {
volatile Node *n = synchAllocObj(&pool_node);
n->val = (Object)arg;
CLHLock(lock, pid); // Critical section
Expand All @@ -41,7 +41,7 @@ inline static void push(Object arg, int pid) {
CLHUnlock(lock, pid);
}

inline static Object pop(int pid) {
static Object pop(int pid) {
Object result;
Node *n = NULL;

Expand All @@ -63,7 +63,7 @@ inline static Object pop(int pid) {
return result;
}

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i;
long rnum;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dsmhashbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
int64_t key, value;
DSMHashThreadState *th_state;
long i, rnum;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dsmheapbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void* Arg) {
static void *Execute(void* Arg) {
DSMHeapThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dsmqueuebench.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
DSMQueueThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dsmstackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
DSMStackThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dsmsynchbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int64_t d1, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
DSMSynchThreadState *th_state;
long i, rnum;
volatile long j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/fadbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i, rnum;
volatile int j;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/fcbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int64_t d1, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
FCThreadState *th_state;
long i, rnum;
volatile long j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/fcheapbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void* Arg) {
static void *Execute(void* Arg) {
FCHeapThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/fcqueuebench.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
FCQueueThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/fcstackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
FCStackThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hheapbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void* Arg) {
static void *Execute(void* Arg) {
HSynchHeapThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hqueuebench.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
HQueueThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hstackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
HStackThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hsynchbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int64_t d1, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
HSynchThreadState th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/lcrqbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
LCRQThreadState thread_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/lfstackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int MIN_BAK, MAX_BAK;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
LFStackThreadState *th_state;
long i;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/lfuobjectbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int MIN_BAK, MAX_BAK;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
LFUObjectThreadState *th_state;
long i, rnum;
volatile long j;
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/mcsbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;


inline void apply_op(RetVal (*sfunc)(void *, ArgVal, int), void *state, ArgVal arg, MCSThreadState *thread_state, int pid) {
void apply_op(RetVal (*sfunc)(void *, ArgVal, int), void *state, ArgVal arg, MCSThreadState *thread_state, int pid) {
MCSLock(object_lock, thread_state, pid);
sfunc(state, arg, pid);
#ifdef DEBUG
Expand All @@ -32,7 +32,7 @@ inline void apply_op(RetVal (*sfunc)(void *, ArgVal, int), void *state, ArgVal a
MCSUnlock(object_lock, thread_state, pid);
}

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i, rnum;
volatile long j;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/msqueuebench.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int MIN_BAK, MAX_BAK;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
MSQueueThreadState *th_state;
long i;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/oscibench.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
OsciThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/osciqueuebench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
OsciQueueThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/oscistackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
OsciStackThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/oyamabench.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static RetVal fetchAndMultiply(ArgVal arg, int pid);
static RetVal fetchAndMultiply(ArgVal arg, int pid);

inline static RetVal fetchAndMultiply(ArgVal arg, int pid) {
static RetVal fetchAndMultiply(ArgVal arg, int pid) {
Object old_val;

old_val = object;
object += 1;
return old_val;
}

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
OyamaThreadState *th_state;
long i, rnum;
volatile int j;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/pthreadsbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int64_t d1 CACHE_ALIGN, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
long i, rnum;
volatile int j;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/simbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;
int MAX_BACK CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
SimThreadState th_state;
long i, rnum;
int id = synchGetThreadId();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/simstackbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int64_t d1, d2;
SynchBarrier bar CACHE_ALIGN;
SynchBenchArgs bench_args CACHE_ALIGN;

inline static void *Execute(void *Arg) {
static void *Execute(void *Arg) {
SimStackThreadState *th_state;
long i = 0;
int id = synchGetThreadId();
Expand Down
Loading

0 comments on commit 09f1d75

Please sign in to comment.