Skip to content

БДЗ-3#4

Open
AlekseyBoyarov wants to merge 1 commit into
SergeyBalabaev:mainfrom
AlekseyBoyarov:main
Open

БДЗ-3#4
AlekseyBoyarov wants to merge 1 commit into
SergeyBalabaev:mainfrom
AlekseyBoyarov:main

Conversation

@AlekseyBoyarov

Copy link
Copy Markdown

ИВТ-24_Бояров_БДЗ-3

@IlyaChichkov IlyaChichkov self-requested a review May 23, 2025 11:14

@okuroshi okuroshi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавь больше тестов, также ориентированных на проблему многопоточности. Исправь stylecode. Найди какой тебе больше нравится и используй его, также приложи ссылку на него.

Comment thread fakultativ_bdz3.c
} List;

typedef struct ArgProcFunc {
int option; // 1 - единицы с конца, 0 - нули с головы

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо комментария добавь enum

Comment thread fakultativ_bdz3.c
List* list;
} ArgProcFunc;

int sumBits(const int* num, const int* option) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

Comment thread fakultativ_bdz3.c
}


void* threadFunc(void* arg_func) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

Comment thread fakultativ_bdz3.c
return NULL;
}

void printList(const List* list) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

Comment thread fakultativ_bdz3.c
}

List* createList(int n) {
List* list = (List*)malloc(sizeof(List));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

Comment thread fakultativ_bdz3.c
scanf_s("%d", &n);
srand(time(NULL));
List* list = createList(n);
//printList(list);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это тут зачем ?

Comment thread fakultativ_bdz3.c

pthread_mutex_init(&mutex, NULL);


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем лишние строки ?

Comment thread fakultativ_bdz3.c
arg_proc_func->option = option;
arg_proc_func->count_bits = count_bits;
arg_proc_func->pass_elements = pass_elements;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет строки

Comment thread fakultativ_bdz3.c
list->end_list->next = current_node;
}
else {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем лишняя ?

Comment thread fakultativ_bdz3.c
return count_bit;
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут тоже лишняя

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants