Coding style change

This commit is contained in:
Nils O. Selåsdal
2012-12-05 18:53:58 +01:00
parent d9c8b2b48a
commit 16e1ac52ec
32 changed files with 236 additions and 234 deletions
+7 -7
View File
@@ -15,10 +15,10 @@ void *reader(void *arg)
{
int i;
int last;
for(i = 0; i < CNT/2; i++) {
for (i = 0; i < CNT/2; i++) {
struct uc_threadmsg *msg;
struct my_msg *my;
if(uc_thread_queue_get(&queue, NULL, &msg) != 0) {
if (uc_thread_queue_get(&queue, NULL, &msg) != 0) {
printf("uc_threadqueue_get failed\n");
return NULL;
}
@@ -39,25 +39,25 @@ int main(int argc, char *argv[])
uc_thread_queue_init(&queue, 100);
if(pthread_create(&tid1, NULL, reader, NULL) != 0) {
if (pthread_create(&tid1, NULL, reader, NULL) != 0) {
perror("pthread_create");
return 1;
}
if(pthread_create(&tid2, NULL, reader, NULL) != 0) {
if (pthread_create(&tid2, NULL, reader, NULL) != 0) {
perror("pthread_create");
return 1;
}
for(i = 0; i < CNT; i++) {
for (i = 0; i < CNT; i++) {
struct my_msg *msg = malloc(sizeof *msg);
if(msg == NULL) {
if (msg == NULL) {
perror("malloc");
return 1;
}
msg->uc_msg.msgtype = 11;
msg->counter = i;
if(uc_thread_queue_add(&queue, &msg->uc_msg) != 0) {
if (uc_thread_queue_add(&queue, &msg->uc_msg) != 0) {
printf("uc_threadqueue_add failed\n");
return 2;
}