提交 34798ee9 编写于 作者: B Ben

_Atomic (prime_s) -> _Atomic prime_s

Because it seems enough compilers allow the latter now.
上级 4f497d3f
......@@ -19,8 +19,8 @@ int get_max_factors(_Atomic(int) *factor_ct, long int max){
}
typedef struct {
_Atomic(long int) *tally;
_Atomic(int) *factor_ct;
_Atomic long int *tally;
atomic_int *factor_ct;
int max, thread_ct, this_thread;
} tally_s;
......
......@@ -14,7 +14,7 @@ typedef struct {
long int max;
} prime_s;
int add_a_prime(_Atomic (prime_s) *pin, long int new_prime){
int add_a_prime(_Atomic prime_s *pin, long int new_prime){
prime_s p = atomic_load(pin);
p.length++;
p.plist = realloc(p.plist, sizeof(long int) * p.length);
......@@ -27,7 +27,7 @@ int add_a_prime(_Atomic (prime_s) *pin, long int new_prime){
typedef struct{
long int i;
_Atomic (prime_s) *prime_list;
_Atomic prime_s *prime_list;
pthread_mutex_t *mutex;
} test_s;
......@@ -57,7 +57,7 @@ void* test_a_number(void *vin){
int main(){
prime_s inits = {.plist=NULL, .length=0, .max=0};
_Atomic (prime_s) prime_list = ATOMIC_VAR_INIT(inits);
_Atomic prime_s prime_list = ATOMIC_VAR_INIT(inits);
pthread_mutex_t m;
pthread_mutex_init(&m, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册